Skip to content

Toolbar: show or hide any tab; Sheet Metal is optional and appears in a design that uses it (#5717) - #5718

Closed
Karl-VonRichter wants to merge 4 commits into
tangency-labs:mainfrom
Karl-VonRichter:toolbar-optional-tabs-5717
Closed

Karl-VonRichter wants to merge 4 commits into
tangency-labs:mainfrom
Karl-VonRichter:toolbar-optional-tabs-5717

Conversation

@Karl-VonRichter

@Karl-VonRichter Karl-VonRichter commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #5717.

Each person chooses which toolbar tabs they see. Any tab can be hidden, down to none at all, and the tabs shown today stay on by default. Sheet Metal becomes the first optional tab: off by default, and shown by itself in a design that uses it. #5262 (Weldments) adds its tab to the same list.

What changes

  • Any tab can be hidden. Model, Surface, Assemble, Insert, Inspect, Manage and View show by default, as now. Untick one and it leaves the tab row. When the selected tab is hidden, Model is selected, or the first tab still shown.
  • Down to no tabs at all. With every tab hidden, the row keeps only the +, and the ribbon says Every toolbar tab is hidden. Click + or right-click here to show one. The Sketch tab still comes with an active sketch.
  • Optional tabs are off by default. workspace::OPTIONAL_TABS lists them with the features of their kind. Sheet Metal is the only one now, and it is no longer in a fresh document's tab row.
  • The menu. Right-click a tab or the toolbar's empty space, or click the + after the last tab.
    • Under Toolbar tabs it lists every tab, ticked when shown. Picking a row shows or hides that tab.
    • Customize Toolbar… and Reset Toolbar follow, as before. With no tab shown there is nothing to customise, so the menu leaves them out.
    • A second click on the + closes the menu. A click on it leaves no keyboard focus behind, as on the tabs, so single-key shortcuts such as S still work afterwards. (Before, the shared icon button kept focus and S did nothing until you clicked elsewhere.)
    • The Render workspace's one tab can't be hidden, so there the menu has no tab rows and there is no +.
  • Settings › Interface › Toolbar tabs offers the same choice as check boxes. Restore Defaults on the Interface page shows every standard tab again and turns the optional ones off.
  • The rows read like the tabs. The menu rows and check boxes use the tab row's own text in every language.
  • The choice is kept per person, in two preferences saved with the others:
    • hidden_toolbar_tabs: the standard tabs hidden. It lists what is hidden, not what shows, so a tab added later shows for everyone.
    • toolbar_tabs: the optional tabs turned on.
    • The control channel sets both with ui.prefs, e.g. {"hidden_toolbar_tabs": ["SURFACE"]}. Each accepts only its own kind of tab, each once.
    • Reading a saved preferences file keeps only the tabs each list can hold, each once, so a hand-edited file can't carry a huge or nonsense list (as disabled_plugins already does).
  • Hiding only changes the tab row. A hidden tab keeps its customised buttons, and its commands stay in command search and keep their shortcuts.
  • Sheet Metal appears by itself. A design with a sheet-metal feature shows the tab even when it is off. Opening a sheet-metal part, or making the first flange, brings the tab and selects it, as the contextual tab already did. Undo the last sheet-metal feature and the tab goes again.
  • Docs: docs/ribbon-layout.md, docs/control-protocol.md (ui.prefs and ui.handles, including ribbon:add_tab and ribbon:tabs_hidden), and the Sheet Metal and UI tour guides.
  • Strings are one new file, assets/locales/pending/toolbar-tabs.json, instead of edits to the catalogs (Pending files for new UI strings and attribution rows #6448):
    • The Toolbar tabs heading, its note and the empty ribbon's hint, in en, ja and zh.
    • ui.tab_assemble, ui.tab_manage, ui.tab_view and ui.tab_sheet_metal: those tabs' names exactly as the tab row draws them, in every catalog that translates them. They give the English menu rows a catalog entry; Model, Surface, Insert and Inspect already had one.
  • Icons: no new artwork, only accepted icons.
    • Each tab's menu row uses the icon of the command that leads that tab: extrude (Model › Create), surface_extrude (Surface › Create), joint (Assemble › Joints), import (Insert › Files), measure (Inspect › Measure), params (Manage › Parameters), camera (View › Views) and sheet (Sheet Metal, as before).
    • A ticked row shows the tick in the icon's place, as the menu's other choices do.
    • The + uses the plus icon, which the app already uses for adding things.

Screenshots

Taken in the desktop app (ci profile, safe mode, so no saved settings were involved), driven through the control channel. Red boxes mark the detail.

To reproduce: start with default settings, then click the + after View (or right-click any tab) and untick tabs. For the sheet-metal part, draw a rectangle on XY and run sheet.flange {}.

1. A fresh design has no Sheet Metal tab. The row ends at View, then the +.

Fresh design, no Sheet Metal tab

2. The menu lists every tab (here from a right-click on Model). The seven standard tabs are ticked; Sheet Metal is not, so it shows its icon. Customize Toolbar… and Reset Toolbar follow.

The toolbar menu lists every tab

3. Untick Model: it leaves the row and Surface, the first tab left, is selected. In the + menu, Model is unticked and shows its icon.

Model hidden; the row starts at Surface

4. Every tab hidden: only the + is left, and the ribbon says how to bring the tabs back.

Every tab hidden: the + and the hint

5. The + menu with every tab hidden: every row unticked. With no tab to customise, there is no Customize Toolbar or Reset Toolbar.

The + menu with every tab hidden

6. Settings › Interface › Toolbar tabs offers the same choice, here with View hidden and Sheet Metal off.

Toolbar tabs in Settings, Interface page

7. Pick Sheet Metal: the tab joins the row after View, and the + moves along after it.

Sheet Metal tab turned on

8–10. With Sheet Metal off, a sheet-metal feature brings it:

  • A sketch alone: no Sheet Metal tab.
  • The first flange: the tab appears and selects itself, in its contextual style.
  • Undo: the tab goes again.

Sketch only, no tab

The flange brings the Sheet Metal tab

Undo takes the tab away

Tests

  • workspace::tests::standard_tabs_show_until_hidden_and_every_tab_can_be_hidden (new):
    • hiding the selected tab from its own menu selects the next tab
    • the Settings check boxes and the Interface defaults
    • ui.prefs validation, and the choice is kept through prefs() / load_prefs
    • with every tab hidden: no tabs, the hint, no Customize Toolbar, a sketch still brings its tab
    • the + brings a tab back
    • a hidden tab's command is still found by command search
  • workspace::tests::optional_tabs_are_turned_on_by_the_person_or_shown_by_a_design_that_uses_them:
    • fresh document without Sheet Metal
    • the menu lists every tab in order, ticked except Sheet Metal, then ticked once it is on
    • the + opens the same menu, closes it on a second click, turns a tab on, and stays after the last tab
    • S opens command search right after the + (it failed before the focus fix)
    • kept through prefs() / load_prefs; ui.prefs validation
    • the Settings check box and Interface defaults
    • a sheet-metal feature brings the tab; undo takes it away
  • prefs::tests::a_value_this_version_does_not_understand_keeps_the_other_preferences: a hand-edited file's tab lists keep only known tabs, each once, including a list of 10,000 unknown names.
  • Existing tests updated:
    • the contextual-tab and fresh-Sheet-Metal tests
    • the four sheet-metal scenarios (s08, s22, s49, s51) turn the tab on first, as a user would
    • the icon audit turns every optional tab on so it still walks them

Checks run locally (Windows)

Head 4042010, rebased onto main c831468.

  • The rebases:

    • Onto 348bbc1: the only conflicts were the ui.handles and ui.prefs rows in docs/control-protocol.md. I merged them word by word, keeping both main's changes and this PR's.
    • Onto c831468: no conflict. main had moved two commits; one changed context_menu.rs.
  • The full run, on 348bbc1 with these changes (all except the last fix, the saved-list cleanup):

    • Passed:
      • cargo fmt --check
      • cargo xtask assets, lists, layers, ui-containers, i18n --check, icons and wasm
      • cargo clippy --workspace --all-targets --profile ci -- -D warnings
      • every solidcraft-ui-egui integration test binary (21), including the 130 scenarios and the icon audit
      • 2556 of the 2557 ui-egui unit tests that run (7 are marked ignored)
    • Failed, unrelated to this PR and Windows-only: documents::tests::tab_tooltip_says_where_the_design_is_saved (Design tabs: the hover tooltip repeats the tab's name; show where the file is saved #5868, on main). It expects ~/Designs/bracket.solidcraft, and Windows joins the path with \.
  • Run again after the last fix:

    • On 348bbc1: fmt, ui-egui clippy, and 349 preference, tab, menu and i18n tests.
    • On 4042010: ui-egui clippy, and 278 tab, menu, context-menu and preference tests.
  • A local patch, not committed: on Windows, crates/ui-egui/src/cli_link.rs (solidcraft-cli on PATH from the AppImage and the macOS app #6347, on main) breaks two things:

    • clippy -D warnings: slot is unused off Unix
    • the test build: its tests call std::os::unix::fs::symlink

    To run clippy and the tests, I allowed the dead code and limited those tests to Unix in the working tree only.

  • The app: all screenshots come from this branch's ci-profile build. It quit cleanly with no crash reports.

Follow-up

🤖 Generated with Claude Code

Karl-VonRichter and others added 4 commits October 26, 2026 16:50
…a design that uses it (tangency-labs#5717)

Sheet Metal becomes an optional toolbar tab, off by default. Each person
turns it on by right-clicking a tab (or the toolbar's empty space) or in
Settings > Interface > Toolbar tabs. The choice is the `toolbar_tabs`
preference, also settable with `ui.prefs`. A design with a sheet-metal
feature shows the tab whatever the setting, and it still selects itself
for an active sheet body. workspace::OPTIONAL_TABS is the list that
Weldments (tangency-labs#5262) joins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…needed (tangency-labs#5717)

- A small + sits after the last ribbon tab. It opens the toolbar's own
  menu (Toolbar tabs, Customize Toolbar…, Reset Toolbar) under it, shows
  pressed while that menu is open, and closes it on a second click.
- It follows the tabs as optional ones are turned on. The Render workspace
  has no optional tabs and no +.
- It reuses the accepted `plus` icon, as the new design tab and Pin to
  Toolbar do; the tooltip is the menu's "Toolbar tabs" heading.
- Handle `ribbon:add_tab`; docs/ribbon-layout.md, docs/control-protocol.md
  and the Sheet Metal and UI tour guides mention it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on by default (tangency-labs#5717)

The toolbar menu (the + after the tabs, or right-click a tab) and Settings > Interface >
Toolbar tabs now list every tab, not only the optional ones. Model, Surface, Assemble, Insert,
Inspect, Manage and View show until the person hides them; Sheet Metal stays off by default and
still appears in a design that uses it.

- hidden_toolbar_tabs keeps the standard tabs hidden (what is hidden, not what shows, so a tab
  added later shows for everyone); toolbar_tabs keeps the optional tabs turned on. ui.prefs
  checks both, and reading a saved file keeps only known tabs, each once.
- When the selected tab is hidden, Model is selected, or the first tab still shown. With every
  tab hidden the row keeps only the +, the ribbon says how to bring the tabs back, and the menu
  leaves out Customize Toolbar and Reset Toolbar. A sketch still brings its tab.
- The menu rows and check boxes read like the tab row in every language; each row has the
  accepted icon of the command that leads its tab.
- A click on the + no longer keeps keyboard focus, so S opens command search right after it.
- New UI strings move to assets/locales/pending/toolbar-tabs.json (tangency-labs#6448) instead of the
  catalogs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Karl-VonRichter
Karl-VonRichter force-pushed the toolbar-optional-tabs-5717 branch from 1c8438b to 4042010 Compare October 26, 2026 06:56
@Karl-VonRichter Karl-VonRichter changed the title Toolbar: choose which optional tabs show; a tab appears by itself in a design that uses it (#5717) Toolbar: show or hide any tab; Sheet Metal is optional and appears in a design that uses it (#5717) Oct 26, 2026
@bherbruck

Copy link
Copy Markdown
Collaborator

Thanks for the PR. I want the Sheet Metal tab to stay visible by default, so I'm closing this.

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.

Toolbar: choose which optional tabs show; a tab appears by itself in a design that uses it

2 participants