Files
jyviko b34a0ad748 UI kit: the shared crate solidcraft-ui-kit (closes #14251) (#14492)
* Theme files: the built-in themes are host data

theme_files reads the built-in themes from a table the host installs
(install_builtin, once per process, like the icon set and the tab table)
instead of including ui-egui's generated table. SolidCraft keeps
generating its table from assets/styles/ui/themes and installs it with
theme::install_builtin_themes() in SolveApp::new, test_support::host_data
and both apps' start. builtin() is empty until then.

Tests that iterate the shipped themes now install the host data first,
so none of them passes on an empty list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M2MmcDrkcWhQeHS2K8

* Kit tests: the ones that need SolidCraft's data are SolidCraft's

Before the kit moves into a crate of its own, its tests split by what
they need:

- Tests that read SolidCraft's shipped themes, tab table, icon set,
  fonts, view styles, expressions or panel runtime move to ui-egui:
  kit_host_tests.rs (actions, checks, fields, layout, navigation,
  panel), theme_files_tests.rs (26 theme-file tests, with the 1-bit
  checks and the original built-in ids), kit_gallery_tests.rs (the
  visual-style dropdown, now an app specimen) and
  navigation_bar_tests.rs (SolidCraft's slot catalogue), mounted from
  lib.rs. Bodies are unchanged apart from paths.
- The navigation bar component's own tests (plain data) are
  nav_bar_tests.rs beside nav_bar.rs.
- The kit gallery draws on the kit's test context (egui's default faces,
  the kit's catalog); check_elements takes the context, so SolidCraft's
  app specimens still use its fonts. The kit's dropdown_icons specimen
  shows plain options. Ribbon and history bar tests take their accent
  from the theme crate (TabAccent::for_ramp, the same value SolidCraft's
  MODEL and SKETCH tabs give).
- Settings search tests name their own page numbers (the same 2 and 3).
- SolidCraft's two-colour theme ids and the tab fixture are host test
  support (test_support::{is_two_colour, tab_fixture}); theme file
  fixtures shared by both sides are theme_files::fixtures; the raster
  helpers and the host window marker are the kit's test_support.

Items the moved tests reach are pub(crate) (theme_files' parse_color,
resolve_base, slot, ...; fields' literal and scrub helpers; layout's
selection_ink; the feature window's background path), and the gallery
coverage test exempts the parsers and accessor among them.

Path fixes: checks.rs paints through the kit's icons, blur_native names
the viewport GPU crate's Renderer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M2MmcDrkcWhQeHS2K8

* UI kit: the shared crate solidcraft-ui-kit (#14251, step 2)

The kit (crates/ui-egui/src/ui_kit/) and its components (ribbon, app bar,
history bar, navigation bar and its drawn bar nav_bar, view compass,
preferences window, start page, window chrome, frame, blur, theme files
and options) move with git mv into crates/ui-kit, a shared crate
(Class::Shared, [lints] workspace, licence, README). The kit's mod.rs is
the crate root; the components are modules beside it.

Dependencies: shared crates only (theme, ui-registry, ui-text, color,
viewport-gpu and viewport-egui for the blur backing), egui, egui-wgpu,
serde, serde_json, log, web-time, tiny-skia, arboard (desktop), muda
(macOS). `cargo xtask shared` builds and tests it on its own (288 tests).

Path fixes only, otherwise:
- In the kit, `crate::ui_kit::` is `crate::`; what was crate-visible is
  the crate's public API (pub(crate) -> pub), since SolidCraft uses it.
- ui-egui mounts the crate where the modules were (`pub use
  solidcraft_ui_kit as ui_kit`, `pub use solidcraft_ui_kit::{ribbon, ...}`),
  so SolidCraft's code and both apps keep their paths. The muda
  dependency moves with window_chrome.
- The kit's test fixtures SolidCraft's tests use (test_support, the
  gallery and its element! macro, theme_files::fixtures, the blur and
  panel fixtures) are behind a `test-support` feature, which ui-egui's
  dev-dependency turns on.
- SolidCraft's source guards (raw widgets, sliders, checkboxes,
  disclosures, colour and font literals, catalog literals, host tab
  names, command ids and message ids) read the kit crate's sources under
  the names they had in ui-egui (test_support::kit_files); a component's
  `crate::` paths are the kit's. They still fail on a SolidCraft tab name
  or message id put back into kit code.
- xtask's layer table and container exemption, docs/architecture.md,
  docs/layers.md, docs/ui-kit.md, the UI skill and the figure generator
  name the new paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M2MmcDrkcWhQeHS2K8

* UI kit: the whole-number settings field is public, as the Design page calls it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M2MmcDrkcWhQeHS2K8

* UI kit: the whole-number field and the copy cell are public, as SolidCraft calls them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M2MmcDrkcWhQeHS2K8

* UI kit: the view compass's tip text is a translated message

The compass built its hover text with a hard-coded English format string,
so it stayed English in every language. It now reads the whole sentence
from the kit's ui. vocabulary (ui.view_compass_tip, and
ui.view_compass_tip_snap with the Shift hint), with the axis as the
{axis} argument, the way the kit formats other text with arguments.

A host test hovers a tip in Japanese and expects the catalog's sentence;
on the old code it read the English text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M2MmcDrkcWhQeHS2K8

* Preferences: the colour vision sample is SolidCraft's, with a message id for Bends

The sample (fixed and projected sketch lines, axes, bends, draft and a
failed feature) and its names were in the kit, though only SolidCraft's
Interface page shows it. It moves beside the status palette sample in
prefs::figures; the kit keeps the figure painter, now public as
paint_colour_vision, and the host gallery draws the sample instead of
the kit's.

Its names read "Bends" through tr as if it were an id; it is now
ui.colour_vision_bends, with the catalogs' existing translations. A new
guard rejects a list of message ids that holds an English-label key in
the kit or the host; on the old code it reported ui_kit/preferences.rs:
["Bends"].

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M2MmcDrkcWhQeHS2K8

* UI kit: the navigation bar's layout is the kit's nav_bar_layout

measure, editor_layout and BarLayout laid out the kit's bar from kit
types and metrics but lived in ui-egui. They move to the public
nav_bar_layout module beside nav_bar and navigation_bar; the app's
wiring (canvas caps, placement in the shell's free region, slot views,
menus and commands) stays in navigation_bar_view.

The layout takes the slots the canvas shows as a predicate instead of
the app's NavCaps (which gains shows(slot) for the callers), and
reserves a menu value's width for any menu slot whose display is Icon
and value instead of naming visual_style; the catalogue's icon_menus
already keep the View menu icon-only, so the bar is unchanged. The
slot view uses the same rule. The layout tests stay in ui-egui, as
they use SolidCraft's slot catalogue; only their paths and the caps
argument change, no expected value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M2MmcDrkcWhQeHS2K8

---------

Co-authored-by: jyviko <2501648+jyviko@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 07:13:05 +00:00
..