Repository navigation
fix(traffic): keep the grouped table within the default window - #110
Merged
Merged
Conversation
With requests grouped by session, the group headers widened the table
from 864px to 977px at the default window size (1100x720, sidebar
expanded), so the cost column, the last and most important one, was
partly pushed out of view. In English it was 1005px, and 896px even with
every session collapsed.
Four header cells drove it. Emptying each one on its own, with two
sessions expanded (zh): cost -83px ("$0.233 +1 轮无法计价"), model -69px
(the joined model list, capped at 192px), failure count -25px ("1 失败"),
upstream -15px. No single cell was enough.
Group headers now stay on one line and move the detail into tooltips:
- The failure count is a red dot and a number, the same red dot as a
failed request; "N turns in this session failed" is in the tooltip
and in screen-reader text.
- The session cost is one figure. When turns are missing from the total
(no price, no usage) it is written as a lower bound, "≥$0.233", and
the tooltip lists which turns are missing and why.
- In the model and upstream lists only the first entry sets the column
width; the rest uses whatever the column has left and ends in an
ellipsis, and the whole list is in the tooltip.
The cost rule lives in a pure function with tests.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fylorn
force-pushed
the
fix/traffic-grouped-width
branch
from
September 22, 2026 14:05
8cc2a9e to
49dda0e
Compare
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
With Group by session on, the group headers widened the traffic table past the default window. At 1100×720 with the sidebar expanded the table has 864px. The flat table fits exactly, but grouped with two sessions expanded it was 977px (zh) / 1005px (en), so the cost column, the one the upstream-cell comment in
RequestTable.tsxsays must never be pushed out of view, was partly off-screen. In English it overflowed even with every session collapsed (896px).What drove the width
Emptying each group-header cell on its own (zh, two sessions expanded, Chromium and system WKWebView agree to within 1px):
$0.233 +1 轮无法计价64 轮 1 失败No single cell was enough (895 / 908 / 952 / 962px); only all four together fit.
Change
Group headers stay on one line and move the detail into tooltips (the option chosen after comparing it with wrapping onto a second line):
此会话中 N 轮失败/N turns in this session failed.≥$0.233, and the tooltip lists which turns are missing and why. The rule lives in a purecostCell()with tests.claude-sonnet-5、cl…). The whole list is in the tooltip.Rebased onto #113, which removed the subscription state, so the cost cell has no subscription case.
Measurements after the change
1100×720, sidebar expanded, table has 864px. On dev at 475ed66 (#108, #113, #114). Identical in Chromium and WKWebView; every group header is one line.
English with every session expanded is still 18px too wide: the English request rows alone are 871px there (the English flat table is 851px, and indenting the expanded rows adds 20px), so no header design fits that state. It needs narrower English request rows (the latency column, e.g.
1473→53117ms, is the widest), which is a separate change.At the minimum window (820px, out of scope) the grouped table with two sessions expanded is 820px against the flat table's 808px, previously about 977px.
Test plan
pnpm typecheck,pnpm test(220 passed, including the newcostCellcases),pnpm buildshots.html?page=requests) at 1100×720 in zh and en, collapsed / one / two / all sessions expanded, in Chromium and in an offscreen system WKWebView≥$0.233amount and a model list opens the expected tooltip; the failure dot and its number are hit-tested inside the tooltip trigger and open此会话中 N 轮失败🤖 Generated with Claude Code