Skip to content

fix(web): keep every monitoring-sidebar entry inside its column (#2675) - #2688

Merged
cliffhall merged 2 commits into
v2/mainfrom
v2/fix/2675-monitor-entry-clipping
Oct 12, 2026
Merged

cliffhall merged 2 commits into
v2/mainfrom
v2/fix/2675-monitor-entry-clipping

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2675

Cause

EmbeddableScrollArea wraps every monitoring-sidebar list in an autosize Mantine ScrollArea, whose content slot gets min-width: min-content. Only the Network panel opted out of that (constrainContentWidth, #1623). The Protocol compact header puts its target in a non-wrapping inner ScrollArea, so a long target such as a minted resource URI made the list's min-content as wide as the URI. Every card grew to that width and was clipped at the panel edge, along with its controls.

What changed

  • EmbeddableScrollArea: constrains its content to the viewport whenever embedded. The rule applies to every sidebar tab and no longer depends on each panel opting in. Full-size behavior is unchanged.
  • Narrowest-width layout (320px, the divider's minimum). Once cards fit the column, a squeeze appeared inside them: every compact header line was nowrap, so badges and buttons shrank until their labels clipped. Each line now wraps its trailing cluster onto a line of its own, right-aligned:
    • ProtocolEntry lines 1 and 2. The target keeps a minimum scroll window, and goes to its own line below a long method badge. A long subscription id now scrolls in place too.
    • NetworkEntry line 1 (its badges wrap as well).
    • The TaskCard header.
    • The LogEntry compact meta row (a long logger name wraps).
  • Tests:
    • expectNoHorizontalOverflow (src/test/scrollAreaStoryAssertions.ts): a Storybook play assertion that the list viewport doesn't scroll sideways, every row, card and button ends inside it, and no button or badge label is cut short.
    • New Embedded* stories at 320px (src/test/narrowSidebarDecorator.tsx) for Protocol (collapsed and expanded, including the reported long resources/read URI), Network, Logs, Tasks and Console.
    • Without the fix, the Protocol and Tasks stories fail (expected 1150 to be less than or equal to 279). With the stricter label check, Logs and Network fail at 320px too.
    • New unit cases pin the embedded constraint.

Screenshots

These are Storybook captures of each sidebar panel at 320px, the narrowest sidebar width, before and after. No test server exposes a long-URI resource, and the stories exercise exactly the layout this PR changes.

Before After
Protocol (long URI + long subscription id)
Protocol, expanded
Tasks
Network
Logs
Console (already wrapped; covered by the new assertion)

Verification

npm run format then npm run local:gate, green on top of #2685 (the #2676 typecheck fix that v2/main needed).

🤖 Generated with Claude Code

A single long Protocol target (a minted resource URI) widened the whole
sidebar list, clipping every card's border and pushing its controls out of
view. The autosize ScrollArea's content slot sizes to its min-content, and
only the Network panel opted out of that; the Protocol target's non-wrapping
inner ScrollArea made the list's min-content as wide as the URI.

- EmbeddableScrollArea now constrains its content to the viewport whenever
  it is embedded, so every sidebar tab gets the rule rather than opting in.
- The compact headers of ProtocolEntry, NetworkEntry and TaskCard, and the
  Logs meta row, wrap their controls (or a long logger name) onto a line of
  their own instead of squeezing badges and buttons until their labels clip
  at the 320px minimum sidebar width. The Protocol target keeps a minimum
  scroll window, and a long subscription id scrolls in place.
- Storybook play tests at the narrowest sidebar width assert that no row,
  card, button or label overflows, for Protocol, Network, Logs, Tasks and
  Console.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The overflow helper currently skips visible controls and labels when flexbox squeezes them to zero width, allowing the targeted regression to pass.

1 open finding
What changed in this PR

Fixes monitoring-sidebar overflow by constraining embedded scroll content and making compact entry headers wrap responsively.

Changes:

  • Constrains all embedded monitoring lists to viewport width.
  • Wraps compact Protocol, Network, Task, and Log metadata safely.
  • Adds 320px Storybook layout coverage and overflow assertions.
File Description
clients/​web/​src/​test/​scrollAreaStoryAssertions.ts Adds shared horizontal-overflow assertions.
clients/​web/​src/​test/​narrowSidebarDecorator.tsx Adds a 320px sidebar test fixture.
clients/​web/​src/​components/​screens/​ConsoleScreen/​ConsoleScreen.stories.tsx Covers long console output.
clients/​web/​src/​components/​groups/​TaskListPanel/​TaskListPanel.stories.tsx Covers narrow task cards.
clients/​web/​src/​components/​groups/​TaskCard/​TaskCard.tsx Wraps task-header controls.
clients/​web/​src/​components/​groups/​ProtocolListPanel/​ProtocolListPanel.stories.tsx Covers long Protocol targets and expanded content.
clients/​web/​src/​components/​groups/​ProtocolEntry/​ProtocolEntry.tsx Wraps compact headers and scrolls long values.
clients/​web/​src/​components/​groups/​NetworkStreamPanel/​NetworkStreamPanel.stories.tsx Strengthens narrow Network coverage.
clients/​web/​src/​components/​groups/​NetworkEntry/​NetworkEntry.tsx Wraps compact Network metadata.
clients/​web/​src/​components/​groups/​LogStreamPanel/​LogStreamPanel.stories.tsx Covers long log content.
clients/​web/​src/​components/​elements/​LogEntry/​LogEntry.tsx Wraps compact logger metadata.
clients/​web/​src/​components/​elements/​EmbeddableScrollArea/​EmbeddableScrollArea.tsx Constrains embedded content globally.
clients/​web/​src/​components/​elements/​EmbeddableScrollArea/​EmbeddableScrollArea.test.tsx Tests embedded and full-size constraints.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

The overflow helper skipped any zero-width button or label, so a control
flexbox crushed to nothing passed. Skip only elements with no client rects
(not rendered, e.g. a collapsed section) and require a rendered button to
have width.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The centralized layout fix is consistent with the issue and has focused unit and browser-layout coverage across every sidebar panel.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@cliffhall

Copy link
Copy Markdown
Member Author

Copilot review closed: the round-2 review was clean (0 inline comments, nothing suppressed, approval recommended).

  • Round 1: one finding. expectNoHorizontalOverflow skipped zero-width buttons and labels, so a control squeezed to nothing would have passed. Fixed in 1b9f154: only elements that aren't rendered are skipped, and a rendered button must have width. Answered in its thread.
  • Round 2: clean.

@cliffhall
cliffhall merged commit 0331b2c into v2/main Oct 12, 2026
8 checks passed
@cliffhall
cliffhall deleted the v2/fix/2675-monitor-entry-clipping branch October 12, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Monitoring sidebar: a long entry (e.g. resource URI) clips the Protocol list — entries must never clip

2 participants