Repository navigation
chore(dev-portal): make stack cards collapsible and show slot number - #3827
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
| [...contentEl.querySelectorAll('.stack-card')] | ||
| .find(card => card.dataset.key === focusedKey) | ||
| ?.querySelector('.stack-toggle') | ||
| .focus(); |
There was a problem hiding this comment.
🟡 P2 — Restoring focus every 3s scrolls the page back to the toggle
.focus() scrolls the element into view by default. Say a user clicks a card header (Chrome and Firefox give the button focus) and then scrolls down to another card or the log rows. The next auto-refresh will jump the page back to that toggle, and so will every one after it. Call .focus({ preventScroll: true }) instead.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
| </div> | ||
| <div class="stack-card${collapsed ? ' collapsed' : ''}" data-key="${escapeHtml(key)}"> | ||
| <div class="stack-header stack-header-toggle" onclick="onStackHeaderClick(event, this)"> | ||
| <button type="button" class="stack-toggle" aria-expanded="${!collapsed}"> |
There was a problem hiding this comment.
🟡 P2 — Branch and worktree text can no longer be selected or copied
The branch name and worktree path were a plain <div>. Now they sit inside a <button> within a header that toggles on click. Browsers don't let you drag-select text inside a button, and double-clicking the branch name to select it toggles the card twice. Put only the chevron (with an aria-label) in the toggle button, or keep the title text outside it and stop toggling when getSelection() is non-empty.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
| // Collapsed live cards, keyed like groupByWorktree. Persisted so the | ||
| // choice survives reloads; cards are expanded by default. | ||
| const COLLAPSED_STORAGE_KEY = 'hdx-dev-portal-collapsed'; | ||
| const collapsedStacks = new Set( |
There was a problem hiding this comment.
🟡 P2 — A malformed stored value throws at top level and stops the whole portal script
new Set(JSON.parse(...)) runs at script load. If the stored value isn't valid JSON or isn't an array (e.g. {}), it throws and everything after it in the script never runs: refresh(), the interval, the toggles. Wrap the read in try/catch and fall back to [] when Array.isArray fails.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
| const collapsed = !collapsedStacks.has(key); | ||
| if (collapsed) collapsedStacks.add(key); | ||
| else collapsedStacks.delete(key); | ||
| localStorage.setItem( |
There was a problem hiding this comment.
🟡 P2 — Collapsed keys are never pruned, so removed worktrees stay collapsed
Entries are only removed when a user expands a card, so old worktree paths stay in localStorage for good. If someone collapses a card, tears down that worktree, and later recreates one at the same path, its card comes back already collapsed. When rendering, prune collapsedStacks down to the keys present in groupByWorktree(stacks), but skip pruning when the list is empty so a brief stack-less refresh doesn't wipe it.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
PR Review
5 finding(s): 🔴 0 P0/P1 · 🟡 4 P2 · 🔵 1 P3 4 posted as inline comment(s) on the changed lines. 1 P3 folded at the bottom. 🔵 1 P3 — no action needed before merge
Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides. |
Deep Review✅ No critical issues found. This is a self-contained, human-facing dev-portal change (vanilla JS in 🟡 P2 — recommended
🔵 P3 nitpicks (5)
Reviewers (9): correctness, testing, maintainability, project-standards, agent-native, learnings-researcher, julik-frontend-races, adversarial, previous-comments. Testing gaps: No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
E2E Test Results✅ All tests passed • 477 passed • 1 skipped • 1096s
Tests ran across 4 shards in parallel. |
Summary
Make each worktree card on the dev portal's Live tab collapsible and show its dev slot number in the header.
<button aria-expanded>with a chevron, so the toggle works with the keyboard and screen readers.localStorage, so it survives page reloads. Cards start expanded.Slot 3), orSlots 3, 12if a worktree's environments run on different slots.Screenshots or video