Skip to content

One crate: eggshell-ui holds the widgets and the preset (#497 stage 4) - #501

Merged
samitbasu merged 2 commits into
shadcn-defaults-497from
one-crate-497
Nov 25, 2026
Merged

samitbasu merged 2 commits into
shadcn-defaults-497from
one-crate-497

Conversation

@samitbasu

Copy link
Copy Markdown
Owner

Stage 4 of #497: one crate. eggshell-ui-extras and eggshell-ui-shadcn merge into eggshell-ui (decided on #366). Stacked on #500 ← #499 ← #498.

The first commit is 67 pure git mvs, so history follows the files. It doesn't build on its own; the second commit wires everything up.

Layout

  • The former extras are eggshell_ui::owned::{accordion, badge, command, dialog, disclosure, form, hover_card, markdown, notify, skeleton, spinner, tabs}. Each is a public module behind its own feature, and tabs sits beside core's TabsPart.
  • The preset is eggshell_ui::theme::{Shadcn, tokens, variant, size}. The shadcn crate's docs became the theme module docs.
  • The sheets: there's one src/sheets and one generated index. Each widget's sheet is gated on that widget's feature, and the importer writes to one root.
  • Style::new now writes every compiled-in widget's sheet, so Shadcn::style() equals Style::new(&tokens).

Features

  • On by default: clipboard, fonts, accordion, badge, dialog, disclosure, skeleton, spinner, tabs.
  • Opt-in: command (brings unicode-normalization), form, hover-card, markdown (brings pulldown-cmark), notify.
  • The tests, examples and xtask web see every feature.

Crate-boundary leftovers undone

  • Back to pub(crate): FontSet::{declared, install, inserts}, Elevation::shadow, theme::warn_low_contrast, Builder::keyed_under and report().
  • The extras feature, the importer's two roots and the re-exports are gone.
  • xtask: the features step is now clippy -p eggshell-ui --no-default-features.

Checks

  • cargo xtask integrate: green.
  • No golden moved (229 passed).
  • Harness: byte-identical across all 6,404 rule entries, every section, every widget style and the egui style. Old type paths were mapped to their new homes for the comparison.
  • Tests:
    • The shadcn crate's tests moved into tests/it.
    • Two combobox tests that pinned the no-preset look were deleted, since Style::default() now carries the combobox's sheet.
    • Building the docs at default features found two broken doc links in accordion and badge. Both are fixed.

For the user

  • Stale prose that still names the old crates:
    • README.md:54 and :144;
    • src/lib.rs:97 and :148;
    • src/contract.rs:3;
    • examples/controls_gallery.rs:15 and examples/dialog.rs:10;
    • the theme module doc ("the crate only fills the contract…", "fonts/OFL.txt").
  • Flattening into owned:: would need public renames:
    • Unset (chip, disclosure, tabs);
    • Items/ItemChain (accordion, command);
    • AccordionPart (in disclosure).

🤖 Generated with Claude Code

https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76

samitbasu and others added 2 commits November 24, 2026 14:26
Pure renames, so history follows each file; the next commit wires them
up (this one does not build on its own).

- eggshell-ui-extras/src/<widget> -> src/owned/<widget> (accordion,
  badge, command, dialog, disclosure, form, hover_card, markdown, notify,
  skeleton, spinner, tabs, styles);
- eggshell-ui-shadcn/src/preset.rs -> src/theme/preset.rs,
  drag_chip.rs -> src/owned/drag_chip.rs, the extensions' generated
  sheets -> src/sheets;
- eggshell-ui-shadcn/tests -> tests/it (contrast, registry and its
  themes.ts, styles as preset_styles, tones);
- eggshell-ui-shadcn/examples/preset_dump.rs -> examples/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76
Stage 4 of the shadcn-only epic: eggshell-ui-extras and
eggshell-ui-shadcn are modules of eggshell-ui. The previous commit moved
their files; this one wires them in.

- The extensions are public modules of `owned`, each behind its feature:
  owned::{accordion, badge, command, dialog, disclosure, form,
  hover_card, markdown, notify, skeleton, spinner, tabs}. Flattening them
  into `owned` would rename public types (Unset, Items, ItemChain clash),
  so they keep their modules for now. DragChip and drag_chip are in
  `owned`.
- The preset is theme::{Shadcn, tokens}; `variant` is beside `size` in
  `theme`, and the preset crate's documentation is the theme module's,
  unchanged but for its code paths.
- Features: default = clipboard, fonts, accordion, badge, dialog,
  disclosure, skeleton, spinner, tabs; opt-in: command, form, hover-card,
  markdown, notify. pulldown-cmark and unicode-normalization are optional
  deps of markdown and command.
- One sheets index: the importer writes every sheet to src/sheets with
  `crate::` paths, each extension's behind its own feature (Home::Feature
  replaces Home::Extension and the two output roots).
- Style::new writes the extensions' sheets and the disclosure's
  exceptions, so Shadcn::style() is Style::new(&tokens); layout_style
  gates each extension's mapping on its feature.
- Undone, as they existed only for the crate boundary: the public
  FontSet::{declared, install, inserts}, Elevation::shadow,
  theme::warn_low_contrast, Builder::keyed_under and report() are
  pub(crate) again; the preset's `extras` feature and its cfg splits.
- xtask: the clock and spacing-units sources, the `features` step
  (eggshell-ui with no default features) and preset_dump's features.
- The preset crate's README section on fonts is the root README's,
  verbatim but for the licence link's path.
- The workspace is eggshell-ui and xtask.

No behaviour change under the preset: every section, extension style,
egui style and part's resolved classes are identical to 728349d, and no
golden moved. Without a preset, Style::default() now has the opt-in
widgets' generated sheets too.

Tests: the preset crate's tests are tests/it modules (contrast, registry,
preset_styles, tones). Deleted, as they pinned the combobox's look
without a preset (#496 §1):
combobox_sheet::without_a_preset_the_box_takes_the_menus_radius_from_the_sheet,
combobox_sheet::the_presets_look_replaces_the_combobox_defaults.
theme_toggle skips preset_dump, which draws nothing.

Breaking: eggshell_ui_extras::X is eggshell_ui::owned::X,
eggshell_ui_shadcn::* is eggshell_ui::theme::* (DragChip in owned).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76
@samitbasu
samitbasu merged commit 5590de0 into shadcn-defaults-497 Nov 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant