Skip to content

Let a crowded tab bar wrap into more rows instead of scrolling - #151

Draft
porky11 wants to merge 4 commits into
rerun-io:mainfrom
porky11:wrapping-tab-bar
Draft

Let a crowded tab bar wrap into more rows instead of scrolling#151
porky11 wants to merge 4 commits into
rerun-io:mainfrom
porky11:wrapping-tab-bar

Conversation

@porky11

@porky11 porky11 commented Jul 31, 2026

Copy link
Copy Markdown

A tab bar in a side panel is narrow, and everything stays on one scrolling row — eight tabs in a 220 px panel means four live behind a . Towards #2, but by wrapping rather than a dropdown.

One opt-in hook:

fn max_tab_bar_rows(&self) -> usize { 1 }

The default is today's behaviour exactly, so nothing here is breaking. Above 1, a crowded bar wraps; if it needs more rows than allowed, it falls back to the single scrolling row rather than growing without end.

@porky11

porky11 commented Jul 31, 2026

Copy link
Copy Markdown
Author

My application before the update:

plainsong_old

After the update:

plainsong_new

@porky11
porky11 marked this pull request as ready for review July 31, 2026 12:20

@emilk emilk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this feature! But you should add some way to test it (manually), e.g. with a toggle in the advanced example.

Comment thread src/container/tabs.rs Outdated
Comment on lines +363 to +366
}

if output.rows == 0 {
self.scrolling_tab_bar_ui(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels like a more safe pattern, no?

Suggested change
}
if output.rows == 0 {
self.scrolling_tab_bar_ui(
} else {
self.scrolling_tab_bar_ui(

@porky11
porky11 marked this pull request as draft July 31, 2026 20:51
@porky11

porky11 commented Aug 1, 2026

Copy link
Copy Markdown
Author

After adding it to the example, I encountered a weird bug where a red outline appears around the tab bar that appears for a single frame when you set the row count from a value above 1 back to 1 if only if one row is visible anyway.
I have to investigate it. Not sure when I get to it. Might be duplicate ID.

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.

2 participants