refactor: extract theme settings panel#166
refactor: extract theme settings panel#166ndycode wants to merge 1 commit intorefactor/pr1-route-fix-directfrom
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
settings-hub.tsinto a dedicated panel moduleWhat Changed
lib/codex-manager/theme-settings-panel.tscontaining the theme panel prompt flow and its local action modellib/codex-manager/settings-hub.tssopromptThemeSettings(...)delegates to the extracted panel moduleValidation
npm run test -- test/codex-manager-cli.test.tsnpm run lintnpm run typechecknpm run buildRisk and Rollback
51aab76to restore the inline theme panel implementation insettings-hub.tsAdditional Notes
note: greptile review for oc-chatgpt-multi-auth. cite files like
lib/foo.ts:123. confirm regression tests + windows concurrency/token redaction coverage.Greptile Summary
this PR extracts the theme-settings interaction loop from
settings-hub.tsinto a newlib/codex-manager/theme-settings-panel.tsmodule, keeping the hub as a thin delegation shim. it's a clean, low-risk slice of the ongoing settings-hub split.ThemeConfigActionunion type and the fullwhile(true)prompt loop are moved to the new file; the hub'spromptThemeSettingsnow delegates viapromptThemeSettingsPanel(initial, deps)with all required helpers injectedThemeSettingsPanelDeps) makes the new module straightforwardly testable in isolationsettings-hub-utils.test.tscancel-baseline test still exercises the flow through the delegation path, but the four action branches (set-palette,set-accent,reset,save) in the new standalone module have no direct vitest coverage — a dedicatedtest/codex-manager/theme-settings-panel.test.tsshould be addedConfidence Score: 4/5
Important Files Changed
promptThemeSettingsnow forwards to the panel module; no logic changes,ThemeConfigActiontype moved to the new file, import order adjustedSequence Diagram
sequenceDiagram participant Caller participant settings-hub.ts participant theme-settings-panel.ts participant select (UI) Caller->>settings-hub.ts: promptThemeSettings(initial) settings-hub.ts->>theme-settings-panel.ts: promptThemeSettingsPanel(initial, deps) theme-settings-panel.ts->>theme-settings-panel.ts: cloneDashboardSettings(initial) → baseline, draft loop while awaiting user action theme-settings-panel.ts->>select (UI): select(items, options) select (UI)-->>theme-settings-panel.ts: ThemeConfigAction alt cancel / null theme-settings-panel.ts->>theme-settings-panel.ts: applyUiThemeFromDashboardSettings(baseline) theme-settings-panel.ts-->>settings-hub.ts: null else save theme-settings-panel.ts-->>settings-hub.ts: draft else reset theme-settings-panel.ts->>theme-settings-panel.ts: applyDashboardDefaultsForKeys(draft, THEME_PANEL_KEYS) else set-palette / set-accent theme-settings-panel.ts->>theme-settings-panel.ts: applyUiThemeFromDashboardSettings(draft) end end settings-hub.ts-->>Caller: DashboardDisplaySettings | nullPrompt To Fix All With AI
Last reviewed commit: "refactor: extract th..."