refactor(ui): isolate theme selector state - #864
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryThe PR extracts theme resolution, committed selection, and transient previews into a dedicated controller while preserving theme identity across catalog reloads.
Confidence Score: 4/5The PR appears safe to merge after the non-blocking test-import convention issue is corrected. The theme-controller behavior is focused and well covered; the only accepted concern is the newly added dynamic import in the interaction test. Files Needing Attention: src/ui/AppHost.interactions.test.tsx Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
Bootstrap[Bootstrap theme inputs] --> Controller[Theme selector controller]
Catalog[Custom theme catalog] --> Controller
Controller --> Committed[Committed theme identity]
Controller --> Preview[Transient preview identity]
Committed --> Resolve[Resolve base theme]
Preview --> Resolve
Resolve --> Transparent{Transparent background?}
Transparent -->|Yes| Projection[Transparent surface projection]
Transparent -->|No| Active[Active theme]
Projection --> Active
Controller --> Selector[Theme selector dialog]
Committed --> Preferences[Persisted view preferences]
Committed --> Extensions[Extension theme event on acceptance]
Prompt To Fix All With AI### Issue 1
src/ui/AppHost.interactions.test.tsx:23
**Avoid dynamic test imports**
The newly added `await import("./App")` conflicts with the repository testing guideline requiring imports to be hoisted to the top level, making module initialization order less explicit; use a static top-level import instead.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "refactor(ui): isolate theme selector sta..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
bun test src/ui/hooks/useThemeSelectorController.test.tsxbun test src/ui/AppHost.interactions.test.tsx --test-name-pattern 'theme|transparent background'bun run typecheckbun run deps:checkbun run test:theme-contrastbun run format:checkbun run lintThis PR description was generated by Pi using GPT-5.6 Sol