Skip to content

fix(ui): keep sub-navigation labels on one line - #1169

Draft
Claudius-Maginificent wants to merge 3 commits into
v1.0-devfrom
fix/tokens-subnav-label-wrap
Draft

Claudius-Maginificent wants to merge 3 commits into
v1.0-devfrom
fix/tokens-subnav-label-wrap

Conversation

@Claudius-Maginificent

Copy link
Copy Markdown
Collaborator

TL;DR

The side menus under Tokens, Tools and DashPay keep their labels on one line and keep a steady width. Before, they could shrink and break words in half ("Token/Creato/r") and stay that way even after a restart.

User story

As a user, I want the side menu labels to stay readable at any normal window size, so that I can find Search Tokens and Token Creator at a glance.

Scenario

Steps to reproduce

  1. Start the app in a small window (or let it open at its initial 800×600), then resize to 1050×700 or 1260×780.
  2. Open Tokens → Search Tokens, then My Tokens and Token Creator.

Actual behavior

  • The sub-navigation panel is about 140 px wide and labels break mid-word ("My Token/s", "Token/Creato/r").
  • The panel width differs between token screens.
  • The narrow width persists across restarts.

Expected behavior

  • Labels stay on one line.
  • The panel is as wide as its longest label (about 207 px).
  • The panel width is the same on every token screen.

Detailed discussion

  • egui 0.36 side panels take each frame's width from the previous frame's saved PanelState, which is the actual content rect (minimum 96 px). eframe persists it in app.ron.
  • Because nav_button labels could wrap, one narrow frame shrank the panel to the wrapped buttons, and it never grew back.
  • nav_button in src/ui/components/subscreen_chooser_panel.rs now uses TextWrapMode::Extend. Labels never wrap, so the content width restores the panel on the next frame, including from a persisted narrow app.ron.
  • The same component serves the Tools and DashPay choosers. The resizable DashPay chooser can no longer be dragged narrower than its longest label.
  • In extremely narrow windows labels are clipped instead of wrapped. The app sets no minimum window size.
  • The code involved is unchanged from the previous weekly, so this is not attributed to fix(tokens): make every token screen work and fit a 1050×700 window #1136.

Testing

  • New kittest tests/kittest/tokens_screen.rs::token_subnav_labels_stay_on_one_line: a 300 px episode followed by 1050×700 and 1260×780, visiting Search Tokens, My Tokens and Token Creator.
    • It asserts that each nav button is a single line tall and that the panel width is stable.
    • It failed with the old component ("My Tokens" wrapped) and passes with the fix.
  • cargo test --test kittest --all-features token: 17 passed. Tools, DashPay and subscreen kittests pass.
  • Clippy (kittest) is clean with -D warnings.

🤖 Co-authored by Claudius the Magnificent AI Agent

🤖 Generated with Claude Code

lklimek and others added 3 commits November 10, 2026 09:29
A sub-navigation panel takes its width from the previous frame, and its
buttons wrapped their labels to fit. Once a label wrapped, for example in
a briefly narrow window, the panel stayed narrow for good and the Tokens
labels broke mid-word ("Token Creato/r") at 1050x700. The narrow width is
also persisted across restarts.

Navigation buttons no longer wrap their labels, so the panel always
returns to the width of its longest label and keeps it across the token
screens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The labels also broke mid-word at 1260x780, so the regression test now
covers both window sizes users run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comparing the button width with the bare text width let a label that
wrapped onto two short lines, such as "My Tokens", pass. The test now
fails whenever a navigation button is taller than one line of text.

The fix makes navigation buttons size to their full label, so the
resizable DashPay chooser can no longer be dragged narrower than its
widest label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@thepastaclaw

Copy link
Copy Markdown
Collaborator

🕓 Review not started yet because this PR is a draft.

  • Request normal review — click when the PR is ready for review.
  • Request priority review — click to move this review to the front of the queue.

Commit 9ac623c. Normal review starts when eligible; priority review starts as soon as a slot is available.

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.

3 participants