Repository navigation
Sheet: no Defaults layer in core (#497 stage 3) - #500
Merged
Merged
Conversation
Stage 3 removes the Defaults layer, after which core's own Style::default() would have no widget look while the generated sheets live in the preset's crate. The sheets whose parts are core's (eggshell_ui::owned: button, input, input group, select, dropdown menu, tooltip, checkbox, radio group, switch, field, table, slider, progress, tabs) move to src/sheets, and Style::write_look writes them; the extensions' sheets stay in eggshell-ui-shadcn, which cannot be named from core. - xtask shadcn-import writes two roots by each widget's Home: core's sheets name core as `crate::`, the extensions' as `eggshell_ui::`; each root has its own generated index. The moved files differ from their old copies only in their `use` lines, and --check passes. - The preset's own rules for core's parts move with them, in their order around the sheets: the dark choice-card label and the table's group band before, eggshell's sm/xs field sizes after (owned::write_dark_card_label, write_group_band, write_field_sizes). - Shadcn::style() passes write_look only the extensions' sheets. No behaviour change: every section, extras extension, egui style and part's resolved classes are identical before and after (Vega/Lyra x light/dark, style() and layout_style()), and no golden moved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76
Stage 3 of the shadcn-only epic: core's widgets draw from the sheet alone, the generated sheets and the recorded exceptions at one base layer. Nothing core writes is under it any more. Audit first: every part's classes, resolved with and without its Defaults-layer rules for every key set its rules name (Vega/Lyra x light/dark, style() and layout_style()), differed only for three of eggshell's own table bands. Those move into write_table_exceptions: - the header: transparent, ruled below in `border` at 1 pt; - a group row: ruled below in `border` at 1 pt; - a group cell: flex, items-center, 8 pt padding, nowrap. Deleted: - src/legacy_defaults.rs and the XDefaults writers it fed (button, menu, select, input, tabs, choice, table, tooltip), with their structs and TableDefaults::from_egui; - the defaults-layer section writers (write_text_roles, the input, tabs, menu, table, field, checkbox, radio, switch and select rules) and the helpers only they used; - core's part_over(.., Defaults(..)) in slider, progress and stepper, which the generated sheets replace: they are plain parts; - Style::write_look: Style::new writes the whole core look; Shadcn::style() adds the extensions' sheets and exceptions; - Sheet::defaults() (Sheet::new(), at the base layer) and Sheet::as_preset (renamed as_base); - TableStyle's rule, rule_width, stripe, first_column_inset and rule_below_last: the exceptions read `border` and `muted/30`, and an app insets the first column or rules the last row with App rules on TablePart::first_column()/last_row(). Renamed: Layer::Preset is Layer::Base. Kept for the extensions only, marked `#497 stage 4: delete`: Layer::Defaults, sheet::Defaults and Builder::part_over. A unit test pins that core writes no rule at Layer::Defaults. The style-less fallback now carries the generated sheets, whose medium text asked for faces egui does not have: its faces draw every weight in egui's regular face, so it still installs no font and reports nothing. Behaviour: under the preset nothing changes. All 6,404 (config, part, key set) entries common to the dumps resolve to identical values; the 660 that go are key sets only the deleted rules named. No golden moved. Without a preset, Style::default() now draws the generated shadcn look (the core part of it) instead of the egui-derived one. Tests deleted (they pinned the no-preset look's token mechanisms): owned::without_the_preset_a_button_reads_focus_and_disabled_from_the_tokens, owned_choice::the_tokens_ring_is_the_mechanisms_on_a_switch_and_a_cell, field_box::a_field_box_without_a_ring_of_its_own_rings_in_the_tokens_focus, sheet::a_select_trigger_reads_the_disabled_token, sheet::a_presets_generated_looks_resolve_from_the_preset_layer_and_sections_from_the_defaults, segmented_classes::they_fade_as_the_style_fades_disabled_controls, contract_gaps::the_colors_form_still_draws_the_styles_disabled_colours, owned_number::a_modified_style_changes_the_new_widgets_with_no_code_change. Breaking: the deleted items above; Layer::Preset, Sheet::defaults and as_preset renamed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76
A section field that only the recorded exceptions read did nothing when an app changed it after Style::new. Each such field leaves its section: its exception computes the value from the tokens inside the rule body, from the same formula Style::new used, so density and style changes still reach it. An app changes these with App rules on the part. Moved into the exceptions, read from the tokens: - CheckboxMetrics size, radius, glyph; RadioMetrics size, dot; SwitchMetrics track, thumb_off, thumb_on (choices_sheet; the switch's thumb scale reads the same track); - the whole SegmentedStyle and SegmentedMetrics (tabs_sheet: the track fill is `input`, the sizes eggshell's default, sm and xs); - InputMetrics icon_size, icon_gap; - StepperMetrics padding_x, StepperStyle divider; the chevrons take `foreground`; - SliderStyle track, range, thumb (their disabled blends) and the slider's and progress bar's track fill (`input`). Deleted, read nowhere once the Defaults layer went: StepperStyle group and transition, StepperMetrics height, SliderStyle transition, ProgressStyle height and track. Left for stage 5, each marked `#497 stage 5`: fields read only by the extensions (the menu's six metrics, the select's sizes and chevron, the input's icon colour, the label) and the toggle's unread size text, whose type the select shares. No behaviour change: all 6,404 resolved (config, part, key set) entries are identical before and after, as are the extras' styles and the egui style; no golden moved. Tests: the ones that read a moved field as their expectation read the tokens, or the resolved part, instead (contract, contract_gaps, control_size, field_box, form, owned, owned_choice, owned_number, progress, segmented_classes, eggshell-ui-shadcn styles). Breaking: the deleted fields and types above. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76
This was referenced Nov 24, 2026
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.
Stage 3 of #497: no Defaults layer in core. It's stacked on #499, which is stacked on #498. Against #499 it deletes 2,561 lines and adds 868.
What changes
src/sheets). This is its own commit, and the importer's--checkpasses.Style::newwrites the whole Vega look, soStyle::default()really is Vega.write_table_exceptions.legacy_defaults.rs, the 8 XDefaults writers and every Defaults-layer section writer;part_over(.., Defaults(..))sites, which were dead under the generated sheets;Style::write_look.Layer::Preset→Layer::Base,Sheet::defaults()→Sheet::new(), andas_preset→as_base.TablePart::last_row()andstriped_row().Layer::Defaults,sheet::Defaultsandpart_over. They're marked for stage 5. A unit test asserts that core writes nothing at the Defaults layer.Checks
cargo xtask integrate: green.Tests
Prose
TODO(prose)placeholders onSheet::new,as_base,Layer::Base/Defaults,TablePart::last_row/striped_rowandpart_over, plus the table and tabs exception docs.🤖 Generated with Claude Code
https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76