Skip to content

fix: Keep the usage breakdown from starving its label column - #196

Open
nagasrinath wants to merge 1 commit into
egoist:mainfrom
nagasrinath:main
Open

nagasrinath wants to merge 1 commit into
egoist:mainfrom
nagasrinath:main

Conversation

@nagasrinath

Copy link
Copy Markdown

Problem

On the Usage settings page, the day and model breakdown tables render their
first column as vertical text when the window is narrow — "Aug 28" wraps to
one character per line.

The label column is flex_1().min_w_0() next to numeric cells fixed at 84px
that cannot shrink, so it is the only thing left to give and collapses below
the width of one glyph. The row also seats a fixed 240px cost-quality panel
beside a table that needs 396px of numeric columns before any label.

Before / after

Screenshot 2026-08-29 at 2 11 33 AM Screenshot 2026-08-29 at 2 11 48 AM

Solution

  • Give the label column an 88px floor and truncate(), so it elides instead
    of wrapping.
  • Stack the cost-quality panel under the table when the page is too narrow to
    seat both. The wider day table sets the threshold, so the MODEL/DAY toggle
    does not reflow the page.
  • Add settings_content_width() so the page knows the width it is painted
    into, and share the column widths as constants between the tables and the
    threshold.

Checks

  • cargo fmt --package waku -- --check
  • cargo check
  • cargo test
  • bun run protocol:check

The day and model tables lead with a flexible label column followed by
numeric cells pinned at a fixed width. The numeric cells cannot shrink, so
a narrow window left the label column as the only thing able to give, and
`min_w_0` let it collapse below one glyph — at which point the dates wrapped
one character per line and read vertically.

Give that column a floor and let it elide, and reflow the section: the
cost-quality panel now stacks under the breakdown table when the content
column is too narrow to seat both, which is what actually starved the days.
The wider day table sets the threshold for both breakdowns, so the MODEL/DAY
toggle never reflows the page around itself.

The settings shell now reports the width it paints a page into, since the
page can no longer assume it gets its maximum width.
@nagasrinath nagasrinath changed the title Keep the usage breakdown from starving its label column fix: Keep the usage breakdown from starving its label column Aug 29, 2026
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