Repository navigation
Plugin panels: semantic button rows on widget surfaces; menus reuse quad panels (S06, api v29) - #3545
Merged
HakanSeven12 merged 1 commit intoNov 24, 2026
Conversation
…uad panels (S06, api v29) Stage 6 under the reuse rule: semantic BUTTONS arrive as an actionable row kind on the widget tier, and plugin MENUS are satisfied by the EXISTING v15 quad-panel mechanism - no second menu path, no duplicated dispatch (finding F1's economy; the mission's reuse directive). - WidgetRow gains action: Option<String> (serde default - the S05 payload is not yet merged, so the field is free): a row with an action IS a button. Validation refuses buttons that also declare children (buttons are leaf rows) and over-budget action names (ActionTooLong / ActionWithChildren, appended to the unmerged WidgetError). - Renderer: action rows render with a visible border so they read as controls, not tree rows; activation keeps the S05 flow exactly - SurfaceEvent::NodeActivated, owner-targeted, sequence-identified. - Menus: plugin menus continue to route through the registered quad-panel path (v15 QuadAction, owner-targeted since v15); the widget tier adds no competing menu vocabulary. Documented here as the reuse decision; no new menu code. Verification: cargo test -p ocs_plugin_api --all-features 219 passed / 0 failed / 1 ignored (new: button leaf-only + action budget validation); cargo test --lib -p OpenCADStudio -- panel_widgets panel_events green; host lib clean; wasm32 check green for OpenCADStudio + ocs_web_worker (recorded). Pre-existing upstream baseline failures (windows D3D12 trait errors; fmt/clippy informational jobs) inherited and untouched.
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.
Staged train (this PR is stage 6)
Each stage is one reviewable PR against
main; the links show exactly that stage's delta (stages 7 and 8 are already built, gated, and pushed — each opens as its own PR the moment its predecessor merges, one PR at a time):8374f0d33...aed170880aed170880...4b3f1f2acProblem and minimal scope
Stage 6 of the atomic panel-surface train (#3460 static scenes, #3510 patches, #3530 events, #3540 native widget tier): semantic buttons on widget surfaces. A plugin showing a tree/list in the native widget tier could not offer command rows — the smallest useful control. This stage lets a row BE a button:
WidgetRow.actionnames an action; activating the row deliversSurfaceEvent::NodeActivated(with the surface's sequence identity) to the OWNING plugin, exactly the S05 activation flow — no new event kind, no new delivery path. Deliberately a REUSE stage: plugin menus keep riding the existing v15 quad-panel path (no second menu vocabulary), and no prompt/dialog machinery is added.Public API / wire changes and current API-major basis
Based on upstream
mainat the #3540 merge (v29, declared by #3460 and carried by the merged train). No new API major and no new tags — this stage amends the S05 wire tail in place:widget.rs:WidgetRow.action: Option<String>(#[serde(default)], text-budget bound). Validation additions:ActionTooLong(action name exceeds the text budget) andActionWithChildren(buttons are leaf rows — an action plus children is refused). Pinned bybutton_rows_are_leaf_only_and_bounded.PanelSurfacePage) carriesWidgetRow, so the field enters the wire through S05's tail before any release ships it; the S05 + S06 pair lands as one coherent v29 story. No changes toPanelSurfacetiers, request/response variants, or notifications.PanelEventRouter::on_node_activated→ tag-16PanelSurfaceEvent.Semantics
ui/window/plugin_widgets.rs). The host-local activation gesture is unchanged; the plugin binds the semantics of the action name.WidgetReject::InvalidSurface).Legacy compatibility
Zero impact on scenes, patches, drag/events, or panels without widget surfaces. Pre-29 peers never see the field (it rides the v29-only widget tier). Non-button rows serialize exactly as S05 defined them.
Verification (exact commands, exit 0, at head
8374f0d33, rebased on upstream32e30c8b3)cargo test -p ocs_plugin_api --all-features→ 219 passed, 0 failed, 1 ignored (S05's 218 + the button validation pin).cargo test --lib -p OpenCADStudio -- panel_events panel_surfaces plugin_scene panel_widgets→ 22 passed, 0 failed.cargo check --lib -p OpenCADStudio→ clean.cargo check --locked -p OpenCADStudio -p ocs_web_worker --target wasm32-unknown-unknown→ clean.rustfmt --checkon the two touched files (widget.rs,plugin_widgets.rs) → 0 diffs (recorded at headae0f4b78d).Live-test evidence
Not run — honestly. Activation through the button path is the SAME code path S05 proves for tree rows; a live plugin binding an action name awaits the Windows host mirror (pending note unchanged).
Upstream-baseline failures (not regressions)
Unchanged from #3540: windows D3D12/windows-rs trait errors (inherited, documented with clean-checkout evidence on #3460/#3530); fmt/clippy informational jobs fail on pristine main (28 fmt hunks; 11 clippy errors). This PR adds zero new diagnostics.