Repository navigation
Phase 2: every control on the Sheet, its look generated from shadcn (#446) - #483
Merged
Merged
Conversation
The consumer rebuilt egui's window frame, its popup frame and a
Cancel/default footer by hand, and eggshell's own dialog example and the
overlay fuzzer held two more copies. The `dialog` feature ends the core
overlay chain with one surface, so placement, the scrim, dismissal, focus,
motion and the Esc/Return rules stay core's:
- `DialogExt::dialog(Dialog::new(title).description(..), |d| { d.body(..);
d.footer(..) })` on a modal chain. It sets `Role::Dialog`, the name (the
title) and the accessible description, builds the style's box (picked by
`presentation()`: a centred dialog, or a sheet with its border on the
inner edge), the header, the body, the footer, and a close button (×)
absolutely placed top-right and built last, so first focus never lands on
it. `Dialog::without_close` drops it.
- `alert_dialog`: `Role::AlertDialog`, `DismissOn::EscOnly` (overriding an
earlier `dismiss_on`), no ×.
- `Footer`: `leading`, `cancel` and `default` slots, each a closure over the
core `ButtonChain` with the style's variant and action applied. They are
built leading, cancel, default on every platform (the user's decision: the
default action is always last), so Tab order follows the screen. `cancel`
is `cancel_action().dismisses()`, so a Cancel with no handler runs
`on_dismiss`.
- `PopoverExt::popover` on a floating chain: shadcn's PopoverContent box on
the menu popup's surface. It sets no role.
- `DialogStyle` (`of`/`install_for`, derived from the core style without a
preset); the shadcn preset installs placeholder shadcn values under its
`extras` feature until the render round settles them.
The dialog example and the overlay fuzzer now use the surface, deleting
their hand copies.
Behaviour changes, all in the example and its goldens (reviewed):
- the dialog and the sheet gain the ×; the sheet takes shadcn's sheet
layout (header p-4, footer at the bottom, buttons full width);
- the example's node paths move under `Body`/`Footer`
(`/Dialog/Box/Footer/Default` for Save, `Leading` for Delete);
- Cancel/Close no longer carry their own handler: Esc and a click run
`on_dismiss`, which closes the same state.
Goldens regenerated: dialog_{light,dark}, dialog_confirm_{light,dark},
dialog_role_menu_light, sheet_{light,dark}.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up
Button is the first widget whose look comes from shadcn's source. `cargo xtask shadcn-import --write` reads shadcn's button.tsx and each style's CSS at the commit in xtask/shadcn.pin and writes Button's Sheet rules for Vega and Lyra into eggshell-ui-shadcn's src/sheets/; CI fetches that commit and fails if they drift (`--check`). Button builds from `b.part(ButtonPart::Root, keys, call_site)` with its variant, size, Disabled and HasPopup as keys and only behaviour of its own; the egui look is the sheet's defaults layer. ButtonStyle goes; toggles keep their look in ToggleStyle until toggle.tsx's migration. The generated rules are one chain per rule over core Tokens, each class marked with its source by the new debug-only `Tw::from`. Visible: Button matches current shadcn (padding, hovers, a tinted destructive in Vega too, lg/icon-lg/link), disabled is opacity-50, and every button has a 1 pt transparent border; 66 goldens change, accepted on #433. Breaking: ButtonStyle/Style::button and the shadcn tokens' primary_hover, secondary_hover and destructive_look are removed. Fixes #433. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
An outer doc comment on a module resolves links in its parent, so the bare [`PRIMARY`] did not resolve and rustdoc -D warnings failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
Part of #443 (the per-widget migration). This is Select's mechanism step: the widget's parts resolve through the `Sheet`, and the rules that draw them are today's look, written from `style.select` and `style.menu`. Its look step (rules generated from shadcn's select.tsx) follows. - `SelectPart { Trigger, TriggerIcon, Content, Item, ItemIndicator }`, slots named as shadcn's select.tsx names them. - The trigger builds through `b.part(Trigger, keys, call_site)` with the variant, size and disabled keys; the chevron, the list box, the rows and their check-mark room resolve their parts too. - `Style::set_select` sets the select section and writes its rules at the sheet's current layer. `Style::from_egui` writes them at the defaults layer and the shadcn preset at the preset layer. - Other readers of `SelectStyle` (the menu trigger's chevron, the combobox, the disclosure chevron) still read the section until their own migrations. Breaking: changing `style.select` directly no longer reaches a select; call `set_select`. No visible change: the goldens don't move. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
# Conflicts: # src/tw/origin.rs
Part of #446 (step 4, tabs and segmented): the emitter side of the tabs look, asked for by the tabs migration (#475). Emits into target/ only; the look PR checks the sheets in. - `data-active:` is `Aria::Selected`, as Base UI marks the selected tab. - `Widget::facts`: states shadcn's source asks about that eggshell's widget always or never has. A state that holds is taken off the class; a class under a state that never holds is dropped. The report lists both with their reasons. - Tabs: horizontal holds and vertical never does; the list's default variant holds and `line` never does. So the list's `h-9` and the selected trigger's `shadow-sm`, written as group conditions, are kept. - `ring-[Npx]` is a ring width, and padding or a gap in pixels (`p-[3px]`, `gap-[6px]`) is its spacing units (`.p(0.75)`). - The report's "`Tw` lacks" list is gone: `Tw::text_size` landed, and nothing else was on it. No checked-in sheet changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
# Conflicts: # crates/eggshell-ui-shadcn/src/preset.rs # crates/eggshell-ui-shadcn/tests/styles.rs # src/contract.rs # src/owned/mod.rs # tests/it/children.rs # tests/it/contract.rs # tests/it/contract_gaps.rs
A rule that drew the focus ring or the disabled look baked the value in when it was written, so setting either after a preset meant rewriting every family's rules: `set_focus` and `set_disabled` held a growing list of hooks. Both now live in core `Tokens`, and the input and tabs rules read them from the tokens they are resolved with. The sheet's resolve cache already keys on the tokens, so a change re-resolves. Behaviour-preserving: no golden moves. New tests set the ring on the tokens after the preset and check it reaches a tab-focused switch and segmented cell, and a field box whose look names no ring of its own. Breaking: `Style::focus`, `Style::set_focus`, `Style::disabled` and `Style::set_disabled` are gone; read and write `style.tokens.focus` and `style.tokens.disabled`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LesfK54UWq1haPSEr9X22o
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LesfK54UWq1haPSEr9X22o
MenuPart::{Content, Item, CheckboxItem, RadioItem, ItemIndicator, Label,
Separator, Shortcut, SubTrigger, SubContent} (dropdown-menu.tsx's slots)
are declared in core. Their rules are written from MenuStyle at the
defaults and preset layers (`set_menu` for an app), keyed by an item's
variant (default or destructive, shadcn's data-variant) and
aria-disabled; the bodies call MenuStyle::box_classes / row_classes, so
the list a select opens, which still calls them, cannot drift from a
menu. Menu, submenu and context menu build through `b.part`.
Breaking: Style::menu is private; read it with `menu()`, write it with
`set_menu`. No value moves; goldens unchanged.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AJYxo4YJZUXcPJ1bHdAHKy
…446) The choice controls build through sheet parts, after Base UI's anatomy and shadcn's slots: `CheckboxPart { Root, Indicator }`, `RadioGroupPart { Root, Item, Indicator }`, `SwitchPart { Root, Thumb }`, and the row each draws beside its label as shadcn's horizontal field, `FieldPart { Field, Label }`, which form sections will grow. Their rules are written from today's style sections at the defaults layer by `from_egui` and at the preset layer by `Shadcn::style()`, through the new `set_label`, `set_checkbox`, `set_radio` and `set_switch`. Keys: the size, `aria-checked` (Base UI's `data-checked`), `aria-disabled`, and the field's `data-[orientation=horizontal]`. Behaviour-preserving: no golden moves. - The switch's thumb stays painted, as it slides: it reads its size and fill from the two `Thumb` rules, off and on, and blends between them as before. While it slides, the track's fill and border are the blend of the two `Root` rules', laid over the rule of the state it slides to. - Until the field's rules hold them, the row's gap and text role are the control's own section's, given at the call site (`TODO(#446)`). - `Paint::indicator` is gone; the rules draw the box and the circle. Breaking: editing `style.checkbox`, `radio`, `switch` or `label` directly no longer reaches the drawing; use the setters, as for the segmented section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LesfK54UWq1haPSEr9X22o
# Conflicts: # src/contract.rs
Button's defaults-layer rules read `k.focus` and `k.disabled` at resolve time, so `ButtonDefaults` loses both fields and a style without the preset follows its tokens. The shared helpers take #478's names (`classes_in`, `colors_in`). The preset sets the input and segmented rules before the generated sheets, so those win at the same layer. A new test: without the preset, a button reads focus and disabled from the tokens, through the real builder (two mutations caught). Preset tests keep their `ButtonPart` rule for a non-shadcn opacity, since the generated Button is shadcn's `opacity-50`. No golden moves (199 pass through `cargo xtask snapshots`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AJYxo4YJZUXcPJ1bHdAHKy
# Conflicts: # src/contract.rs
…e rules `label`, `checkbox`, `radio`, `switch` and `segmented` join `input`: read through getters, written through their `set_*`, which write the rules that draw them. A direct write was silently lost on the drawing; now it does not compile. Breaking: `style.label`, `.checkbox`, `.radio`, `.switch` and `.segmented` are methods; edit a clone and pass it to `set_label`, `set_checkbox`, `set_radio`, `set_switch` or `set_segmented`. No golden moves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LesfK54UWq1haPSEr9X22o
# Conflicts: # crates/eggshell-ui-shadcn/tests/styles.rs
# Conflicts: # crates/eggshell-ui-shadcn/src/preset.rs
Tailwind's `has-*` matches any descendant; ours saw only children, so a choice card could not see its checked control under the field it holds. `has` now matches at any depth and `has_child` is `has-[>…]`. A container in a subtree with `has` rules above forwards what it observed of itself and what it holds; outside one, nothing is observed, as before. The one use in the tree, the command list's `has(focus_visible)`, already saw focus within a child's subtree, so it reads as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LesfK54UWq1haPSEr9X22o
# Conflicts: # crates/eggshell-ui-shadcn/src/preset.rs # crates/eggshell-ui-shadcn/tests/styles.rs # src/contract.rs # tests/it/contract_gaps.rs # tests/it/owned.rs
TooltipPart::Content (tooltip.tsx's tooltip-content) is declared in core; its rule is written from TooltipStyle at the defaults and preset layers (`set_tooltip` for an app). The arrow, which is painted, takes its fill and the border it overlaps from the content's resolved classes, so a rule on the content restyles it too. Delay, grace, offset and the arrow stay values of TooltipStyle. Menu and tooltip rules are `replace`s: a preset's set_menu/set_tooltip supersedes the egui-derived defaults whole instead of merging over them (a property the preset leaves unset, such as the tooltip's shadow, no longer leaks from the defaults). Breaking: Style::tooltip is private; read it with `tooltip()`, write it with `set_tooltip`. No value moves; goldens unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AJYxo4YJZUXcPJ1bHdAHKy
Checkbox and switch `.card()` and `.description(..)`, radio `.cards()` and `Choice::description(..)`: a label that holds the field, the control after a title and a description, toggled by a click anywhere on it. - `FieldPart` grows `Content`, `Title` (slot `field-title`: the sheet keys a part's rules by slot, so shadcn's shared `field-label` would give the title the card's rules) and `Description`; the card rules, from the tokens, are in `write_card_rules`; the dark preset gives shadcn's `dark:` alphas. - `BoxTw::hover` with `BoxState` (box paint only, no sensing), approved as option A; `Match::with_aria`. - `Builder::part` makes the node say its ARIA and attribute keys, so a card's `has(aria(Checked))` sees its checked control. - In a card the label is drawn before the control, so the control names itself by the title. - New goldens: `choice_cards_light`, `choice_cards_dark` (example `examples/choice_cards.rs`). State: tests/it/choice_cards.rs, 5 of 6 pass. FAILING: `a_focused_control_rings_its_card_not_itself`: the control still draws its own ring; the card label's `descendants(.., |t| t.focus(|p| p.ring(0.0, ..)))` does not suppress it. Not run since the cards: the full `it` binary, the goldens other than choice_cards, the extras/shadcn crates, clippy on all targets, rustdoc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LesfK54UWq1haPSEr9X22o
TablePart::{Table, Header, Row, Group, Footer, Head, Cell, GroupCell,
FooterCell} (table.tsx's slots; the group row and its cell are
eggshell's) are declared in core. Their rules are written from
TableStyle at the defaults and preset layers (`set_table` for an app),
keyed by a body row's aria-selected, data-[stripe=odd] and
data-[position=last], and a cell's data-[column=first]. The table, its
bands and cells build through `b.part`; sense_click/sense_hover and the
column placement stay at the call site.
Not on the sheet yet: a group title's size (text_sized reads the
subtree's inherited role, which a rule cannot see), and with it the
group weight, which is set after that role at the call site because a
role carries the inherited weight.
Breaking: Style::table is private; read it with `table()`, write it
with `set_table`. No value moves; goldens unchanged.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AJYxo4YJZUXcPJ1bHdAHKy
The stepper's up/down buttons are ghost `ButtonPart`s, and the generated button sheet gives them its default size's padding (vega `px-2.5`) and a transparent 1pt border. In the stepper's fixed column those set a minimum box wider than the column at sm and xs, and at xs two buttons taller than it: the buttons overflowed the group, their chevrons were clipped by its border, and the dividers ran past it. The buttons now drop the button's padding and border at the call site, so the column alone sizes them. Behaviour change: at sm and xs the stepper's buttons and dividers stay inside the group (goldens: control_sizes light/dark). The default size is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
With shadcn's 32pt menu rows the open dropdown runs past the bottom of the 400pt window the menu goldens draw in, so menu_destructive no longer showed the Delete row it exists for, and menu_open lost the menu's end. The menu goldens' window (and the menu's motion strips') is 480pt tall, and menu_open and menu_destructive now assert, as a precondition, that the menu and the Delete row lie inside the window. Goldens: menu_open, menu_destructive, menu_list_open (light, dark): the taller window only; the list still flips above its button and scrolls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
The generated input look changed vega's `input_padding` from 12 to 10, to match shadcn's `px-2.5`. The sm field took that token and xs derived from it, so both lost 2pt of inset. The stepper's value went further: it now takes the input group's padding, 6pt at xs, where main kept its own `padding_x` at every size and left that metric unread. shadcn names only the default size; sm and xs are eggshell's own and keep their metrics (#446). - A new token, `own_input_padding_x` (vega 12, lyra 10), is the inline padding of the sm field, of the xs field (4 less) and of the sm and xs stepper's value. - The stepper's exceptions inset its value by its size's `padding_x`, and colour its chevrons in its buttons' colour, as on main, where shadcn's addon is muted. - The stepper's buttons have no border of their own (1821acb), so a ghost button paints nothing at rest. The stepper tests check its corners on hover, and `try_box_at` joins the test support. Behaviour changes: - sm and xs fields' text and icons sit 2pt further in (12 and 8, as on main). The default size is unchanged. - sm and xs steppers' values sit at main's inset (13pt). - The stepper's chevrons draw in its buttons' text colour at every size, the default too, where they were muted-foreground. Goldens: control_sizes, controls_gallery_values, controls_gallery_lyra_values, controls_gallery_select_open, controls_gallery_stepper_focused, field_icons, field_icons_focused (light, dark), signup_form_empty, signup_form_rejected. Outside control_sizes and field_icons, only the chevrons moved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
… menu goldens (#446)
…#446) shadcn's dropdown content is `max-h-(--radix-…-available-height) overflow-y-auto` (dropdown-menu.tsx:47), which the importer leaves unmapped. The pipeline clamped the overlay to its room, but the menu's box kept its natural height and drew past the window. The pipeline now keeps, with each open overlay, what its last layout found of its room (`Fit`: measuring, fits, or short of its natural size). An overlay built with `children_fitted` is told that fit. Until it has been laid out once, it is only measured: drawn hidden and inert, as egui's sizing pass is, with a repaint asked for, so it first shows already fitted. `fitted_box` builds the rows in the overlay's box. When the box is cut short, the rows go in a scroll container as tall as they want, which the box shrinks to its room, so the gutter is paid only when it scrolls. The dropdown, its submenus, the context menu and the select's list use it. The select's row-sum estimate and `room_for`/`Room` are gone: the measured size replaces them. `fit_height` and the new helper share `block_insets`. Behaviour changes: - A menu or submenu taller than its room scrolls inside the window. - A menu's and a select list's first frame is measured, not shown; they show a frame later. No golden moved, the select's included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
A measured overlay is hidden for its first frame, so focus entry and the select's first highlight, which ran on that frame, found nothing to focus or scroll to. A measuring overlay is now `Seen::Hidden`, as a detached one is, so focus enters on the frame it is drawn. The select sets its initial highlight, and scrolls to it, only once the list is drawn in its container. The menu tests' window is 640pt tall (was 400), and the menu example's 480 (was 400), so that their menus have the room they want: in the shorter windows the menus now scrolled, and their items' paths moved under the scroll container. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
Owner
Author
|
Trial fixes pushed (725d692) after the user's trial:
|
…ame (#446) Menus are exclusive: an overlay opening dismisses a swallowing one below it, and only in the frame it opens (`Opening::Opened`). d7180d0 made a measured overlay `Seen::Hidden`, and hidden overlays don't count as opening, so a dropdown that opened while a context menu was hidden by a smaller window left both open (the overlays fuzz test found it). `Seen::Measured` is the measured first frame. It counts as opening for exclusivity, takes no press and no Esc, and focus enters only once the overlay is drawn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
Owner
Author
|
A too-tall menu now fits the window (e0f66f0):
|
…rns too (#446) The sheets have shadcn's invalid rules: the input's `aria-invalid:` border and ring, the input group's `has-[[data-slot][aria-invalid=true]]`, the Field's `data-[invalid=true]:text-destructive`, and the select's and choices' `aria-invalid:` rules. Nothing set invalid, so none of them ever drew. `.invalid(error: Option<impl Into<String>>)`, on the text field, stepper, select, checkbox, radio group, switch and combobox, mirrors `.refused`: invalid while `Some`; `None` clears it; the last call wins. - The control's parts take `Aria::Invalid`, which marks the node, so an input group's `has` rule turns the group's border and ring destructive because its child is invalid. That covers the stepper's group, the combobox's box and a field with icons. - A choice's Field takes `data-invalid`, and its label turns destructive. - A plain field's egui frame and its ring at rest take the invalid look (`map_input_as`, `text_field_classes`). - Assistive technology hears invalid, described by the error before any other description (a refusal's reason, a tooltip). - A disabled or refused control keeps its disabled look, since it isn't editable, and is still reported invalid. Tests (tests/it/invalid.rs): each control's border, valid against invalid; the plain field's ring in both themes (vega's `/50` and `/40` in dark); the group turning because of its child; choice labels; disabled and refused; accesskit. Five mutations fail them: no group key, no egui frame state, invalid while disabled, no Field key, no description. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
…e of them (#446) The rejected signup form showed its errors as text under plain grey boxes. Each control now takes `.invalid(state.visible_error(part))`: - `common::text_box` takes the error. Its box has the input group's `has-[[aria-invalid=true]]:border-destructive` and ring, so it turns because its child field is invalid. - The stepper's group turns through the generated input-group rule, and the checkbox through its own. - Each label, control and error line is shadcn's `Field`, `data-invalid` while its field shows an error, so its label turns destructive. So does the typed text, as in shadcn, where the input inherits the Field's colour (preflight's `color: inherit`). Tests (hello::signup), on the golden's rejected state: each box's border is destructive exactly where its field shows an error, and so is each label. Without the field's `.invalid`, the boxes stay grey and the test fails. Goldens: signup_form_rejected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
…signup form uses it (#446)
The inventory of the generated sheets' child-influenced rules (`has-`, `*:`, `**:`, `[&>…]`, `[&_…]`) is in PHASE2-AUDIT.md. Five that eggshell can produce had no golden showing them in effect. Each now has one, light and dark, with an assertion that the rule drew: - accordion_open: the trigger icon's `text-muted-foreground size-4 ml-auto` (`**:data-[slot=accordion-trigger-icon]`); - menu_destructive_icon: a destructive item's icon in destructive (`data-[variant=destructive]:*:[svg]`); - badge_icon: a leading icon's `pl-1.5` and `size-3`; - choice_card_focused: the card's ring while its control has keyboard focus (`has-[>[data-slot=field]]:has-[:focus-visible]`), on the card, not the control; - invalid_controls: every control `.invalid`, and the input group's and combobox's `has-[[aria-invalid=true]]` turning the box because its field is invalid. `themed_harness` is the setup the themed goldens share. `glyph_color` joins the test support, used by control_size too. No existing golden moved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
Owner
Author
|
User trial (2026-11-22): the xs widgets look fine after the sm/xs fixes (725d692). |
Nothing set `aria-expanded`, so the sheets' rules keyed on it never drew. `expanded_key` gives it, at the sites that already tell accesskit `set_expanded`: - the dropdown trigger (`ButtonChain::expanded`) takes the button's `aria-expanded:bg-muted text-foreground` (outline, ghost) or `bg-secondary` (default, secondary) while its menu is open; - a submenu item takes `data-open:bg-accent text-accent-foreground` while its submenu is open, whatever the pointer is on; - the select trigger and the combobox's field are marked expanded. Their own sheets have no rules keyed on it, so they look the same, but a container's `has-aria-expanded` sees them. The accordion trigger and the disclosure button announce `expanded` too. The accordion's only open-state rule (`data-open:animate-accordion-down`) is unmapped, so they have nothing keyed on it to draw. Tests (tests/it/expanded.rs): the open dropdown's trigger is `bg-muted`; a container's `has-aria-expanded` turns for an open dropdown, select or combobox in it and not for the others; an open submenu's item has the accent while the pointer is in the submenu. Mutations fail them: no key, and a combobox field left unmarked. Goldens: menu_open (the trigger, and Arrange while its submenu is open), menu_destructive and icons_menu (the trigger), light and dark. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
…446) input.tsx's `placeholder:text-muted-foreground` was unmapped, and the preset left `InputStyle::hint` at `None`, so egui greyed out the field's text colour for the hint. Inside a `data-invalid` Field, whose text is destructive, the hint drew pink. The preset's hint is now the muted-foreground token, as the user chose. The test support's `text_color` now reads a section's own colour, as egui's hint text carries it. Ordinary text keeps the placeholder there, so what other tests read is unchanged. Test: a hint is muted-foreground in a plain field, and in an invalid one inside a `data-invalid` Field, in both themes. With the hint left at `None`, it fails. Behaviour change: every hint draws in muted-foreground. Goldens (each hint's text only): chat_shell, chat_shell_lyra, combobox_open, controls_gallery (dark, default, lyra_cells, lyra_cells_dark, narrow, wide), field_icons, field_icons_focused, form, form_lyra, form_lyra_dark, invalid_controls, palette_open, signup_form_empty, signup_form_rejected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
148d4ac read a section's colour, the layout's input. A field in a faded group paints its glyphs faded, so a refused field's text read as unfaded and refused::a_refused_field_takes_the_disabled_look failed. text_color now reads the glyphs' own vertex colour, after the shape's fade, then the override and the fallback, as epaint's tessellator does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
This was referenced Nov 23, 2026
15 tasks done
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.
Phase 2 of #446: every control on the checklist now resolves its look through the
Sheet, and that look is generated from shadcn's pinned source (shadcn-import, ref f50887a). It's one PR, as asked; the work was integrated item by item onphase2-sheet(merges are first-parent, sogit log --first-parentreads as the item list).The user delegated Phase 2's decisions to the coordinator (2026-11-21). Every decision is recorded on #446 with its reason. Merging needs the user's approval, and this UI change needs the user's trial first: web builds of the demos at the PR's head are up, and the links have been sent to the user.
For the user's review first
These change or interpret a pick the user made:
Command palette dialog, look 11: now
rounded-xl(14), notrounded-lg. The pick was "rounded-lg [shadcn Dialog]", quoted from memory, and the current dialog source isrounded-xl; our dialogs use that since step 6. Say ifrounded-lgshould stand.Progress bar, Determinate progress: b.progress(key, fraction) #124: now 6 pt (
h-1.5), from currentcn-progress, on theinput-token track, notprimary/20 h-2. Determinate progress: b.progress(key, fraction) #124 named "shadcn's Progress" (new-york-v4). The track follows Slider and segmented tracks vanish on bg-muted panels #132, as the slider and segmented tracks do."Deletes its style struct" is not met, except for
ButtonStyle. The structs now hold the no-preset Defaults look plus metrics and behaviour. Deleting their look fields, and the preset's redundant writes to them, is Style structs: move the no-preset looks into Defaults-layer sheets, and delete the look fields #482 (scoped there, about a day or more).The splitter is off the sheet: its look (Resizable split panes #53's C2) is painted, and moving it to nodes touches the approved drag feel, so it needs a trial (Splitter: draw the handle as nodes, so the sheet can style it #480).
Restored after the generated sheet had cut them, and caught by checking the earlier decisions:
inputtoken (Slider and segmented tracks vanish on bg-muted panels #132).The chat_shell goldens are pixel-identical to main's apart from the select trigger.
Recorded exceptions to "exactly shadcn"
Each is written in one place (
Style::write_exceptions, or the extras'write_exceptions) at the Preset layer, after the generated sheets, so App rules can still restyle it.inputtoken (segmented/tabs, slider, progress):bg-mutedvanishes on muted panels (Slider and segmented tracks vanish on bg-muted panels #132).Fieldisw-full).flex-1.rule_below_last;bg-mutedunder hover;mt-px.Since the PR opened: the user's trial, and child-influenced styling
xs/sm controls (the user's trial):
own_input_padding_xtoken), since the generatedpx-2.5had been inherited by the derived sizes;The user has signed off on xs.
A too-tall menu fits the window: dropdowns, submenus, context menus and the select list scroll inside the viewport when short of room (shadcn's
max-hwith available height)..invalid(Option<impl Into<String>>)on the text field, stepper, select, checkbox, radio group, switch and combobox, mirroring.refused:Aria::Invalid, its Field takesdata-invalid, and accesskit reports it invalid, with the error as the description;has-[[aria-invalid=true]]), labels turn destructive, and a test asserts this happens exactly where an error shows.aria-expandedis wired: an open dropdown's trigger keepsbg-muted/bg-secondary, and an open submenu's item keepsbg-accent.Hints are muted-foreground, as shadcn's
placeholder:(the user's pick), including inside an invalid field.Child-influenced rules audited: about 120
has-/group-/descendant rules in the generated sheets, each mapped to a golden that shows it in effect. Five new scenes (light and dark), each asserting its rule drew:The rules no eggshell element can trigger are listed, and a table row's
has-aria-expandedis structural (Table: a row's has- rules see its cells (a row tints while its menu is open) #484).What's new
Generated looks:
Each part enum is public, named by its Base UI anatomy, with shadcn's
data-slot.Core API:
Builder::part_over(part, keys, Defaults(tw), call_site): a widget's own look under every sheet layer, shown as Defaults in the inspector. Extras use it, and core never names extras.Style::at_current_layer(|s| ..): section setters that restyle over a preset. Plain setters write at Defaults.ListChain::row_part: a virtual row's item takes a part's classes, with its keys.vlist::RowKind {Option, Heading}: heading rows aren't options, and keys, pointer and activation skip them.highlighted: one draw-time state for a list's current item (select, combobox, command, menu).Tw::leading_*: Tailwind's unitless leading.Tracking::em.focusable_nonepatches are deleted.scrollbar-nonenow applies.Importer:
bases,copiesandinherited;Home::Extension(generated extras sheets behindextras);classNamesobjects;* { border-border }.xtask:
cargo xtask integrate: CI's own steps minus wasm and fuzz, held equal by a test;featuresCI step: clippy on the shadcn and extras crates with--no-default-features;Extras: the dialog surface, footer, sheet and popover (part of #21, #372) #411 is folded in:
DialogStyleis an extension, and the dialog surfaces are generated.Breaking changes
ButtonStyle/Style::buttonare removed, as are the shadcn tokens'primary_hover,secondary_hoveranddestructive_look(Preset: Button matches current shadcn (generated by shadcn-import) #433).Style::menu,table,tooltip,label,checkbox,radio,switchandsegmented(menu()/set_menu(..)). Editingstyle.selectand the like directly no longer reaches the drawing.Style::focus/set_focus/disabled/set_disabledare gone; usestyle.tokens.focusandstyle.tokens.disabled(Focus and disabled are tokens the rules read as they resolve (#446) #478).TablePart::Table→Root;FieldPart::Field→Root;DialogKey.MenuStyle::dot, because radio items show a check, as in shadcn's dropdown-menu.write_*_exceptions→Style::write_exceptions.Goldens
98 changed and 16 added (
git diff --name-status origin/main phase2-sheet -- '*.png'). Before/after for all 114 is on a page sent to the user, grouped by family, with the integrations that moved each one.text-xslabels,ring-1box, marks on the rightrounded-xl,p-6; alert 512; sheetw-3/4inputtrackp-2cells,text-smVerification
2f61843: in its own worktree, from a cold target,cargo xtask cigave exit 0,cargo xtask snapshots(check) gave exit 0, and the release wasm build passed. The log builds only that tree, andgit statuswas clean.cargo xtask integrateon its own tree.Follow-ups
has-rules see its cells.Already backlogged: #468 (the sheet macro), #469 (the retarget spike).
Fixes #433
Part of #446: the epic stays open for #482.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up