fix(canvas): restore left project sidebar

This commit is contained in:
inman
2026-09-07 14:31:43 +08:00
parent 918f8f80dc
commit b95f1b4df5
8 changed files with 116 additions and 62 deletions

View File

@@ -0,0 +1,60 @@
# Task: Restore AI design project sidebar
## Identity
- Task ID: 20260907-restore-design-project-sidebar-6f8b2a1c
- Mode: Feature
- Branch: codex/20260907-restore-design-project-sidebar-6f8b2a1c-restore-design-sidebar
- Worktree: /Users/inmanx/Documents/makelore-restore-design-sidebar
- Base commit: 918f8f80dca61b0f561f96b168e4ef541734d414
- Owner: codex
- Status: Ready for Integration
## Scope
- Restore AI Design Workspace navigation to the left-side project rail on desktop.
- Keep the central conversation and active production plan unchanged, and avoid a duplicate desktop project list on the right.
- Preserve a compact-layout project Sheet for non-Electron/browser-sized viewports.
- Update focused layout/Canvas tests, the shared Electron Canvas fixture, and README product-state copy.
## Intent And Constraints
- Treat the user's report as explicit product-owner correction of the September 7 right-rail presentation decision.
- Preserve ADR-007 semantic authority: one Workspace, one current Direction, one Living Form/Specification, one active plan, and immutable Quote confirmation.
- Reuse the existing MainLayout Sidebar and ImageWorkspaceSidebar for desktop rather than introducing another project state owner.
- Preserve Canvas cloud-only/Main-owned transport, project create/select/rename/delete behavior, the single light visual system, and compact-layout access.
- Do not modify the concurrent Plugin drawer task or the occupied main worktree.
## Outcome
- Canvas again mounts the shared application Sidebar on `/image-canvas`, so the existing `ImageWorkspaceSidebar` provides desktop Workspace create/select/rename/delete navigation on the left and the title-bar collapse/expand control is available again.
- The shared Sidebar accepts a Canvas-only compact visibility policy: it is hidden below the desktop breakpoint so browser-sized compact layouts do not squeeze the conversation surface.
- The Canvas page no longer renders a duplicate desktop `DesignWorksRail` on the right. Its conversation and active editable plan use the full remaining content width.
- Compact layouts retain `DesignWorksRail` as a Sheet, now opening from the left. Empty-state project creation still routes to the mounted desktop Sidebar or compact Sheet through the existing event contract.
- Canvas header spacing and loading skeleton now match the restored left sidebar, while retaining macOS logo and Windows caption-control safe areas.
- README now describes the restored left project sidebar and compact left Sheet.
## Verification
- `corepack pnpm install --frozen-lockfile` — passed with pinned pnpm `10.33.4`; lockfile unchanged.
- `corepack pnpm exec vitest run tests/unit/main-layout-module-gate.test.tsx tests/unit/image-canvas-page.test.tsx --maxWorkers=4` — 2 files / 21 tests passed.
- `corepack pnpm exec eslint src/components/layout/MainLayout.tsx src/components/layout/Sidebar.tsx src/pages/ImageCanvas/index.tsx tests/unit/main-layout-module-gate.test.tsx tests/unit/image-canvas-page.test.tsx tests/e2e/image-workspace-v2.spec.ts` — passed with no output.
- `corepack pnpm run typecheck` — passed.
- `corepack pnpm run build:vite` — Renderer/Main/Preload/utility production compile passed; existing dynamic-import, chunk-size, and stale Browserslist warnings only.
- `corepack pnpm test` — 226 normal files / 1,912 tests passed with 3 skips, then pressure 1/1 passed.
- `corepack pnpm run lint:check` — 0 errors; 5 pre-existing warnings in `src/pages/Home/index.tsx` and `src/pages/Makelore/index.tsx`.
- `corepack pnpm exec playwright test tests/e2e/image-workspace-v2.spec.ts` — 2/2 passed. Desktop geometry proves a 256 px left Sidebar directly adjacent to the conversation with no right duplicate; compact geometry hides the shared Sidebar and opens the Works Sheet from the left.
- `git diff --check` — passed.
## Follow-ups
- Promote the recorded Canvas placement amendment into canonical project memory during a serialized Integration Gate.
## Promotion Candidates
- Target canonical documents: ADR-007, system overview, module/data-flow maps, business rules, current state, and any shared Canvas layout wording.
Proposal: amend the Canvas presentation description from a right-side Works rail to the restored desktop left project sidebar, with compact layouts retaining a project Sheet.
Evidence: direct user correction on 2026-09-07 plus the focused regression/Electron layout verification from this task.
Future impact: future Canvas redesigns must keep Workspace navigation visible on the left unless another explicit product decision changes it.
Semantic conflicts: supersedes only ADR-007's September 7 rail placement amendment; it does not change V2 Workspace/Specification/Quote authority.
Human confirmation required: no additional confirmation; the user supplied the correcting product direction in this task.