|
| 1 | +# PC Style Polish Phase 2 Implementation Plan |
| 2 | + |
| 3 | +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. |
| 4 | +
|
| 5 | +**Goal:** Tighten the remaining desktop settings chrome gaps and expand desktop UI review coverage with deeper workspace states. |
| 6 | + |
| 7 | +**Architecture:** Keep the phase-1 page structure intact, then layer a desktop-only settings header shell on top of the existing settings route while preserving the mobile header path. Extend `ui-preview` with isolated desktop review scenes for workspace editor and diff states so future visual review covers more than empty and launcher states. |
| 8 | + |
| 9 | +**Tech Stack:** React, TypeScript, Jotai, Vitest, Playwright `e2e-ui`, CSS tokens in `packages/web/src/styles` |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +### Task 1: Add a dedicated desktop settings header shell |
| 14 | + |
| 15 | +**Files:** |
| 16 | +- Modify: `packages/web/src/features/settings/components/settings-page.tsx` |
| 17 | +- Modify: `packages/web/src/features/settings/components/settings-page.test.tsx` |
| 18 | +- Modify: `packages/web/src/styles/components.css` |
| 19 | +- Modify: `packages/web/src/styles/components.theme.test.ts` |
| 20 | + |
| 21 | +- [x] **Step 1: Write the failing tests** |
| 22 | + |
| 23 | +Add a desktop-only assertion in `settings-page.test.tsx` that checks: |
| 24 | +- `.settings-header__desktop` renders on desktop |
| 25 | +- `.settings-header .mobile-page-header` is absent on desktop |
| 26 | +- the current section pill shows the active section label |
| 27 | + |
| 28 | +Add CSS assertions in `components.theme.test.ts` that check: |
| 29 | +- `.settings-header__desktop` uses a centered max-width layout |
| 30 | +- `.settings-header__section-pill` uses elevated panel styling |
| 31 | +- mobile header assertions still target `.mobile-page-header` |
| 32 | + |
| 33 | +- [x] **Step 2: Run the focused tests and verify they fail** |
| 34 | + |
| 35 | +Run: `pnpm --filter @coder-studio/web exec vitest run src/features/settings/components/settings-page.test.tsx src/styles/components.theme.test.ts` |
| 36 | + |
| 37 | +Expected: |
| 38 | +- settings page test fails because desktop header selectors do not exist |
| 39 | +- theme test fails because new desktop header selectors are missing |
| 40 | + |
| 41 | +- [x] **Step 3: Implement the desktop settings header** |
| 42 | + |
| 43 | +In `settings-page.tsx`: |
| 44 | +- render `MobilePageHeader` only for mobile |
| 45 | +- add a desktop header block with back action, product/title copy, active section summary, and a section pill using the active section icon |
| 46 | + |
| 47 | +In `components.css`: |
| 48 | +- keep existing mobile overrides intact |
| 49 | +- add `.settings-header__desktop`, `.settings-header__copy`, `.settings-header__summary`, `.settings-header__section-pill`, and related desktop-only spacing/alignment rules |
| 50 | + |
| 51 | +- [x] **Step 4: Re-run the focused tests and verify green** |
| 52 | + |
| 53 | +Run: `pnpm --filter @coder-studio/web exec vitest run src/features/settings/components/settings-page.test.tsx src/styles/components.theme.test.ts` |
| 54 | + |
| 55 | +Expected: |
| 56 | +- both test files pass with `0 failed` |
| 57 | + |
| 58 | +### Task 2: Expand desktop UI review coverage to editor and diff states |
| 59 | + |
| 60 | +**Files:** |
| 61 | +- Modify: `packages/web/src/ui-preview/scenes/desktop-review-scenes.tsx` |
| 62 | +- Modify: `packages/web/src/ui-preview/scene-metadata.ts` |
| 63 | +- Modify: `packages/web/src/ui-preview/scene-metadata.test.ts` |
| 64 | +- Modify: `packages/web/src/ui-preview/catalog.test.tsx` |
| 65 | + |
| 66 | +- [x] **Step 1: Write the failing tests** |
| 67 | + |
| 68 | +Add metadata assertions for two new scene ids: |
| 69 | +- `workspace-editor-review` |
| 70 | +- `workspace-diff-review` |
| 71 | + |
| 72 | +Add catalog render tests that check: |
| 73 | +- editor review renders a desktop review card plus code editor chrome |
| 74 | +- diff review renders a desktop review card plus git diff content |
| 75 | + |
| 76 | +- [x] **Step 2: Run the focused preview tests and verify they fail** |
| 77 | + |
| 78 | +Run: `pnpm --filter @coder-studio/web exec vitest run src/ui-preview/scene-metadata.test.ts src/ui-preview/catalog.test.tsx` |
| 79 | + |
| 80 | +Expected: |
| 81 | +- metadata test fails because the new scene ids are not registered |
| 82 | +- catalog test fails because the new scenes do not exist yet |
| 83 | + |
| 84 | +- [x] **Step 3: Implement the new desktop review scenes** |
| 85 | + |
| 86 | +In `desktop-review-scenes.tsx`: |
| 87 | +- add helper state for a realistic code editor view |
| 88 | +- add `workspace-editor-review` with a preloaded text editor surface |
| 89 | +- add `workspace-diff-review` with a populated `GitDiffViewer` |
| 90 | + |
| 91 | +In `scene-metadata.ts`: |
| 92 | +- register both scenes as desktop-only review entries with `.desktop-review-card` capture selectors |
| 93 | + |
| 94 | +- [x] **Step 4: Re-run the focused preview tests and verify green** |
| 95 | + |
| 96 | +Run: `pnpm --filter @coder-studio/web exec vitest run src/ui-preview/scene-metadata.test.ts src/ui-preview/catalog.test.tsx` |
| 97 | + |
| 98 | +Expected: |
| 99 | +- both preview test files pass with `0 failed` |
| 100 | + |
| 101 | +### Task 3: Run regression verification for the phase-2 polish slice |
| 102 | + |
| 103 | +**Files:** |
| 104 | +- No code changes required unless regressions surface |
| 105 | + |
| 106 | +- [x] **Step 1: Re-run targeted component and preview tests** |
| 107 | + |
| 108 | +Run: `pnpm --filter @coder-studio/web exec vitest run src/features/settings/components/settings-page.test.tsx src/styles/components.theme.test.ts src/ui-preview/scene-metadata.test.ts src/ui-preview/catalog.test.tsx src/features/workspace/index.test.tsx src/features/command-palette/components/command-palette.test.tsx` |
| 109 | + |
| 110 | +Expected: |
| 111 | +- all selected tests pass |
| 112 | + |
| 113 | +- [x] **Step 2: Re-run targeted desktop captures** |
| 114 | + |
| 115 | +Run: `pnpm --dir e2e-ui exec playwright test --config playwright.config.ts --project desktop --workers 4 --grep '(settings-light-theme-review|settings-density-review|workspace-editor-review|workspace-diff-review|workspace-topbar-review|workspace-terminal-empty-review|desktop-overlay-review|desktop-statusbar-review) \\[desktop/'` |
| 116 | + |
| 117 | +Expected: |
| 118 | +- desktop review capture matrix passes for the touched scenes |
| 119 | + |
| 120 | +- [x] **Step 3: Rebuild the report** |
| 121 | + |
| 122 | +Run: `pnpm --dir e2e-ui exec tsx report/build-report.ts` |
| 123 | + |
| 124 | +Expected: |
| 125 | +- report command exits `0` |
| 126 | + |
| 127 | +## Verification Notes |
| 128 | + |
| 129 | +- `pnpm --filter @coder-studio/web exec vitest run src/features/settings/components/settings-page.test.tsx src/styles/components.theme.test.ts` |
| 130 | + - Result: `Test Files 2 passed (2)`, `Tests 102 passed (102)` |
| 131 | +- `pnpm --filter @coder-studio/web exec vitest run src/ui-preview/scene-metadata.test.ts src/ui-preview/catalog.test.tsx` |
| 132 | + - Result: `Test Files 2 passed (2)`, `Tests 25 passed (25)` |
| 133 | +- `pnpm --filter @coder-studio/web exec vitest run src/features/settings/components/settings-page.test.tsx src/styles/components.theme.test.ts src/ui-preview/scene-metadata.test.ts src/ui-preview/catalog.test.tsx src/features/workspace/index.test.tsx src/features/command-palette/components/command-palette.test.tsx` |
| 134 | + - Result: `Test Files 6 passed (6)`, `Tests 149 passed (149)` |
| 135 | +- `pnpm --dir e2e-ui exec playwright test --config playwright.config.ts --project desktop --workers 4 --grep '(settings-light-theme-review|settings-density-review|workspace-editor-review|workspace-diff-review|workspace-topbar-review|workspace-terminal-empty-review|desktop-overlay-review|desktop-statusbar-review) \\[desktop/'` |
| 136 | + - Result: `120 passed (7.8m)` |
| 137 | +- `pnpm --dir e2e-ui exec tsx report/build-report.ts` |
| 138 | + - Result: exited `0` |
0 commit comments