diff --git a/biome.json b/biome.json index c1baa08..b1e0f71 100644 --- a/biome.json +++ b/biome.json @@ -35,13 +35,15 @@ "suspicious": { "noUnknownAtRules": "off", "useIterableCallbackReturn": "off", - "noArrayIndexKey": "warn", + "noArrayIndexKey": "off", "noExplicitAny": "off" }, "a11y": { "useSemanticElements": "off", "useButtonType": "off", - "noAutofocus": "off" + "noAutofocus": "off", + "useMediaCaption": "off", + "noStaticElementInteractions": "off" }, "performance": { "noImgElement": "warn" diff --git a/services/frontend/src/app/(dashboard)/dashboard/view.tsx b/services/frontend/src/app/(dashboard)/dashboard/view.tsx index 202420f..45375e4 100644 --- a/services/frontend/src/app/(dashboard)/dashboard/view.tsx +++ b/services/frontend/src/app/(dashboard)/dashboard/view.tsx @@ -253,7 +253,10 @@ export function DashboardView({
{m.top_emojis.slice(0, 3).map((e, i) => ( - + {e.emoji} ))} diff --git a/services/frontend/src/components/charts/donut.tsx b/services/frontend/src/components/charts/donut.tsx index dab9f7d..c70018e 100644 --- a/services/frontend/src/components/charts/donut.tsx +++ b/services/frontend/src/components/charts/donut.tsx @@ -21,7 +21,13 @@ export function Donut({ className="relative inline-flex items-center justify-center" style={{ width: size, height: size }} > - + - + void; + /** Render as a Link when present; otherwise run the action. */ + href?: string; + run?: () => void; } export function CommandPalette() { - const router = useRouter(); const { theme, setTheme } = useTheme(); const [open, setOpen] = useState(false); const [query, setQuery] = useState(""); @@ -35,7 +35,7 @@ export function CommandPalette() { label: `Go to ${n.label}`, hint: n.href, icon: , - run: () => router.push(n.href), + href: n.href, })); const actions: Command[] = [ { @@ -52,7 +52,7 @@ export function CommandPalette() { }, ]; return [...nav, ...actions]; - }, [router, theme, setTheme]); + }, [theme, setTheme]); const filtered = useMemo(() => { const q = query.trim().toLowerCase(); @@ -96,8 +96,10 @@ export function CommandPalette() { const runAt = (i: number) => { const c = filtered[i]; if (!c) return; - setOpen(false); - c.run(); + if (c.run) { + setOpen(false); + c.run(); + } }; return ( @@ -126,7 +128,12 @@ export function CommandPalette() { setActive((a) => Math.max(a - 1, 0)); } else if (e.key === "Enter") { e.preventDefault(); - runAt(active); + const c = filtered[active]; + if (c?.href) { + setOpen(false); + } else { + runAt(active); + } } }} placeholder="Type a command or search…" @@ -143,30 +150,50 @@ export function CommandPalette() { No commands
) : ( - filtered.map((c, i) => ( - - )) + ); + return c.href ? ( + setActive(i)} + onClick={() => setOpen(false)} + className="block" + > + {row} + + ) : ( + + ); + }) )}
diff --git a/services/frontend/src/components/primitives/avatar.tsx b/services/frontend/src/components/primitives/avatar.tsx index abf40e4..fd17c80 100644 --- a/services/frontend/src/components/primitives/avatar.tsx +++ b/services/frontend/src/components/primitives/avatar.tsx @@ -35,12 +35,11 @@ export function Avatar({ style={dim} > {src ? ( - // eslint-disable-next-line @next/next/no-img-element - {name ) : ( >; }) { - const router = useRouter(); return ( - + ); } @@ -47,7 +45,7 @@ export function NavRail() {