feat(desktop): componentize workspace shell

This commit is contained in:
DragonnZhang 2026-04-25 10:35:10 +08:00
parent f2bdecc489
commit f9fc432b8e
15 changed files with 1610 additions and 882 deletions

View file

@ -0,0 +1,57 @@
# Electron Desktop Workspace Review Shell
Date: 2026-04-25
Slice: 11
## Scope
This slice componentized the renderer workbench into explicit shell regions:
top bar, project/thread sidebar, conversation thread, review panel, and terminal
drawer. It also added stable DOM landmarks that future Playwright Electron and
Chrome DevTools MCP tests can assert without coupling to visual copy.
## Automated Coverage Added
- `packages/desktop/src/renderer/components/layout/WorkspacePage.test.tsx`
- Environment: Vitest jsdom component smoke test
- Scenario:
- Render `WorkspacePage` with fake desktop runtime, project, session, Git
diff, empty terminal, and initial store state.
- Assert stable landmarks are present:
- `desktop-workspace`
- `project-sidebar`
- `workspace-topbar`
- `workspace-grid`
- `chat-thread`
- `review-panel`
- `terminal-drawer`
- `project-list`
- `thread-list`
- Assert representative project, branch, changed file, and terminal empty
state text render into the DOM.
## Diagnostic Plan For Future Electron E2E
When the Slice 14 Electron harness lands, reuse these same landmarks and collect
on failure:
- Renderer screenshot of the first viewport.
- DOM snapshot containing each `data-testid` landmark.
- Console errors and failed network requests from the CDP connection.
- Main process logs and server URL/token redacted status.
## Execution Result
- `npm run test --workspace=packages/desktop` passed: 9 files, 53 tests.
- `npm run typecheck --workspace=packages/desktop` passed.
- `npm run lint --workspace=packages/desktop` passed.
- `npm run build --workspace=packages/desktop` passed.
- `npm run build` passed. Existing VS Code companion lint warnings were
warnings only and unrelated to this slice.
- `npm run typecheck` passed.
## Remaining Risk
This is a component-level E2E precursor, not a launched Electron screenshot/CDP
test. The full Electron harness must still verify these landmarks in a real
renderer process with screenshot, console, network, and first-paint checks.