feat(settings): add global hooks panel - #1154
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Stack
This is 2 of 4 in the Zoo Code hooks MVP stack. Review and merge from the bottom upward. Do not merge this PR until #1153 is merged.
mainfm/zoo-hooks-contractsfm/zoo-hooks-settingssessionStartintegrationfm/zoo-hooks-session-startpreToolUse, E2E, and documentationSummary
Add the complete persisted-settings round trip and a dedicated Hooks settings panel, while keeping unsaved edits isolated in
SettingsView.cachedState.Scope
hookDefinitionsto global settings, extension state,ContextProxy, andClineProviderstate returned to the webview.webviewMessageHandler; malformed definitions are rejected without partially persisting data.cachedStateand persist only through the existing explicit Save flow.Settings Flow
flowchart LR A[Hooks panel controls] --> B[SettingsView cachedState] B -->|Save| C[updateSettings message] C --> D[Atomic schema validation] D -->|valid| E[ContextProxy persistence] D -->|invalid| F[Localized error, no write] E --> G[ClineProvider state] G --> H[Webview refresh] H --> BTests
packages/types/src/__tests__/hooks.test.tssrc/core/config/__tests__/ContextProxy.spec.tssrc/core/config/__tests__/importExport.spec.tssrc/core/webview/__tests__/ClineProvider.spec.tssrc/core/webview/__tests__/webviewMessageHandler.spec.tswebview-ui/src/components/settings/__tests__/HooksSettings.spec.tsxwebview-ui/src/components/settings/__tests__/SettingsView.spec.tsxHooksSettings.tsxreached 95.08% line coverage.pnpm test(437 files passed, 7,356 tests passed, 39 skipped).pnpm check-types,pnpm lint, andpnpm buildpassed.USE_MOCK=true TEST_FILE=hooks.test pnpm --filter @roo-code/vscode-e2e test:runpassed.Risks
cachedState; binding them to live extension state would reintroduce save races and discarded edits.Review Notes
fm/zoo-hooks-contracts, notmain.8089b3c4afixes the malformed-payload test type and expands panel interaction coverage; no published history was rewritten.#1153->#1154->#1156->#1155.