Skip to content

A long namespace truncates in the header and leaves the search its width - #155

Merged
zlareb1 merged 7 commits into
mainfrom
fix/header-namespace-truncate
Oct 27, 2026
Merged

zlareb1 merged 7 commits into
mainfrom
fix/header-namespace-truncate

Conversation

@zlareb1

@zlareb1 zlareb1 commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in a release)

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

A long namespace name no longer squeezes the dashboard's header search: the name truncates, and a tooltip shows it whole.

Why

At desktop width the namespace picker's wrapper was md:shrink-0 md:max-w-none, so the trigger's truncate never applied. An 80-character name rendered in full and left the search field about 110 px wide, its results popover cut to the same width.

The picker is now capped at min(320px, 24vw) and shrinks first. Each side keeps a floor so neither collapses between the md and lg breakpoints, where the sidebar leaves 170 to 290 px for both: the picker 96 px, the search 72 px, and 160 px from lg (where the account name joins the right cluster). Widths with an 80-character name and the sidebar open:

Viewport Picker Search
768 96 72
1024 129 160
1280 307 227

A cut name shows whole in the dashboard's Tip on hover and keyboard focus of the trigger (shut while the picker is open), measured with useClamped as AgentBadge does. The static label shown with auth disabled does the same.

End truncation rather than middle truncation: CSS does it with no script, and the tooltip shows the whole name.

The picker's 96 px floor is a fixed min-width, so a name shorter than about four characters leaves up to 8 px before the separator (dev: an 88 px button in a 96 px slot; bench fills it). A floor that applies only when the name is cut needs calc-size() or a measured width; neither is worth 8 px.

Scope and risk

Header layout, the namespace picker trigger, and the static namespace label shown with auth disabled. The phone layout is unchanged (the wrapper keeps max-w-[60%] below md). Nothing server-side.

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: none.
  • Rollback: a revert leaves nothing behind.

Tests

  • frontend/e2e/namespace-picker.spec.ts, with an 80-character namespace at 1400, 1024 and 768 px, and a code-index namespace at 768 px: the name is truncated and still shows some of itself, the trigger is at least 96 px, the search meets its floor, and the page does not scroll sideways. Keyboard focus and hover each show the whole name in a tooltip that is not tied to the button as a description; opening the panel shuts it and sets the button's data-state="open". A second test: a name that fits gets no tooltip on focus. The long-name test fails on main.
  • frontend/src/components/NamespacePicker.static.test.tsx: with auth disabled, a cut name takes a tab stop and shows whole in a tooltip; a name that fits stays plain text.
  • E2E_PORT=<port> npx playwright test e2e/namespace-picker.spec.ts --project=desktop: 13 passed. a11y, overlap, keyboard and focus-rings specs: 179 passed.
  • npm run build and npm run budget: pass.
  • vitest over src/layout and src/components: the Header and NamespacePicker tests pass. The local run has 5 time-zone failures in ListTime, ListPager and MemoryCard that main has too on the same machine.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Claude Code. I checked the layout in a browser and measured the header at 768, 900, 1024 and 1280 px.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • The frontend builds (npm --prefix frontend run build) and its tests pass, if frontend/ changed.
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.

🤖 Generated with Claude Code

zlareb1 and others added 7 commits October 27, 2026 08:08
The namespace picker's wrapper never shrank at desktop width, so a long
name pushed the search box down to a sliver. The picker is now capped at
min(320px, 28vw), the search keeps a 240px floor, and the full name is
in the trigger's title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lareb Zafar <[email protected]>
A cut namespace shows whole in the dashboard tooltip on hover and focus, not a native title. The picker keeps a 96px floor and the search 72px (160px from lg), so neither collapses between md and lg; the e2e test checks 768, 1024 and 1400 px.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lareb Zafar <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lareb Zafar <[email protected]>
…on focus and for a name that fits

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lareb Zafar <[email protected]>
…ot read twice

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lareb Zafar <[email protected]>
…ocus only

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lareb Zafar <[email protected]>
…e test covers a code index

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lareb Zafar <[email protected]>
@zlareb1
zlareb1 merged commit 72e5b47 into main Oct 27, 2026
21 of 22 checks passed
@zlareb1
zlareb1 deleted the fix/header-namespace-truncate branch October 27, 2026 09:33
@pufit pufit mentioned this pull request Nov 2, 2026
9 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant