Repository navigation
owned: short names, one home per widget, and a prelude (#497 stage 7 follow-ups) - #506
Merged
Merged
Conversation
One home per widget: - prim/text_field.rs -> owned/text_field.rs: owned::text_field (b.text_field, Field, Select, Enter, ...); prim keeps the icon and the display primitives. - tooltip.rs -> owned/tooltip/mod.rs, and the tooltip's part file owned/tooltip.rs -> owned/tooltip/sheet.rs: owned::tooltip holds the tooltip widget and TooltipPart. Its items stay crate-private but the part; three links in its module docs to crate-private items are code spans now, as a public module's docs may not link them. Pure moves but for the module lines and the paths that name them. No behaviour change; no golden moved. Breaking: eggshell_ui::prim::text_field is eggshell_ui::owned::text_field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76
b.button, b.toggle/toggle_item, b.custom, b.checkbox(_unlabelled), b.switch(_unlabelled), b.radio_group, b.segmented, b.slider, b.select, b.dropdown_menu, b.progress, b.splitter, b.table and b.stepper move out of owned/mod.rs, each into an `impl Builder` in its widget's module, beside the chain it returns, as b.number, b.field_box and b.text_field already were. They stay inherent: an app still calls them with no import. The doc comment that sat on the one impl block (a control starts from the builder and ends in a terminating call) moves, word for word, into owned's module docs, ahead of its section on classes. Moved code only. No behaviour change; no golden moved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76
A widget's items drop the module's own name, as the user decided: button::ButtonChain is button::Chain, badge::BadgeExt is badge::Ext, button::ButtonOptions is button::Options. This commit does the names whose short form is plain (every <Widget>Chain and <Widget>Ext); the rest (Part, Style, and the names listed for the coordinator) follow once decided. Renamed: accordion, badge, button, checkbox, custom, disclosure, field_box, number, progress, segmented, select, slider, spinner, splitter, stepper, switch, table, tabs, toggle ::Chain; accordion, badge, command, dialog, disclosure, form, hover_card, markdown, notify, skeleton, spinner, tabs ::Ext; button::Options. Inside its module an item is named bare; elsewhere it is named through its module (button::Chain). A widget trait is imported `as _` where a file imported it for its methods; the prelude, next, replaces those. tests/ui/widget_needs_a_terminator.stderr: rustc now names each unused chain by its path (eggshell_ui::owned::button::Chain), as several share the name; the expectation follows, nothing else in it changed. No behaviour change; no golden moved. Breaking: the renamed items. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76
…497) `use eggshell_ui::prelude::*` brings Builder, Style, Tw and tw, and the extension trait of every compiled-in opt-in widget, unnamed (`Ext as _`, behind its feature), so b.badge(..), b.tabs(..) and the rest resolve without naming a trait: accordion, badge, command, dialog (and its PopoverExt), disclosure (and its SectionExt), form, hover_card, markdown, notify, skeleton, spinner, tabs. ShellExt is not in it: it is the draw closure's shell, not a widget. The examples, the tests and the doc examples that imported a widget trait for its methods use the prelude instead. No behaviour change; no golden moved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76
…ets-497 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76
The rest of the module-prefix strip, as the user decided: - Every widget part enum is <module>::Part: accordion, badge, button, checkbox, command, dialog, field, hover_card, input, menu, notify, progress, radio (RadioGroupPart), select, skeleton, slider, spinner, switch, table, tabs, tooltip; input::InputGroupPart is input::GroupPart. Enums of another component keep their names (dialog::AlertDialogPart, SheetPart, PopoverPart, command::ComboboxPart, form::CardPart). - Every opt-in widget's style is <module>::Style: badge, command, dialog, disclosure, form, hover_card, markdown, notify, skeleton, spinner. Inside those modules the core style is crate::Style. - dialog::DialogKey -> dialog::Node, dialog::DialogContent -> dialog::Content, radio::RadioGroupChain -> radio::Chain, toggle::ToggleItemChain -> toggle::ItemChain, menu::DropdownChain -> menu::Chain, segmented::SegmentedRows -> segmented::Rows, splitter::SplitterStart -> splitter::Start, form::FormSectionChain -> form::SectionChain, hover_card::HoverCardTrigger -> hover_card::Trigger, command::CommandList -> command::List, drag_chip::DragChip -> drag_chip::Chip, toggle_group::ToggleGroup -> toggle_group::Group. Where a module now names its part enum Part, its private node-key enum, which was also called Part, is Node (checkbox, command, menu, radio, select, slider, switch, table, tabs). The sheet trait is crate::sheet::Part in those modules. The importer names a part enum as its module does (the component's enum with the module's name stripped, or the widget's `parts`) and the regenerated sheets import the module: `use dialog::AlertDialogPart::*`, `use radio::Part::*`. tests/ui/widget_needs_a_terminator.stderr follows rustc's path for radio::Chain. No behaviour change: the harness dump is identical but for the names; no golden moved. Breaking: the renamed items. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76
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.
These are the stage 7 follow-ups of #497, with the user's naming decisions. Stage 7 itself merged as #505; these commits came after it and weren't included.
Moves
owned::text_field. The tooltip widget moves toowned::tooltip, together with its part.b.<widget>()method now lives in its widget's module. They're still inherentBuildermethods, so apps need no import.Short names (decided on #497)
<W>Chain→Chain,<W>Ext→Ext,ButtonOptions→Options, and every widget's part enum and style become<mod>::Partand<mod>::Style.crate::Styleandsheet::Part.dialog::AlertDialogPart/SheetPart/PopoverPart,command::ComboboxPartandform::CardPart.input::GroupPart,dialog::Node,dialog::Content,radio::Chain,toggle::ItemChain,menu::Chain,segmented::Rows,splitter::Start,form::SectionChain,hover_card::Trigger,command::List,drag_chip::Chipandtoggle_group::Group.Part. It's renamedNodethere to avoid the clash: checkbox, command, menu, radio, select, slider, switch, table and tabs.uselines.Prelude
use eggshell_ui::prelude::*;brings inBuilder,Style,Tw,twand every compiled-in widget trait, imported anonymously (as _) and gated by feature. The examples, tests and doc examples use it.Checks
cargo xtask integrate: green.tests/uistderr changes only in the type names rustc prints.Prose for the user
prim's module doc still says it holds the text field.shadcn-import --helpline about comparing against the preset is stale.🤖 Generated with Claude Code
https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76