Cursor prompt: Add WorkspaceStore module¶
Prerequisites¶
Read:
Non-goals¶
- WorkspaceRegistry
- Migrate all panels
- Persist state to disk
Current state¶
- No centralized store; panels use local useState
- messages.ts defines LSP payload types
Tasks¶
- Add zustand (or use existing state lib if present) to webview-ui package.json if needed
- Create extension/webview-ui/src/store/types.ts with WorkspaceStore slice types from WORKSPACE_RUNTIME.md
- Create extension/webview-ui/src/store/workspaceStore.ts with initial state and selectors
- Create extension/webview-ui/src/store/index.ts exports
- Add store/workspaceStore.test.ts with focus/selection update tests
Acceptance criteria¶
- [ ] Store initializes with null focus
- [ ] Tests cover setFocus and setSelection
- [ ] Types match platform doc
Tests¶
cd extension/webview-ui && npm test
Do not¶
- Do not wire every panel yet
- Do not add event bus until prompt 05