Repository navigation
Traffic: cap the name columns; long names are cut and shown in full on hover - #300
Merged
Merged
Conversation
…n hover A long upstream name widened the request table without limit (330px for a 44-character name; the whole table went from 864 to 1193px at the default window), pushing the cost column out of view. - Upstream, model and key cells have one cap each, in `NAME_PX` (virtual.ts): model 208px (unchanged), upstream 160px including the logo, key 160px including the app logo and the remote mark (unchanged). Overflowing names are cut with an ellipsis; local answers and "not sent" phrases still wrap. - The width estimates that pick which cells the header sizers render are capped the same way (`capped`), so a short name with badges is still measured when several over-long names are around, and columns do not jump while scrolling. - Session header rows: the model and upstream lists stay within the same caps (the first name gives up the last ellipsis's room instead of widening the column by 12px). - `Tip clip`: a lazy tooltip that opens only when its text is actually cut, with the full text wrapping anywhere. Used on the model and upstream names (replacing the native `title` on the model), the session header lists, the session panel header and waterfall, and the request drawer header. The key cell keeps its tooltip, whose first line already holds the full name. With very long names in all three columns the table is now 1035px (zh) / 1053px (en) instead of 1193 / 1190; normal data is unchanged (864px). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… hover
A very long upstream or key name widened the traffic table's row menu (both
the right-click menu and the "…" dropdown) to fit the whole name.
Menu items can now name the part of their label that is a user-given name
(`name` in `MenuItems`). Only that part is capped (192px) and cut with an
ellipsis, so the verb stays visible ("Show only upstream acme-claude-rel…");
when it is cut, hovering shows the full name (`Tip clip`). The item's text
content is still the whole label, so screen readers, typeahead and the filter
it applies use the full name. The traffic table's "Show only upstream" and
"Show only key" items use it; the session header menu has no names.
With the long-name fixture the menu is 281px (zh) / 338px (en) instead of
about 385 / 429px.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A long upstream name widened the request table without limit: a 44-character upstream name made that column 330px and the whole table 1193px at the default window (864px available), pushing the cost column out of view. The model column already had a cap (13rem) but used the native
title, and the session header rows could exceed it.Change
One cap per name column, in
NAME_PX(src/traffic/virtual.ts), applied asmax-widthon the inner block (amax-widthon thetdis ignored by table layout):claude-sonnet-4-5-20250929is 186); vendor-prefixed / dated ids (deepseek-ai/DeepSeek-V3.1-Terminus231, Bedrock inference profiles ~300) are cut.bedrock-us-east-1113,azure-openai-eastus2134) still fit.At the default window, normal content already fills the table to the pixel, so the caps are kept just above what common names need.
Sizers respect the caps. The width estimates that choose which cells the invisible header sizers render are capped the same way (
capped), so a short name with badges is still measured when several over-long names are around, and columns do not jump while scrolling.Session header rows: the model and upstream lists stay within the same caps. When the first name is itself over-long it gives up the room for the trailing ellipsis instead of widening the column by 12px.
Tip clip(src/ui/tip.tsx): a lazy tooltip that opens only when its text is actually cut (clipped(): the trigger or one of its descendants hasscrollWidth > clientWidth, measured on hover). The full text wraps anywhere, because long names often have no break points. It is used on the model and upstream names (replacing the nativetitleon the model), the session header lists, the session panel header and waterfall, and the request drawer header (title, upstream, key). The key cell keeps its existing tooltip; its first line already holds the full name.The copy and filter actions still read the row data, so they always use the full text.
Row menus (right-click and the "…" dropdown share
@/ui/row-menu): a menu item can name the part of its label that is a user-given name (nameinMenuItems). Only that part is capped (192px) and cut, so the verb stays visible ("Show only upstream acme-claude-rel…"); when it is cut, hovering shows the full name. The item's text content is still the whole label (screen readers, typeahead). "Show only upstream" and "Show only key" use it; the session header menu has no names. With the long-name fixture the menu is 281px (zh) / 338px (en) instead of about 385 / 429px.Measurements (headless Chromium, same in system WKWebView within 0.3px)
New harness fixture
?long: very long upstream, model and key names on the newest rows and on one session.Checked
cursor-probe.js, 230 keys down and up from three horizontal positions): the same result as on unmodifieddev.?livefresh-row animation, no console errors.pnpm typecheck,pnpm test(94 files, 961 tests),pnpm build.🤖 Generated with Claude Code