Conversation
…oggles visible/enabled
Replaces the backend-declared toolbar descriptor (dispatch: "toolbar", full groups/
items/labels/icons synthesized into generic Button/Checkbox/Select components) with a
small id-keyed control message (dispatch: "toolbar_control", overrides: { [id]:
{ visible?, enabled? } }). Every toolbar button stays a hand-written .vue owning its
own icon and behavior, matching every other button in this codebase; the backend can
only show/hide or enable/disable a button the frontend already defines, never create
one.
- New useToolbarControl(id) composable wired into all 14 built-in toolbar buttons.
- Deletes the generic schema-driven renderer (ToolbarRenderer.vue,
ToolbarItemTooltip.vue, toolbar_icons.ts, toolbar_utils.ts) - Toolbar.vue, already
mounted via Sidebar.vue, is the only toolbar now.
- Adds CompasViewerOptions.extraToolbarModules so an npm-installed .vue module can be
mounted into the toolbar without forking this repo.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
No logic change - line-wrapping only, so npm run check's format:check step (which this branch hadn't been run through before) passes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds examples/embedded_custom_toolbar_button.html, showing extraToolbarModules with a plain Vue component (as a real npm-installed module would ship) that reads its own visible/enabled state via useToolbarControl(id) and sends interactions back to the backend via useViewerRuntime().handleUiAction(id, value) - both now exported from the public library entry point (they weren't before, so extraToolbarModules was effectively unusable by anyone outside this codebase). Also fixes src/library/public.d.ts, the hand-maintained published type declarations file, which never gained extraToolbarModules when it was added to the internal CompasViewerOptions - the npm package's own .d.ts didn't advertise the option at all. Verified end-to-end with a Playwright smoke check against the built dist-lib/ output: button renders, is clickable, no console errors. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ericgozzi
added this pull request to stack #29
September 21, 2026 12:47
This branch has not been deployed
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.
Summary
dispatch: "toolbar_control",overrides: { [id]: { visible?, enabled? } })..vueowning its own icon and behavior, matching every other button in this codebase; the backend can only show/hide or enable/disable a button the frontend already defines, never create one.useToolbarControl(id)composable, wired into all 14 built-in toolbar buttons.ToolbarRenderer.vue,ToolbarItemTooltip.vue,toolbar_icons.ts,toolbar_utils.ts) -Toolbar.vue, already mounted viaSidebar.vue, is the only toolbar now.CompasViewerOptions.extraToolbarModulesso an npm-installed.vuemodule can be mounted into the toolbar without forking this repo.Companion PR on the Python side: compas-dev/compas_threejs#54
Test plan
npm run typechecknpx eslint src tests --max-warnings=0npx vitest run(all suites pass;tests/browser/kitchen_sink.spec.tsis a pre-existing Playwright/Vitest runner mismatch, unrelated)npm run build:app