Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1c6b32c
remove subTitle
sajjadmrx Feb 1, 2026
93dd17a
update mood ttl
sajjadmrx Feb 1, 2026
0c74ca5
fix icons
sajjadmrx Feb 1, 2026
6c183d8
fix
sajjadmrx Feb 1, 2026
bbbfc78
notifications_analytics
sajjadmrx Feb 1, 2026
3db529a
note toggle expand
sajjadmrx Feb 1, 2026
5c120b8
feat(search): add google image search and refactor voice search UI
sajjadmrx Feb 2, 2026
d9c9982
fix
sajjadmrx Feb 2, 2026
7c33aa8
fix and add cache
sajjadmrx Feb 2, 2026
f7f19bf
fix name
sajjadmrx Feb 2, 2026
84ddc84
fix name
sajjadmrx Feb 2, 2026
7d0291b
fix toast
sajjadmrx Feb 2, 2026
72648a4
fix
sajjadmrx Feb 2, 2026
5322894
fix moods
sajjadmrx Feb 2, 2026
b29a4a9
improve UI
sajjadmrx Feb 5, 2026
e14b5ee
improve bookmark
sajjadmrx Feb 5, 2026
51279e6
fix user icon
sajjadmrx Feb 5, 2026
b9f43cd
remove icon
sajjadmrx Feb 5, 2026
0d7fe99
add no-internet image fallback for bookmarks
sajjadmrx Feb 5, 2026
fac7785
add BlurModeButton component and integrate it into various layouts
sajjadmrx Feb 5, 2026
1291acf
refactor TodosLayout to integrate BlurModeButton and clean up unused …
sajjadmrx Feb 5, 2026
17f4712
add background glass effect to dropdown animation
sajjadmrx Feb 5, 2026
defc8e6
refactor button styles to remove border for a cleaner UI
sajjadmrx Feb 5, 2026
e3659ad
refactor BookmarksList and FolderHeader for improved UI and functiona…
sajjadmrx Feb 5, 2026
b0bf304
refactor: enhance favicon retrieval and improve bookmark icon handling
sajjadmrx Feb 5, 2026
d76c0ec
refactor: remove unused todoOptions and clean up related code
sajjadmrx Feb 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions background/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ import { ExpirationPlugin } from 'workbox-expiration'
import { registerRoute } from 'workbox-routing'
import { CacheFirst, NetworkFirst, StaleWhileRevalidate } from 'workbox-strategies'
import { NavigationRoute } from 'workbox-routing'
const allowedPaths = [
'/extension/wigi-pad-data',
'/date/events',
'/news/rss',
'/currencies',
'/wallpapers',
'/contents',
]

export function setupCaching() {
if (typeof self !== 'undefined' && '__WB_MANIFEST' in self) {
Expand All @@ -11,6 +19,29 @@ export function setupCaching() {
})
}

registerRoute(
({ url, request }) => {
if (request.method !== 'GET') return false
if (url.origin !== 'https://api.widgetify.ir') return false

return allowedPaths.some((path) => url.pathname.startsWith(path))
},

new StaleWhileRevalidate({
cacheName: 'widgetify-public-api',
plugins: [
new CacheableResponsePlugin({
statuses: [200],
}),
new ExpirationPlugin({
maxEntries: 150,
maxAgeSeconds: 60 * 60 * 5,
purgeOnQuotaError: true,
}),
],
})
)

const isDev = import.meta.env.DEV

if (!isDev) {
Expand Down
Binary file added src/assets/images/no-internet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/common/constant/moods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ export const moodOptions = [
colorClass: 'error',
borderClass: 'border-error/50',
},
{
value: 'normal',
emoji: '😴',
label: '',
colorClass: 'warning',
borderClass: 'border-yellow-400/50',
},
{
value: 'tired',
emoji: '😴',
Expand Down
4 changes: 2 additions & 2 deletions src/common/constant/store.key.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { CurrencyColorMode } from '@/context/currency.context'
import type { Theme } from '@/context/theme.context'
import type { TodoOptions } from '@/context/todo.context'
import type { WidgetItem } from '@/context/widget-visibility.context'
import type { Bookmark } from '@/layouts/bookmark/types/bookmark.types'
import type { PetSettings } from '@/layouts/widgetify-card/pets/pet.context'
Expand Down Expand Up @@ -63,7 +62,6 @@ export interface StorageKV {
}[]
calendarDrawerState: boolean
pets: PetSettings
todoOptions: TodoOptions
youtubeSettings: {
username: string | null
subscriptionStyle: 'short' | 'long'
Expand All @@ -89,5 +87,7 @@ export interface StorageKV {
petState: boolean
showNewBadgeForReOrderWidgets: boolean
navbarVisible: boolean
todoFilter: string
todoSort: string
[key: `removed_notification_${string}`]: string
}
3 changes: 2 additions & 1 deletion src/common/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ export async function setWithExpiry<K extends keyof StorageKV>(
value: StorageKV[K],
minutes: number
) {
const expiry = Date.now() + minutes * 60000
const safeMinutes = Math.max(1, minutes)
const expiry = Date.now() + safeMinutes * 60_000
const data = { value, expiry }

await setToStorage(key, data as any)
Expand Down
21 changes: 11 additions & 10 deletions src/common/toast.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type React from 'react'
import React from 'react'
import toast from 'react-hot-toast'
import { playAlarm } from './playAlarm'

Expand Down Expand Up @@ -165,17 +165,18 @@ export function showToast(
)
}
} else {
toast.custom((t) => (
<div
className={`${t.visible ? 'animate-enter' : 'animate-leave'} max-w-md w-full bg-white shadow-lg rounded-lg pointer-events-auto flex ring-1 ring-black ring-opacity-5`}
>
<div className="flex-1 w-0 p-4">
<div className="flex items-start">
<div className="flex-1 ml-3">{message}</div>
if (React.isValidElement(message))
toast.custom((t) => (
<div
className={`${t.visible ? 'animate-enter' : 'animate-leave'} max-w-md w-full bg-white shadow-lg rounded-lg pointer-events-auto flex ring-1 ring-black ring-opacity-5`}
>
<div className="flex-1 w-0 p-4">
<div className="flex items-start">
<div className="flex-1 ml-3">{message}</div>
</div>
</div>
</div>
</div>
))
))
}

if (options?.alarmSound) {
Expand Down
2 changes: 1 addition & 1 deletion src/common/utils/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const getFaviconFromUrl = (url: string): string => {
}

const urlObj = new URL(processedUrl)
return `https://www.google.com/s2/favicons?domain=${urlObj.hostname}&sz=64`
return `https://www.google.com/s2/favicons?domain=${urlObj.hostname}&sz=64&fallback_opts=404`
} catch {
return ''
}
Expand Down
10 changes: 10 additions & 0 deletions src/components/badges/new.badge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
interface Prop {
className: string
}
export function NewBadge({ className }: Prop) {
return (
<span
className={`absolute w-2 h-2 rounded-full ${className} bg-error animate-pulse`}
></span>
)
}
25 changes: 25 additions & 0 deletions src/components/blur-mode/blur-mode.button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { useGeneralSetting } from '@/context/general-setting.context'
import Tooltip from '../toolTip'
import { Button } from '../button/button'
import { FaEye, FaEyeSlash } from 'react-icons/fa'

export function BlurModeButton() {
const { blurMode, updateSetting } = useGeneralSetting()

const handleBlurModeToggle = () => {
const newBlurMode = !blurMode
updateSetting('blurMode', newBlurMode)
}

return (
<Tooltip content={blurMode ? 'نمایش' : 'حالت مخفی'}>
<Button
size="sm"
onClick={handleBlurModeToggle}
className={`px-2 py-0! border-none! rounded-xl text-base-content/40 shrink-0 active:scale-95 h-7!`}
>
{blurMode ? <FaEye /> : <FaEyeSlash />}
</Button>
</Tooltip>
)
}
2 changes: 2 additions & 0 deletions src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface ButtonProps {
children?: React.ReactNode
isPrimary?: boolean
size: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
ref?: any
}
export function Button(prop: ButtonProps) {
const sizes: Record<string, string> = {
Expand All @@ -32,6 +33,7 @@ export function Button(prop: ButtonProps) {
disabled={prop.disabled}
className={`btn cursor-pointer ${prop.fullWidth ? 'full-width' : ''} ${prop.className} ${prop.rounded ? `rounded-${prop.rounded}` : ''} ${prop.isPrimary ? 'btn-primary text-white' : ''} ${sizes[prop.size] || 'btn-md'} active:!translate-y-0`}
style={prop.style}
ref={prop.ref}
>
{prop.loading
? prop.loadingText || (
Expand Down
2 changes: 1 addition & 1 deletion src/components/date-picker/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { DatePicker as SimpleDatePicker } from './date-picker'
export { DatePicker } from './date-picker'
Loading