Navigation bar: icons for visual styles, selection modes and display (#6585) (#6898)

* Navigation bar: slot model and one-row renderer (#6585)

* Navigation bar: customisation section in Preferences (#6585)

* Navigation bar: icons for visual styles, selection modes and display (#6585)

* Navigation bar: redraw the Bodies, Parts and Components selection icons (#6585)

* Navigation bar: refine the Ground shadow, Ambient occlusion, Parts and Components icons (#6585)

* Navigation bar: solid cube and a longer arc for the Ground shadow icon (#6585)

* Navigation bar: the owner accepts the new icons as final (#6585)
This commit is contained in:
Nathan Dane
2026-10-28 04:16:44 +00:00
committed by GitHub
parent 85aaed2ccb
commit b0c8c466b0
63 changed files with 4319 additions and 358 deletions
+4
View File
@@ -390,6 +390,10 @@ completed drawings publish atomically. The browser still exports synchronously.
top/bottom heading are preserved. Diagonals include 45-degree edge and isometric corner views.
- Navigation bar overhaul (#6585): the viewport's Fit, Home, camera tools, Spin, visual style, Grid, Ground
shadow and bar visibility are registered `view.*` commands, and Fit/Home follow the active canvas.
- Navigation bar slots (#6585): stored order and appearance, command-driven controls, canvas availability and
single-row overflow.
- Navigation bar customisation (#6585): approved light/dark bar and settings geometry, live position preview,
accessible reordering and per-menu display options.
## Known limitations
+1 -1
View File
@@ -47,7 +47,7 @@ windows use the shared composition, including its header and fixed outer frame.
| Search, completions, colour and library popovers | `shortcut_box`, kit fields/choice/colour/table | Anchored popup containers; editor focus and completion semantics retained |
| Dimension values, canvas placement values, canvas feedback and History resize seam | `dim_view`, `sketch_dims`, `canvas`, `timeline_left` | Model/control-anchored overlays; retain their coordinates rather than becoming docks |
| Status and loading/progress messages | `viewport`, `open_meshing` | Notification surfaces independent of layout |
| Navigation bar | `viewport` | Shared navigation surface; shell still computes its available canvas bounds |
| Navigation bar | `navigation_bar_view` | Measured single-row Navigation surface; upward Popup menus use kit list rows; shell supplies the free canvas bounds |
| OK and Cancel in the view's corner | `view_confirm` | Navigation surface in its own area; the viewport layout reserves its corner and the shell counts it as covered |
| Home, model viewport, Render canvas and native Assistant window content | `home`, `lib`, `agent_chat/panel` | Central content hosts, not floating workspace panels |
| Loading input shield | `file_load` | Explicit input shield; must remain interactive while CAD input is blocked |
+86 -1
View File
@@ -69,7 +69,9 @@ rules. Its compass is 110 pt; the 48 pt Shots strip clears the docks by 8 pt.
padded content and optional 48 pt footer. `show_with_left` pins a left action beside
the right-aligned buttons. `show_pages` accepts declarative `WindowPage` entries
(icon, i18n label key, optional group heading, stable handle, scroll policy and draw callback).
Its 188 pt soft page list has 32 pt icon/label rows, selected tint/ink and a divider.
Its 188 pt soft page list (150 pt below a 700 pt window width) has 32 pt icon/label rows,
selected tint/ink and a divider. Page windows use the navigation board's border/radius
and the shared menu shadow; other windows retain their shared card surface.
Preferences has nine grouped pages; legacy control-channel page names remain aliases.
`page_rows` opts into a taller body while preserving viewport bounds.
`actions`, `anchor`/`placed`, `cards`, `fields` and `keep_open_on_escape` retain
@@ -154,6 +156,13 @@ table. Panel/Window/Confirm compositions also have dedicated geometry and intera
| `assistant_entry`, `AssistantEntryState` | Application-bar chat icon with quiet, ready, busy, auth, stopped and approval count marks; caller owns state and target | `app_bar`, `agent_ok/busy`, `warning/error`, `font_badge` |
| actions: `button`, `Button` | Secondary action: `Normal`, `Small`, or `Enabled(bool)` | native sizing, form font/control tokens |
| `primary_button` | Accent action outside a footer | `accent`, `on_accent`, form tokens |
| navigation: `NavigationMetrics`, `navigation_surface`, `navigation_button`, `navigation_separator` | Shared live/editor navigation painter, button states, upward menu chevron and separator; approved board dimensions below | `dialog_body/border`, `form_ink/dim/primary`, `control_border`, `selected_bg`, `nav_hover/press` |
| `ReorderPayload<T>`, `insertion_marker`, `drop_index` | Typed drag origin, insertion chrome and horizontal gap selection shared by the ribbon and navigation editor | `accent` |
| `navigation_button_editable`, `navigation_edit_outline` | The live navigation button with drag interaction, selection outline and dashed hidden-slot chrome | Navigation control tokens, `border/accent` |
| navigation_menu: `navigation_menu`, `NavigationMenuRow`, `navigation_context`, `navigation_tooltip` | Upward menus, checked rows, headings, separators and the delayed shortcut tooltip; context menus retain kit popup hosts and Container's shared elevation | `dialog_body/border/rule`, `form_ink/dim/primary`, `selected_bg`, `nav_hover/tip/tip_ink/tip_key_border` |
| navigation_settings: `navigation_stage`, `navigation_tile`, `navigation_drag_ghost` | Custom preview stage, draggable slot tiles and drag feedback. Ordinary preferences reuse `settings_section`, `settings_form`, `row`, default `segmented`, `checkbox`, `button`, `divider` and text hints | `dialog_border`, `control_border`, `form_ink/dim`, `nav_field/hover/viewport` |
| `settings_card` | Full-width settings detail group; uses Container chrome and preserves its width with empty or changing content | `dialog_footer`, `border`, `radius_md`, `space_12/10` |
| `mirrored_icon_button_at` | Directional counterpart of an existing icon master, sharing icon-button presentation and accessible label | Shared icon-button tokens |
| `icon_button_at` | Icon action inside a supplied rectangle | `form_icon_inset`, `text/dim`, icon palette |
| `button_pair`, `PairButton` | Equal secondary actions, optional icons and selected state | `form_button_height`, control/selection/icon tokens |
| `footer`, `Footer`, `Action`, `HeaderActions` | OK/Cancel with optional Apply, compute status or selected action; `HeaderActions` puts the same buttons in a header row | `form_footer/button_height`, `dialog_footer/rule`, `control_*`, `accent`, spacing |
@@ -234,6 +243,76 @@ this whole-glyph treatment from ordinary accent selection and monochrome ink mas
Radial icons follow the active tab (Sketch, Surface, Mesh, Form; other tabs use base blue)
in both normal and hovered sectors; the hovered background retains its tab tint.
## Navigation board dimensions
`Navbar_Bar` / `Navbar_Settings` and their dark boards own this composition.
`navigation_bar_view::paint_row` paints both callers; the editor supplies selection,
canvas availability and drag interactions. Its stage publishes `prefs:navbar:stage`;
`prefs:navbar:bar` exposes the positioned bar inside it. Existing `nav:*` and editor
slot/tile/add/appearance targets retain their identities.
| Board specimen | Logical points / state | Authority |
| --- | --- | --- |
| Bar 1, 6 | Regular: 32 button, 18 icon, 7 button radius, 40 outer height, 10 bar radius. Compact: 26 / 16 / 6 / 34 / 9 | `NavigationMetrics::for_size`, `height` |
| Bar 1 | Border 1, padding 3, gap 2, bottom offset 7; separator width 1 + two 4 margins, height 18 | `NAV_BORDER/PADDING/GAP/BOTTOM/SEPARATOR/SEPARATOR_HEIGHT` |
| Bar 2 | Menu padding left 7 / right 6, gap 5, chevron 12; medium text 12.5 | `NAV_MENU_LEFT/RIGHT/GAP`, `NAV_CHEVRON/TEXT` |
| Bar 3 | Hover / press and open / latched; focus outline 2 with offset 1 | `navigation_visual`, `navigation_fill`, `NAV_FOCUS_WIDTH/OFFSET`; `nav_hover`, `nav_press`, `selected_bg`, `form_primary` |
| Bar 5 | Width 244, padding 5, radius 10; shared menu shadow (0,14), blur 36; row 30, radius 6, inset 8, icon 17, gap 9; heading 22, text 11, tracking .07em | `NAV_POPUP_*`, `NAV_MENU_*`, `NAV_ROW_GAP`, `NAV_HEADING_*`, `navigation_popup_frame`, `Container::menu_frame` |
| Bar 6 | Left / Centre / Right, 12 edge inset | `Position`, `NAV_EDGE`; legacy bottom / bottom_left / bottom_right deserialize as centre / left / right |
| Bar 7 | More button follows the selected size; popup width 200; value text drops before labels and overflow | `NavigationMetrics`, `NAV_MORE_WIDTH`, `navigation_bar_view::measure` |
| Bar 8 | Idle fade 45%, hidden 0%, restored 100%; hide-mode fade in 120ms | `navigation_opacity`, `NAV_IDLE_OPACITY/FADE_SECONDS` |
| Bar 9 | Tooltip delay 800ms, gap 6, padding (8,5), radius 6; 12 medium text, 11 mono key, 15 key line height | `NAV_TOOLTIP_DELAY/POPUP_GAP`, `navigation_tooltip`; `nav_tip/tip_ink/tip_key_border` |
| Bar 10 | Render hides Look at and Visual style; flat canvases hide Orbit, Spin, Look at, Projection and Visual style, retaining Home and Display | `Slot::available`, `canvas_caps` |
| Bar 11 | Context width 232; bar has Customise / Hide / Reset, slot has Remove | `NAV_CONTEXT_WIDTH`, `navigation_bar_view::context_menu` |
| Settings 1, 8 | Stage height 58, radius 8, padding 12 inside its 1 border; position follows preference live | `NAV_STAGE_HEIGHT/RADIUS/INSET`, `editor_layout` |
| Settings 1–3 | Standard settings section and full-width detail card; actions stay on one line, with name truncation before icon-only actions | `settings_section`, `settings_card`, `inspector_header_layout` |
| Settings 4, 5 | Marker 2×24 radius 1; ghost 70%, dragged tile 55%, hidden slot 40% and dashed border | `insertion_marker_with_ink`, `NAV_MARKER_HEIGHT/GHOST_OPACITY/TILE_DRAG_OPACITY/HIDDEN_OPACITY` |
| Settings 6 | Enabled Add buttons answer with “Remove a slot to add another.” at the 16-slot cap | Pure list operations in `navigation_bar.rs`; `warning` |
| Settings 7 | Standard form label column, control height, segment typography and fills; kit dropdown fallback at narrow widths | `settings_form`, `row`, `segmented`, default `Segments` |
| Settings controls | Standard checkbox, Normal buttons, icon buttons, divider and hints. Custom tile content height 30 + two 1 borders = 32 outer; Add 22 | `checkbox`, `button`, `icon_button_at`, `divider`, `Text::Hint`, `NAV_TILE_HEIGHT/ADD` |
The custom tiles use CSS content-box sizing. Their rendered outer height is
32 points, including the two border pixels around their declared height of 30.
Editor menu slots also include a transparent one-point border, unlike live menu
buttons. Their geometry and icon padding include it while reusing the same painter.
Ordinary choice rows use the app's standard segmented control and its narrow-width dropdown fallback.
Colours shared with the boards use `dialog_body` (window/popup), `dialog_footer`
(inspector), `dialog_border`, `dialog_rule`, `control_border`, `form_ink`, `form_dim`
and `selected_bg`. Additional `nav_*` roles above, plus `nav_field`,
`nav_viewport` and `nav_dim`, have light/dark defaults in
`assets/styles/ui/palettes.rs`. They are ordinary `solidcraft-theme/1` colour keys:
import, export and palette cache identity all include them through `theme_files.rs`.
Files omitting them retain their base palette, including older exported themes.
Semantic selection/action ink reuses measured `form_primary`, and the slot-cap notice
reuses measured `warning`; neither has a navigation-specific duplicate. The colour-vision
groups measure them together against the dialog ground. Remaining navigation colours
are neutral surfaces/ink, with explicit reasons in `NO_MEANING`. Popup elevation comes
from `Container::menu_frame`, not a navigation-owned shadow: its (0,14) offset, 36 blur
and app-bar colour at 18% replace the board's (0,4), 16 blur and 10%/30% shadow.
The default is Regular/Centre; saved Compact values stay Compact. `slots` remains
a plain list of IDs; optional `slot_options: {"visual_style":{"shows":"icon_and_value"}}`
stores menu presentation independently of global button labels. Missing Visual style
options mean Icon only; Display has no current value and remains Icon only.
Board regression checks live in the existing test modules:
- `navigation_bar_tests.rs`: `navigation_board_metrics_and_state_colors_are_shared_in_both_themes`,
`navigation_board_popup_width_includes_its_border_and_padding`,
`navigation_board_position_aliases_migrate_and_editor_alignment_follows_position`,
`navigation_board_drops_menu_value_text_before_folding_slots`.
- `theme_files.rs`: `navigation_board_colours_are_themeable_and_roundtrip_on_both_bases`.
- `prefs.rs`: `navigation_bar_preview_stage_follows_position_live`; the existing narrow-width
regression also checks unelided text bounds at 1600, 880, 640, 600 and 480 points.
The existing drag regression covers removal into empty stage space as well as outside the stage.
- The existing pointer/state, shared-painter, context-menu and canvas-availability tests
follow the board's changed states, editing borders, menu split and hidden slots.
The tool-cursor regression uses its Navigation preference because Display no longer lists it.
`tool_cursor.rs::navigation_preference_restores_tool_badge_on_cancel_and_defaults` covers
the relocated setting's snapshot and page defaults.
Runtime icon discovery visits More at narrow width, retaining Preferences page coverage.
## Extending and checking the kit
Add one implementation, document its tokens/options here, re-export it through
@@ -589,6 +668,12 @@ callers continue to request semantic icon IDs and surface-specific monochrome in
See [the shipped-theme colour audit](theme-colour-audit.md) for the schema,
workspace assignments, accessibility rules and intentionally monochrome themes.
Preference page scrollers keep their content width separate from the scrollbar host's
gutter extension. Child layout overflow contributes height only, so it cannot widen
the window and leave earlier sections clipped at their previous right edge. The
Navigation editor follows the board's composition and uses standard kit controls
for ordinary settings, rather than a second control skin.
## Material previews and look chains
`sphere_thumbnail(ui, id, Sphere { color, kind, opacity }, size)` paints a lit