fix(web): fix dark mode by changing @theme inline to @theme in index.css#4
fix(web): fix dark mode by changing @theme inline to @theme in index.css#4ada-evorada wants to merge 4 commits intoclaude/cranky-johnsonfrom
Conversation
Resolves critical SSRF vulnerability in axios (<1.15.0) and moderate vulnerabilities in hono/node-server and hono via npm audit fix. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CI Failures ResolvedFixes Applied
Verification
|
suda
left a comment
There was a problem hiding this comment.
Summary
The dark mode fix is correct and well-scoped. The @theme inline → @theme change is the right fix for Tailwind v4 dark mode, the test fixes are accurate, and the chart dark-palette approach is clean. One issue worth addressing before merge.
Code Issues
Should Fix
-
All 5 chart components —
theme === 'dark'will not match when the user has selected "system" as their theme preference. In that casenext-themesreturns'system'fromtheme, not'dark', even when the OS is actually in dark mode. The hook also providesresolvedThemewhich resolves'system'to the actual'light'or'dark'value. All five files share the same pattern and should useresolvedThemeinstead:// current (broken for system theme) const { theme } = useTheme(); const isDark = theme === 'dark'; // fix const { resolvedTheme } = useTheme(); const isDark = resolvedTheme === 'dark';
Files affected:
work-item-cost-chart.tsx,work-item-duration-chart.tsx,project-work-duration-chart.tsx,work-item-duration-bar.tsx,project-work-table.tsx
…in charts Fixes chart dark mode not working when user has "system" theme selected. next-themes returns 'system' from `theme` when OS dark mode is active, but `resolvedTheme` correctly resolves to 'dark' or 'light' in all cases. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
suda
left a comment
There was a problem hiding this comment.
Summary
LGTM. The core CSS fix is correct, the implementation is consistent across all 5 chart components, and the test fixes are sound. All CI checks pass.
Nitpick (non-blocking)
In web/src/lib/chart-colors.ts, the comment block above CHART_PALETTE_DARK lists oklch hex approximations of the dark-mode theme chart colors (e.g. #4d6ef5, #38c98a…) but the actual palette entries below are different — they are brighter variants of the light-mode palette. The comment and the values don't correspond, which could confuse a future maintainer. A one-liner clarifying that the palette uses brightened light-mode variants rather than the theme oklch values would help.
Summary
Fixes dark mode not working correctly across the dashboard UI.
@theme inlineinweb/src/index.csscaused all semantic token utility classes (bg-sidebar,bg-card,bg-background,bg-muted, etc.) to be compiled as static hardcoded light-mode values, making.darkCSS variable overrides completely ineffective@theme inline {→@theme {so all semantic tokens usevar()references that respond to dark mode — this fixes the sidebar, main layout, cards, tables, dialogs, and every component using semantic tokensbg-white→bg-white dark:bg-zinc-100for toggle thumb inagent-definition-shared.tsxCHART_PALETTE_DARKwith brighter colors for dark backgrounds; updatedgetAgentColor(agentType, dark?)to accept dark mode flag; passeduseTheme()context to all 5 chart componentscredential-scoping.test.ts(env var cleanup usingdeleteinstead of assignment toundefined) andwebhooks.test.ts(missinggitlabOnly: falsefield added by GitLab integration work)Files Changed
web/src/index.css—@theme inline→@theme(root cause fix)web/src/components/settings/agent-definition-shared.tsx— Toggle thumbbg-white→bg-white dark:bg-zinc-100web/src/lib/chart-colors.ts— AddedCHART_PALETTE_DARK, updatedgetAgentColor()to accept optionaldarkparamweb/src/components/runs/work-item-cost-chart.tsx— UseuseTheme()to pass dark flag to color functionsweb/src/components/runs/work-item-duration-chart.tsx— UseuseTheme()to pass dark flag to color functionsweb/src/components/runs/project-work-duration-chart.tsx— UseuseTheme()to pass dark flag tobuildDurationChartData()web/src/components/projects/work-item-duration-bar.tsx— UseuseTheme()to pass dark flag tobuildDurationSegments()web/src/components/projects/project-work-table.tsx— UseuseTheme()to pass dark flag togetAgentColor()tests/unit/cli/credential-scoping.test.ts— Fix env var cleanup withdeleteoperatortests/unit/cli/dashboard/webhooks/webhooks.test.ts— AddgitlabOnly: falseto expected webhook call argsTest plan
npm test— all 7349 tests pass (377 test files)npm run typecheck— no type errorsCard: https://trello.com/c/m1yHLDkm/10-the-dark-mode-doesnt-seem-to-be-working-correctly
🤖 Generated with Claude Code