refactor: extract behavior settings panel#167
refactor: extract behavior settings panel#167ndycode wants to merge 1 commit intorefactor/pr2-theme-settings-splitfrom
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/behavior-settings-panel.tscontaining the behavior panel prompt flow and its local action modellib/codex-manager/settings-hub.tssopromptBehaviorSettings(...)delegates to the extracted panel moduleValidation
npm run test -- test/codex-manager-cli.test.tsnpm run lintnpm run typechecknpm run buildRisk and Rollback
66d07c6to restore the inline behavior 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 behavior settings interaction loop from
settings-hub.tsinto a dedicatedbehavior-settings-panel.tsmodule, continuing the ongoing settings-hub split. the extracted panel accepts all formerly-closed-over helpers and constants via an explicitBehaviorSettingsPanelDepsinterface — same pattern astheme-settings-panel.ts— which keepssettings-hub.ts'spromptBehaviorSettingsas a thin one-call delegator.BehaviorConfigActiondiscriminated union is re-exported from the new module (previously private tosettings-hub.ts), making it available for future testing or consumerslib/AGENTS.mdand the rootAGENTS.mdstill describecodex-manager/as containing onlysettings-hub.ts; both should be updated to listbehavior-settings-panel.ts(andtheme-settings-panel.tsfrom the prior split)test/behavior-settings-panel.test.ts) was added; the deps-injection design makes this easy to add and would cover branches like the non-TTY early return,set-menu-quota-ttlcycling whencurrentIndex < 0, and the number-key shortcuts inonInputConfidence Score: 4/5
ttlMsfield in set-menu-quota-ttl actionImportant Files Changed
result.ttlMsis unused in the cycling handlerBehaviorConfigActionremoved,promptBehaviorSettingsnow callspromptBehaviorSettingsPanelwith correct deps; no logic changes, no token or fs surface introducedSequence Diagram
sequenceDiagram participant SH as settings-hub.ts<br/>promptBehaviorSettings() participant BP as behavior-settings-panel.ts<br/>promptBehaviorSettingsPanel() participant SEL as ui/select SH->>BP: call with (initial, deps{}) BP->>BP: TTY guard (return null if non-TTY) BP->>BP: clone draft from initial loop while true BP->>SEL: await select(items, options) SEL-->>BP: BehaviorConfigAction result alt cancel / null BP-->>SH: return null else save BP-->>SH: return draft else reset BP->>BP: applyDashboardDefaultsForKeys(draft, BEHAVIOR_PANEL_KEYS) else toggle-pause / toggle-menu-limit-fetch / toggle-menu-fetch-status BP->>BP: spread-update draft field else set-menu-quota-ttl BP->>BP: cycle to next index in MENU_QUOTA_TTL_OPTIONS_MS else set-delay BP->>BP: draft.actionAutoReturnMs = result.delayMs end endPrompt To Fix All With AI
Last reviewed commit: "refactor: extract be..."