Skip to content

Docking: reject raw panel opens through command aliases - #2527

Merged
bflatastic merged 1 commit into
storytold:mainfrom
nanox333:fix/docking-raw-open-guard
Oct 29, 2026
Merged

bflatastic merged 1 commit into
storytold:mainfrom
nanox333:fix/docking-raw-open-guard

Conversation

@nanox333

@nanox333 nanox333 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Raw Open/OpenAt actions through ui.dock and window.panel.layout bypassed the guard already applied by window.dockAction. Share that check across all three routes, preserving normal open/activate operations and documenting the restriction.

Follow-up to #2459.

Validation (prior Linux results):

  • Shared docking integration suite: 13 passed.
  • Regression covers both actions, viewer/ScriptUI identities, all three routes, unchanged layouts on rejection, and supported open/activate commands.
  • The regression failed against the original guard and passed with the fix restored.
  • Strict UI-crate Clippy with all targets, formatting, dependency layers, and asset attribution passed.

Local verification: fetched and verified the expected branch head; reviewed the diff against upstream main and passed git diff --check. No code changes or test reruns. The macOS native menu backend and full local CI were not run.

Summary by CodeRabbit

  • Behavior Changes
    • Raw Open and OpenAt docking actions are now rejected through ui.dock, window.panel.layout, and window.dockAction. Use panel open commands to open panels. Other supported docking actions, including Activate, remain available.
  • Documentation
    • Updated the control protocol guide to clarify where raw open actions are rejected and which commands to use instead.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between dd12ed8 and 335d1f5.

Files selected for processing: 3
  • crates/ui-egui/src/dock_ui.rs
  • crates/ui-egui/tests/it/shared_docking_ui.rs
  • docs/control-protocol.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

Raw Open and OpenAt docking actions now return an error across the supported docking routes. Integration tests cover rejection, unchanged panel state, and continued support for normal open commands and Activate actions. The control protocol documents the restriction.

Changes: Docking action validation

Layer / File(s) Summary
Validate raw panel-open actions
crates/ui-egui/src/dock_ui.rs, crates/ui-egui/tests/it/shared_docking_ui.rs, docs/control-protocol.md
A shared check rejects raw Open and OpenAt actions through the docking command paths. Tests verify errors and unchanged state, and confirm normal open commands and Activate actions remain usable. The control protocol documents the restriction.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: aiongg

Merge Risk: Minimal · up to 335d1

The change consistently rejects raw opens while preserving supported panel-opening behavior; no concrete merge-blocking risk is established.

Security architecture risk: Low · up to 335d1

The change restricts raw panel-opening commands rather than expanding access. Remaining uncertainty concerns externally supplied command handling and recovery after failures in the existing panel-opening behavior.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected control change affects command access to the current application's docking workspace and panel identities, including Viewer and ScriptPanel identifiers. It reduces raw-action reachability; the reviewed change does not establish a new credential, cross-service, or deployment authority path. Broader control-channel exposure was not assessed.

Trust Boundaries and Controls

  • inferred — The shared check closes the inspected alias paths from caller-supplied raw opening actions to workspace mutation. Rejection happens before downstream execution rather than attempting to repair lifecycle state afterward. This supports stronger lifecycle enforcement, but does not independently verify the downstream viewer or ScriptUI callback guarantees described by the error message.

Resilience and Maintainability Implications

  • observed — The existing opener stages layout changes on a clone and records an opening error before returning; show_panel still updates focus after raise_panel returns, and activation errors remain ignored. These behaviors predate the PR and gain no new execution branch here. Repeated supported dynamic-panel operations, callback failures, and recovery were not established by the new rejection-focused regression, so they are not treated as verified guarantees or introduced concerns.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: rejecting raw panel-open actions through docking command aliases.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 2 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Clippy (1.99.0)

Clippy execution timed out

Comment @coderabbitai help to get the list of available commands.

@nanox333
nanox333 marked this pull request as ready for review October 27, 2026 20:45
@bflatastic
bflatastic merged commit 7974a74 into storytold:main Oct 29, 2026
6 checks passed
@bflatastic

Copy link
Copy Markdown
Member

Merged, thank you @nanox333! It landed on main with a batch of community PRs, after a full workspace build and test run on Windows against the refactored main (fmt, strict clippy, about 4,100 tests, layers, assets and wasm).

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.

2 participants