Repository navigation
chore(dev-portal): collapsible stack cards with slot and ClickHouse version - #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. |
…improve pill contrast (#3834) ## Summary Follow-up to #3827: show each stack's ClickHouse version, add an expand/collapse all button, and fix low-contrast pill text on the dev portal. - Each card header shows the ClickHouse version (`ClickHouse 26.10.3.7`) next to the slot badge, read from the container's image tag that `docker ps` already returns, so there are no extra queries. Distinct versions across a worktree's environments are listed together. - An "Expand all" / "Collapse all" button sits in the tab bar on the Live tab. It reads "Collapse all" only when every card is open; when some are collapsed it expands them all. The choice is saved like the per-card toggle. - Pill text (slot, ClickHouse version, LOCAL/DOCKER, DEV/E2E/INT) now meets 4.5:1 contrast in both themes. Light mode was at 2.0–3.0:1 and is now 5.3–7.4:1; the two weakest dark-mode pills go from 4.6–4.8:1 to 6.0–8.5:1. ### Screenshots or video _To be added by author._ --- > [!NOTE] > **Low Risk** > Changes are limited to debug reporting, dev-tooling UI, and stylesheet tokens; no auth, billing, or query-path logic. > > **Overview** > **Copy debug info** now adds one `clickhouse:` line per saved connection (name + server version), placed after the backend line. Versions are prefetched when the Help menu’s debug item is mounted (using cached `getServerVersion` per connection) so clipboard copy still works under Safari’s user-gesture rules. `setHdxClickHouseVersions` holds the data until versions are known; tests cover omission vs. listing. > > **Dev portal** stacks API now attaches a parsed Docker image tag as each container’s `version`; Live cards show distinct ClickHouse versions in the header beside the slot badge. The Live tab gets **Expand all / Collapse all**, with state persisted like per-card toggles. Badge/pill colors use dedicated `--pill-*` tokens so slot, env, and type labels meet ~4.5:1 contrast in light and dark themes. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 2950c34. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
Summary
Make each worktree card on the dev portal's Live tab collapsible and show its dev slot number and ClickHouse version 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.ClickHouse 26.10.3.7), read from the container's image tag thatdocker psalready returns, so there are no extra queries. Distinct versions across a worktree's environments are listed together.Screenshots or video