Skip to content

fix(webview): fill the panel width on the loading screen and every page - #401

Draft
Sanjay Singh (san360) wants to merge 2 commits into
mainfrom
san360-fix-full-width-layout
Draft

Sanjay Singh (san360) wants to merge 2 commits into
mainfrom
san360-fix-full-width-layout

Conversation

@san360

@san360 Sanjay Singh (san360) commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

On a wide editor tab or canvas the dashboard left an empty band on the right: the loading screen's tile field stopped at ~1,170 px with the card centred in that area, and every page stopped at the same edge. This PR makes the loading screen and every page fill the panel, in both hosts (the VS Code webview and the Copilot app canvas share dashboard-shell.ts and styles.css).

Root causes

  1. #content { max-width: 1200px } (left-aligned, from the initial commit). Every page and the loading screen live in #content, so anything wider than 1,200 px + sidebar got an empty band: 528 px at 1,920 px and 1,168 px at 2,560 px on every page; in loading mode (sidebar 0 px) 748 px / 1,388 px, with the card 360 px / 680 px left of centre.
  2. Tile grid only re-laid out on window.resize. layoutWorkspaceGrid() sizes rows/columns from the tile field's size, but the field also changes width without a window resize: the sidebar animates its width (280 ms) when loading mode starts and again when it ends during the ready summary. The cap hid this at wide widths; without the cap the grid kept a stale column count. It now uses a ResizeObserver on the container (coalesced to one layout per frame, window.resize only as a fallback) and is disconnected when the dashboard replaces the loading screen.
  3. Page-level caps that became visible once (1) was gone: Learning 1,000 px, SDLC 1,000 px, Achievements 900 px, GitHub App pages 1,120 px (centred), Share 700 px.

Design decisions (maintainer)

  • No global max-width. This is a data dashboard inside an editor tab, not an article. Charts already use maintainAspectRatio: false with fixed-height containers and card grids use auto-fit/1fr tracks, so wider panels add columns or longer axes instead of stretching anything tall. Prose keeps its existing ch-based line-length limits (for example 68ch/70ch/90ch descriptions).
  • Loading screen is full-bleed: #content:has(> .load-index) { padding: 0 }, which also covers the ready summary and fade-out after the shell leaves loading mode.
  • Removed the caps on Learning, SDLC, Achievements and both GitHub App pages; they are card/table layouts like the rest.
  • Kept the Share tab at 700 px, centred: it previews a fixed-size image card, so stretching it would not show anything more. Its empty space is now symmetric and deliberate.
  • Out of scope (unchanged): a few tables and the Curiosity layout scroll inside #content at 560 px on main already (the panel itself never scrolls sideways; the new spec checks that).

Empty space right of the drawn content, per page and width (synthetic e2e harness data, px; main → this PR)

Measured from painted boxes and text runs inside #content, after the sidebar transition settles. 28 px is the content padding.

Page 1024 1440 1920 2560
Loading screen (tile field) 28 → 0 268 → 0 748 → 0 1388 → 0
Loading card offset from centre 0 → 0 −120 → 0 −360 → 0 −680 → 0
Dashboard 28 → 28 48 → 28 528 → 28 1168 → 28
Timeline 27 → 27 47 → 27 527 → 27 1167 → 27
Output 28 → 28 48 → 28 528 → 28 1168 → 28
Patterns (Work Hours / Calendar / Projects) 0–28 → same 48 → 28 528 → 28 1168 → 28
Curiosity 24 → 24 44 → 24 524 → 24 1164 → 24
GitHub App: Productivity 28 → 28 60 → 28 540 → 28 1180 → 28
GitHub App: Issue credits 28 → 28 60 → 28 540 → 28 1180 → 28
Anti-Patterns (+ Rules) 28 → 28 48 → 28 528 → 28 1168 → 28
Rule Playground 28 → 28 48 → 28 528 → 28 1168 → 28
Skill Finder 28 → 28 48 → 28 528 → 28 1168 → 28
Context Health (4 sub-tabs) 28 → 28 48 → 28 528 → 28 1168 → 28
Level Up: Learning 28 → 28 192 → 28 672 → 28 1312 → 28
Level Up: Achievements 28 → 28 292 → 28 772 → 28 1412 → 28
Level Up: SDLC 28 → 28 192 → 28 672 → 28 1312 → 28
Level Up: Share (centred by design) 76 → 52 492 → 260 972 → 500 1612 → 820

At 560 px nothing changes: the sidebar takes 220 px and the cap never applied. The tile grid's column count matched its container at every width after the change (e.g. 54 → 67 columns at 1,920 px). Coding Moments and Data Explorer only show centred empty or error states in the harness (no mock data) and have no page cap. The same measurement on real local data through the canvas host gave the same before/after pattern (every page 528 → 28 px at 1,920 px; loading field 748 → 0 px).

Tests

  • Unit (loading-grid-view.test.ts): the grid re-lays out when its container widens without a window resize, and a replacement container is observed while the old one isn't, with disconnect on dispose. Both fail on main (expected 24 to be greater than 24; no observer created).
  • e2e (full-width.spec.ts, new): at 1,440 and 1,920 px the tile field spans the panel and the card is centred, and every page (16 pages/sub-tabs) reaches the right padding after the sidebar settles; the Share card stays ≤ 700 px and centred; at 1,024 px the grid re-lays out when the sidebar returns without a window resize; at 560 px neither the loading screen nor any page scrolls the panel sideways.
  • Harness fixes needed for those pages to render: the GitHub App productivity mock used an old shape (no delivery/workspacePrCohorts), which also threw before the issue-credits snapshot applied; the flow-state mock lacked suggestions/overallFlowScore, which crashed Level Up → Learning.

Validation

Command Result
npx vitest run src/webview/loading-grid-view.test.ts 13 passed (new cases fail on main's grid code)
npm run check passed: 0 lint errors (490 warnings, same as main), spellcheck 0 issues, knip clean, 4,220 tests passed, 5 skipped
npm run build passed
npm run check-size passed (dist/extension.js 1.86 MB, within 2 MB)
E2E_PORT=<free port> npx playwright test tests/e2e/full-width.spec.ts 8 passed
E2E_PORT=<free port> npx playwright test --workers=2 (full suite) 265 passed, 7 skipped, 1 failed: navigation.spec.ts "page content changes on navigation", a pre-existing timing flake (with --repeat-each=5: this branch 20/20 passed, main 16/20)
npm run package then npm run test:vscode -- --vsix ai-engineer-coach-0.1.0.vsix 9 passing (synthetic sessions, without Copilot, changelog)

Related Issues

None filed; reported directly by a user ("Why is there a blank space on the right? Why isn't it full screen?"), on the loading screen from #393 and on the dashboard pages.

Checklist

  • npm run check passes (typecheck + lint + spellcheck + knip + tests)
  • Changes are covered by tests (if applicable)
  • Documentation updated (if applicable) — no doc page describes the content width
  • User-visible changes are described in a changelog.d/<PR number>.md fragment

The dashboard stopped at 1200 px (#content max-width, left-aligned), so a wide
editor tab or canvas showed an empty band on the right: 528 px at 1920 px and
1168 px at 2560 px on every page, and the loading card sat off-centre.

- Remove the #content max-width; the loading screen's tile field is full-bleed
  (no page padding while it is mounted, also during the ready summary).
- Re-lay the tile grid out with a ResizeObserver on its container (rAF
  coalesced, disconnected when the dashboard replaces the loading screen), so
  the sidebar's width transition no longer leaves a stale column count.
- Drop the page caps on Learning, SDLC, Achievements and the GitHub App pages;
  the Share tab keeps its 700 px card preview, now centred.
- e2e: new full-width spec (1440/1920 fill, share centred, grid relayout
  without a window resize, no sideways scroll at 560 px); fix the harness
  GitHub App and flow-state mocks so those pages render.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the full-width dashboard layout changes.

No open issues 🎉

What changed in this PR

Makes the shared dashboard fill wide VS Code panels and Copilot app canvases, removing the empty right-hand band from the loading screen and data pages.

Changes:

  • Removes global and page-level width caps, makes loading full-bleed, and keeps Share capped at 700 px and centred.
  • Observes loading-container size changes so tiles reflow during sidebar transitions, with cleanup when loading ends.
  • Adds layout regression coverage and corrects harness fixtures needed to render affected pages.
File Description
tests/​e2e/​harness.html Corrects GitHub App and flow-state mock response shapes.
tests/​e2e/​full-width.spec.ts Tests page widths, loading geometry, Share centring, and narrow-panel overflow.
src/​webview/​styles.css Removes global content and Achievements width caps.
src/​webview/​styles-pages.css Removes the SDLC cap and centres Share.
src/​webview/​styles-loading.css Removes content padding while loading remains mounted.
src/​webview/​styles-learning.css Removes the Learning page width cap.
src/​webview/​styles-github-app.css Removes the shared GitHub App page width cap.
src/​webview/​loading-grid-view.ts Adds container resize observation, frame-coalesced layout, and disposal.
src/​webview/​loading-grid-view.test.ts Covers container resizing, replacement, and observer cleanup.
src/​webview/​app.ts Disposes the loading grid before navigating to page content.
changelog.d/​401.md Documents full-width layouts, tile reflow, and Share centring.

Review effort: Balanced

@san360

Copy link
Copy Markdown
Contributor Author

Copilot review round 1 (head b2f0ac7): approval recommended, no findings and no threads, so the review loop stops here. CI verify, CodeQL and dependency review are green. Width decisions (no global cap; Share stays 700 px, centred) are recorded in the description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants