refactor(ui): measured Ribbon layout with priority-prefix overflow - #82
Open
Limdongcheng wants to merge 1 commit into
Open
refactor(ui): measured Ribbon layout with priority-prefix overflow#82Limdongcheng wants to merge 1 commit into
Limdongcheng wants to merge 1 commit into
Conversation
Split ribbon.rs into layout (width mathematics) and buttons (command widgets) modules ahead of the labelled-compact work, and make the layout engine measure instead of guess: - Group and tile widths come from real galley measurement through an injected measurer, replacing the per-character estimates that drift on CJK and long labels; the More reservation is measured the same way instead of a fixed 86 px. - The overflow fill now stops at the first group that does not fit, so the visible set is always a highest-priority prefix; previously a wide high-priority group could land in More while narrower low-priority groups stayed visible. - Every (tab, group) pair has an explicit left-to-right order, guarded by an exhaustive test over the placement tables; half the groups previously tied at u8::MAX and ordered by catalog iteration accident. - The screenshot harness gains an Op::RibbonTab scene op and captures every task tab at the in-between 900 px width, so Ribbon changes have visual coverage beyond the Analyze tab. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
u8::MAXand ordered by catalog-iteration accident (Data ▸ Export, Process ▸ Processing, Analyze ▸ Statistics, the Figure/Arrange property groups, …).Op::RibbonTaband captures every task tab at 900 px, so Ribbon changes have visual coverage beyond the Analyze tab.ribbon.rssplits intoribbon/layout.rs+ribbon/buttons.rs, and the command roster moves tocommands/roster.rs, keeping every file under the 800-line limit.No intended visual change at today's widths apart from group order becoming deliberate.
Validation
cargo pr-checkpasses (fmt, file size, dependency policy, both frontends, clippy with denied warnings, tests).PLOTX_SHOTbefore/after at 720/900/1440 px in both themes.UI display logic
CommandId+describe) and are searchable in the command palette. (No actions added;the roster extraction is code motion.)
budget); transient states disable with a
disabled_reasonthat says howto unblock.
added.)
docs/(English and zh-CN) for user-visible behavior.(No documented behavior changes in this PR.)
🤖 Generated with Claude Code