Repository navigation
feat: Ribbon, an Office-style command ribbon - #499
Merged
Merged
Conversation
… small controls) A Ribbon widget: tabs of groups of controls - large buttons (icon above the text), small ones (icon beside it), toggles, split buttons, drop-downs and a small gallery - that scales down by group priority as the width shrinks (full -> compact -> icon-only -> one pop-up button), collapses to its tab strip (Ctrl+F1, a chevron, a peeking body), has keytips (Alt), tooltips carrying the shortcut and a description, keyboard navigation (a WAI-ARIA tablist and toolbar), and a toolbar/tablist accessibility tree with rectangles for WalkA11y. Every control is a view on an Action (label, icon, shortcut, enabled, visible, run); NewCommandAction makes one from an mvvm.Command, so a CanExecute change greys every surface. The active tab, the collapsed state, a toggle's checked state and a drop-down's selection are mvvm.Observables. Boundaries and the focus ring reach 3:1 against the tab strip and the body in light and dark palettes (PopupBorder / ensureContrast), checked on tokens and on rendered pixels. Ribbon is in the MVVM gate; 100% per-function coverage; layout tests at many widths (the collapse order), keyboard, keytips, contrast, a11y, command binding. Windows 7 "Ribbons" guidelines and the WAI-ARIA toolbar/tabs patterns are cited in the code. Co-Authored-By: Claude Sonnet 5.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.
Adds
Ribbon, an Office-style command ribbon, andNewCommandAction.Bibliography (opened): Windows 7 "Ribbons" guidelines (learn.microsoft.com uxguide/cmd-ribbons): scaling "shows the largest valid combination that fits", up to three layouts per group, single-button groups are not folded into a pop-up, groups of 3-5 commands, large icons last to shrink, enhanced tooltips with the shortcut, keytips (Alt, tab letter, command letters, Z-prefixed tips for pop-up groups), split buttons keep the immediate command on the button, the ribbon state persists. WAI-ARIA APG toolbar (Left/Right, Home/End, role toolbar) and tabs (Left/Right wrap, Home/End, automatic activation, tablist/tab, aria-selected).
What it does
RibbonGroup.Priority: full -> compact -> icon-only -> one pop-up button; lowest priority first, rightmost among equals; a single-control group stops at icon-only.Ribbon.Levels()exposes it.Collapsed()Observable, a chevron, Ctrl+F1, a collapsed tab peeks at its body.TooltipDelayMs, driven byTick.PopupBorder,ensureContrast), tested on tokens and on rendered pixels across four palettes (one faint dark, one pale light).WalkA11y.Action;NewCommandAction(id, label, *mvvm.Command)followsCanExecute; the active tab, collapsed, a toggle's checked and a drop-down's selection aremvvm.Observables. Gate entry added.A host sizes the ribbon with
Height(), draws it, and callsDrawPopuplast (menus, a peeking body, tooltips and keytips are drawn there).Tests: 100% per function; layout at every width (monotone, collapse order, ties), keyboard, keytips, contrast, a11y, command binding. A screenshot gallery test writes PNGs when
RIBBON_GALLERY_DIRis set (refuses a git work tree).MINOR release after merge (ghrelease).
🤖 Generated with Claude Code