fix(web): keep wide network-entry URLs from overflowing the column (#1623)

Long request URLs stretched every Network card to their own max-content
width, bleeding the cards (and their status badges) past the pinned
monitoring column. Mantine's ScrollArea `content` slot defaults to
`min-width: max-content`, so a non-wrapping URL forced the whole list wider
than its viewport.

Add an opt-in `constrainContentWidth` prop to EmbeddableScrollArea that
relaxes that slot to `min-width: 0`, so the list can't grow past its
viewport and each row manages its own overflow — the URL already lives in a
horizontal ScrollArea, which now actually scrolls. Scoped to the Network
stream panel (Logs/Protocol rows wrap or truncate, so they keep the default
where a long line scrolls the list).

Verified in Storybook (embedded 380px column): cards clamp to the viewport,
no list/page horizontal overflow, and the URL scrolls within its own area.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
This commit is contained in:
cliffhall 2026-07-09 20:11:43 -04:00
commit 20e4ce7b43
2 changed files with 83 additions and 1 deletions

View file

@ -57,3 +57,39 @@ export const WithEntries: Story = {
export const Empty: Story = {
args: { entries: [] },
};
const longUrlSample: FetchRequestEntry[] = [
{
id: "n-long-1",
timestamp: new Date("2026-03-17T10:00:00Z"),
method: "GET",
url: "https://example-server.modelcontextprotocol.io/.well-known/oauth-protected-resource/mcp",
requestHeaders: {},
responseStatus: 404,
duration: 84,
category: "auth",
},
{
id: "n-long-2",
timestamp: new Date("2026-03-17T10:00:05Z"),
method: "GET",
url: "https://example-server.modelcontextprotocol.io/.well-known/oauth-authorization-server",
requestHeaders: {},
responseStatus: 200,
duration: 79,
category: "auth",
},
];
// Reproduces the pinned-column overflow: a long URL must scroll horizontally
// inside its own area rather than widening the card past the column (#1623).
export const EmbeddedLongUrls: Story = {
args: { entries: longUrlSample, embedded: true },
decorators: [
(Story) => (
<div style={{ width: 380, height: 500, display: "flex" }}>
<Story />
</div>
),
],
};

View file

@ -140,7 +140,11 @@ export function NetworkStreamPanel({
{!hasResults ? (
<EmptyState>No network requests</EmptyState>
) : (
<EmbeddableScrollArea embedded={embedded} viewportRef={viewportRef}>
<EmbeddableScrollArea
embedded={embedded}
viewportRef={viewportRef}
constrainContentWidth
>
<Stack gap="md">
{filteredEntries.map((entry) => (
<NetworkEntry