feat(dashboard): add Table of Contents right rail with bulk collapse/expand#2350
Conversation
…expand Adds a toggleable right-rail Table of Contents to the dashboard page plus "Collapse all sections" / "Expand all sections" actions, all surfaced from a new "View" section in the existing dashboard menu. - TOC visibility is persisted per-user via localStorage (off by default). - Bulk collapse uses the same per-viewer URL state as single-section toggling — shareable via link, does not mutate the dashboard's stored defaults. - Clicking a TOC entry scrolls the section into view, auto-expanding it first if collapsed. - Local (unsaved) dashboards keep the existing behaviour of having no 3-dot menu. Includes unit tests for the new DashboardTableOfContents component with 100% coverage.
🦋 Changeset detectedLatest commit: 39f345f The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Review process: Full human review — logic, architecture, edge cases. Stats
|
E2E Test Results✅ All tests passed • 192 passed • 3 skipped • 1293s
Tests ran across 4 shards in parallel. |
Deep ReviewScope: 5 files, +576/-116 (1 new component, 1 new test file, DBDashboardPage layout/menu wiring, DashboardContainer anchor id, changeset). 🟡 P2 -- recommended
🔵 P3 nitpicks (6)
Reviewers (9): correctness, testing, maintainability, project-standards, agent-native, learnings-researcher, kieran-typescript, julik-frontend-races, adversarial. Testing gaps:
|
The "Show table of contents", "Collapse all sections", and "Expand all sections" items are noise when a dashboard has no groups. Wrap the whole View block in a `containers.length > 0` guard so they only appear once the user has created at least one section. The collapse/expand items remain visible-but-disabled when sections exist but none are collapsible, matching the previous behaviour.
react-grid-layout's WidthProvider only listens to window resize events, so toggling the right-rail TOC shrank the grid's flex column without triggering a tile re-layout — tiles kept rendering at the old width and the TOC overlapped them. Dispatch a synthetic resize event after the layout commits to nudge RGL into remeasuring.
Summary
Adds a toggleable right-rail Table of Contents to the dashboard page, plus "Collapse all sections" and "Expand all sections" actions — all surfaced from a new "View" section in the existing dashboard menu. The TOC lists every section, click-to-jump scrolls into view and auto-expands a collapsed target, and rail visibility persists per user via localStorage (off by default). Bulk collapse/expand uses the same per-viewer URL state as the existing single-section toggle, so it's shareable via link and does not mutate the dashboard's stored defaults.
Screenshots or video
Node-js-Runtime-Metrics-.-ClickStack.mp4
How to test on Vercel preview
Preview routes: /dashboards
Steps:
collapsed=orexpanded=parameter.References