fix(tabbar): draw the tab index on split tabs - #556
Merged
Merged
Conversation
The multi-pane branch of the bundled format-tab-title handler returned before the show_tab_index_in_tab_bar prefix was applied, so a tab with two or more panes lost the index that single-pane tabs and the Rust fallback both draw. Charge the index against the title budget the single-pane path truncates to, and drop it when the tab is too narrow to afford it, so a narrow split tab still cannot clip into the trailing status cell.
|
@TeamMeng is attempting to deploy a commit to the Faberon Team on Vercel. A member of the Team first needs to authorize it. |
The regression test only exercised a single-digit index with
show_tab_index_in_tab_bar hard-coded on, so the shipped default (off) and a
two-digit index were never checked:
- loop four fixture shapes (one pane, four panes, two-digit index, index off)
instead of pane_count alone
- assert the index is dropped rather than clipped once the budget is exactly
leading cell + index + trailing status cell
- add a merged-pane fixture (every pane in apps/psygo) asserting
" 2:apps/psygo " at 14 columns, the shape a split tab takes when it looks
like it lost its number
- widen the sweep to 16 columns
Verified: fails on the unfixed bundled kaku.lua (" r… " in a 4-column multi-pane
budget), passes with the fix; cargo test -p config 79 passed, clippy and
nightly rustfmt clean.
Owner
|
@TeamMeng thank you for the PR. This is on main. Split tabs now keep the tab index when |
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.
What
A tab with a split (two or more panes) renders its pane list without the tab index, even when
show_tab_index_in_tab_bar = true, so the tab bar looks like the numbering skips around split tabs. Single-pane tabs and the Rust fallback (build_default_title) both draw the index.Why
format-tab-titlein the bundledkaku.luareturns from the multi-pane branch before the index prefix is applied:assets/macos/Kaku.app/Contents/Resources/kaku.lua:3221(if #own_panes > 1 and tab.tab_title == '' then) returns itsitemsearlytab_index .. ':'atassets/macos/Kaku.app/Contents/Resources/kaku.lua:3395Rendered title for a three-pane tab in
apps/psygowith tab index 2, measured through the same Lua harness the config tests use:" apps/psygo "" 2:psygo "" apps/psygo "" 2:apps/psygo "" apps/psygo "" 2:apps/psygo "How
The index is charged against the same title budget the single-pane path truncates to (
total_limit - leading - 1, minus the index width), and it is dropped rather than clipped when the tab is too narrow to afford it. The trailing status cell still survives every width budget, which is what the existing narrow-width gate checks.Tests
bundled_kaku_lua_tab_titles_fit_narrow_width_budgetsnow enablesshow_tab_index_in_tab_barin its fixture and asserts a multi-pane title keeps the index whenever the budget can afford it. It fails onmain:cargo test -p configluajit -e "assert(loadfile('assets/macos/Kaku.app/Contents/Resources/kaku.lua'))"for the top-level 200-locals limitIssue
Refs #397 - that request landed for single-pane tabs in #434; the multi-pane
branch kept returning before the index prefix was applied.