Skip to content

fix(ui): isolate theme hook from refreshable provider - #2878

Merged
Charlesthebird merged 1 commit into
kagent-dev:mainfrom
Dragonzz27:codex/fix-theme-refresh-2872
Sep 21, 2026
Merged

Charlesthebird merged 1 commit into
kagent-dev:mainfrom
Dragonzz27:codex/fix-theme-refresh-2872

Conversation

@Dragonzz27

Copy link
Copy Markdown
Contributor

Fixes #2872.

Summary

  • Move the theme context and useThemeMode into a non-component module, leaving themeMode.tsx with only its provider export.
  • Update consumers while preserving the public app-extension re-export.
  • Cover fallback behavior, system preference, explicit/persisted choice, and single-palette extensions.

Verification

From ui/:

  • yarn exec eslint src/theme --max-warnings 0 — passes; the original module fails this check with react-refresh/only-export-components.
  • yarn test — 528 tests passed.
  • yarn typecheck and yarn build — passed.
  • yarn lint — no errors; 7 unrelated existing warnings remain.
  • yarn test:pw theme-contrast.spec.ts app-shell --project=chromium — all 12 Chromium cases passed in the combined browser run.

Firefox was also attempted, including a single-worker retry, but the local Firefox process exits before running tests with Could not find profile folder. No Firefox pass is claimed.

Implemented with AI assistance; all changes were reviewed and validated locally.

@github-actions github-actions Bot added the bug Something isn't working label Sep 19, 2026
@Charlesthebird
Charlesthebird added this pull request to the merge queue Sep 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 21, 2026
@Charlesthebird
Charlesthebird added this pull request to the merge queue Sep 21, 2026
Merged via the queue into kagent-dev:main with commit d511815 Sep 21, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] themeMode.tsx exports a hook beside its provider, warning on every lint run

2 participants