BS-JD-004 - Unified operator/action framework #6

Closed
opened 2026-06-06 01:45:43 -04:00 by Rbanh · 5 comments
Owner

Summary

Unify command palette actions, history commands, asset drag/drop, and modal tools behind one operator interface with preview, commit, cancel, and undo.

Why

Future brush, terrain, material, and physics tools need consistent mutation semantics rather than one-off UI handlers.

Implementation notes

  • Define an editor operator trait or command object for preview, commit, cancel, undo description, dirty flag, and status text.
  • Route asset drops, command palette actions, modal tools, and history mutations through the same execution path.
  • Support grouped undo for continuous drags/strokes.
  • Ensure cancel leaves no dirty state or helper entities.

Acceptance criteria

  • Existing representative actions migrate to operator path.
  • Operators expose status text and disabled reasons.
  • Preview helpers are cleaned on commit/cancel.
  • Undo grouping works for drag/drop and modal interactions.

Tests/docs

Operator unit tests and UI smoke coverage for commit/cancel/undo invariants. Update docs/editor/architecture.md.

## Summary Unify command palette actions, history commands, asset drag/drop, and modal tools behind one operator interface with preview, commit, cancel, and undo. ## Why Future brush, terrain, material, and physics tools need consistent mutation semantics rather than one-off UI handlers. ## Implementation notes - Define an editor operator trait or command object for preview, commit, cancel, undo description, dirty flag, and status text. - Route asset drops, command palette actions, modal tools, and history mutations through the same execution path. - Support grouped undo for continuous drags/strokes. - Ensure cancel leaves no dirty state or helper entities. ## Acceptance criteria - [ ] Existing representative actions migrate to operator path. - [ ] Operators expose status text and disabled reasons. - [ ] Preview helpers are cleaned on commit/cancel. - [ ] Undo grouping works for drag/drop and modal interactions. ## Tests/docs Operator unit tests and UI smoke coverage for commit/cancel/undo invariants. Update `docs/editor/architecture.md`.
Rbanh added this to the M0 - Foundation and polish seams milestone 2026-06-06 01:45:44 -04:00
Rbanh added the
roadmap:jackdaw
type:architecture
priority:P0
area:operators
labels 2026-06-06 01:45:44 -04:00
Author
Owner

Starting next M0 slice after 2054fa2.

Initial scope for this pass:

  • Inventory existing mutation paths: command palette, history commands, asset placement/drop, and modal viewport tools.
  • Add the smallest operator/action abstraction that can wrap representative existing actions without breaking undo/history.
  • Prefer an incremental bridge over a wholesale rewrite; broader modal brush/terrain operators can build on the bridge in later tickets.
Starting next M0 slice after `2054fa2`. Initial scope for this pass: - Inventory existing mutation paths: command palette, history commands, asset placement/drop, and modal viewport tools. - Add the smallest operator/action abstraction that can wrap representative existing actions without breaking undo/history. - Prefer an incremental bridge over a wholesale rewrite; broader modal brush/terrain operators can build on the bridge in later tickets.
Author
Owner

Local implementation progress pending QA/sign-off (not committed yet):

  • Added crates/editor/src/operators.rs with EditorOperator, ActiveOperator, lifecycle phases, disabled reasons, preview/commit/cancel handling, and immediate-operator helper.
  • Routed command palette / queued editor command dispatch through the operator bridge while preserving existing EditorCommandRegistry implementations and EditorHistory undo payloads.
  • Added a disabled reason for play.toggle_possession when not in Play mode.
  • Status bar now shows the current/last operator label and lifecycle hint.
  • Added operator lifecycle unit tests for commit and cancel rollback.

Verification so far:

  • cargo fmt --check
  • cargo test -p editor operators
  • cargo check --workspace --all-targets
  • cargo check --workspace --all-targets --all-features

Known scope left for #6 after this bridge: migrate representative asset drop/material apply/component add/gizmo commit actions onto explicit named operators and add undo snapshot coverage for those paths.

Local implementation progress pending QA/sign-off (not committed yet): - Added `crates/editor/src/operators.rs` with `EditorOperator`, `ActiveOperator`, lifecycle phases, disabled reasons, preview/commit/cancel handling, and immediate-operator helper. - Routed command palette / queued editor command dispatch through the operator bridge while preserving existing `EditorCommandRegistry` implementations and `EditorHistory` undo payloads. - Added a disabled reason for `play.toggle_possession` when not in Play mode. - Status bar now shows the current/last operator label and lifecycle hint. - Added operator lifecycle unit tests for commit and cancel rollback. Verification so far: - `cargo fmt --check` - `cargo test -p editor operators` - `cargo check --workspace --all-targets` - `cargo check --workspace --all-targets --all-features` Known scope left for #6 after this bridge: migrate representative asset drop/material apply/component add/gizmo commit actions onto explicit named operators and add undo snapshot coverage for those paths.
Author
Owner

Committed and pushed operator bridge in d77cc6a (Add editor operator lifecycle bridge).

Landed:

  • Added crates/editor/src/operators.rs with EditorOperator, lifecycle phases, disabled reasons, preview/commit/cancel handling, and ActiveOperator status.
  • Routed command palette and queued editor commands through immediate operators while preserving the existing EditorCommandRegistry and EditorHistory undo payloads.
  • Added command disabled metadata; play.toggle_possession now reports a blocked operator status when not in Play mode.
  • Status bar shows operator lifecycle text.
  • History entries now expose labels, and operator commits that push undo entries update status as Undo: Tool: ... - Committed ...; undo/redo now report useful labels.
  • Updated editor architecture/docs index.

Verified before commit:

  • cargo fmt --check
  • cargo test -p editor operators
  • cargo check --workspace --all-targets
  • cargo check --workspace --all-targets --all-features

Remaining #6 scope:

  • Migrate representative asset drop/material apply/component add/gizmo commit paths onto explicit named operators.
  • Add undo snapshot coverage for those migrated paths.
Committed and pushed operator bridge in `d77cc6a` (`Add editor operator lifecycle bridge`). Landed: - Added `crates/editor/src/operators.rs` with `EditorOperator`, lifecycle phases, disabled reasons, preview/commit/cancel handling, and `ActiveOperator` status. - Routed command palette and queued editor commands through immediate operators while preserving the existing `EditorCommandRegistry` and `EditorHistory` undo payloads. - Added command disabled metadata; `play.toggle_possession` now reports a blocked operator status when not in Play mode. - Status bar shows operator lifecycle text. - History entries now expose labels, and operator commits that push undo entries update status as `Undo: Tool: ... - Committed ...`; undo/redo now report useful labels. - Updated editor architecture/docs index. Verified before commit: - `cargo fmt --check` - `cargo test -p editor operators` - `cargo check --workspace --all-targets` - `cargo check --workspace --all-targets --all-features` Remaining #6 scope: - Migrate representative asset drop/material apply/component add/gizmo commit paths onto explicit named operators. - Add undo snapshot coverage for those migrated paths.
Author
Owner

Local implementation progress pending QA/sign-off (not committed yet):

Asset workflow migration slice:

  • Added crates/editor/src/assets/operators.rs with immediate operators for:
    • assets.place
    • assets.place_subasset
    • assets.apply_texture
    • assets.apply_material
  • Viewport drag/drop now routes asset placement, mesh subasset placement, texture apply, and material apply through these operators.
  • Asset Browser footer/detail/context actions for place/apply now use the same operator wrappers.
  • Selection-dependent texture/material operators report a disabled reason when no authored actor is selected.
  • Updated architecture docs to note asset placement/apply is now on the operator status path.

Verification:

  • cargo fmt --check
  • cargo test -p editor operators
  • cargo check -p editor --all-targets
  • cargo check --workspace --all-targets
  • cargo check --workspace --all-targets --all-features (before the doc-only follow-up; workspace check rerun after docs)

QA focus:

  • Drag a mesh/model asset into the viewport and confirm placement, undo text, undo, redo.
  • Drag/apply a texture or material with no selection and confirm the status bar reports the disabled reason.
  • Select an authored actor, apply texture/material from Asset Browser and via viewport drop, then undo/redo.
  • Place a mesh subasset from Asset Browser details/context menu and confirm status/undo.
Local implementation progress pending QA/sign-off (not committed yet): Asset workflow migration slice: - Added `crates/editor/src/assets/operators.rs` with immediate operators for: - `assets.place` - `assets.place_subasset` - `assets.apply_texture` - `assets.apply_material` - Viewport drag/drop now routes asset placement, mesh subasset placement, texture apply, and material apply through these operators. - Asset Browser footer/detail/context actions for place/apply now use the same operator wrappers. - Selection-dependent texture/material operators report a disabled reason when no authored actor is selected. - Updated architecture docs to note asset placement/apply is now on the operator status path. Verification: - `cargo fmt --check` - `cargo test -p editor operators` - `cargo check -p editor --all-targets` - `cargo check --workspace --all-targets` - `cargo check --workspace --all-targets --all-features` (before the doc-only follow-up; workspace check rerun after docs) QA focus: - Drag a mesh/model asset into the viewport and confirm placement, undo text, undo, redo. - Drag/apply a texture or material with no selection and confirm the status bar reports the disabled reason. - Select an authored actor, apply texture/material from Asset Browser and via viewport drop, then undo/redo. - Place a mesh subasset from Asset Browser details/context menu and confirm status/undo.
Author
Owner

M0 completion update landed in cc6acb1 (Complete M0 editor asset workflow).

Completed scope:

  • Added asset operator wrappers for assets.place, assets.place_subasset, assets.apply_texture, and assets.apply_material.
  • Routed viewport drag/drop and Asset Browser actions through the operator lifecycle where applicable.
  • Kept operator status/undo labeling visible in the status bar from the earlier lifecycle bridge.
  • Added focused operator tests covering commit/cancel behavior.

Validation:

  • cargo fmt --check
  • cargo test -p editor operators
  • cargo check -p editor --all-targets
  • cargo check --workspace --all-targets
  • cargo check --workspace --all-targets --all-features

User QA passed. Closing as the M0 operator/action framework slice is complete; future richer operation coverage should be tracked as follow-up tickets.

M0 completion update landed in `cc6acb1` (`Complete M0 editor asset workflow`). Completed scope: - Added asset operator wrappers for `assets.place`, `assets.place_subasset`, `assets.apply_texture`, and `assets.apply_material`. - Routed viewport drag/drop and Asset Browser actions through the operator lifecycle where applicable. - Kept operator status/undo labeling visible in the status bar from the earlier lifecycle bridge. - Added focused operator tests covering commit/cancel behavior. Validation: - `cargo fmt --check` - `cargo test -p editor operators` - `cargo check -p editor --all-targets` - `cargo check --workspace --all-targets` - `cargo check --workspace --all-targets --all-features` User QA passed. Closing as the M0 operator/action framework slice is complete; future richer operation coverage should be tracked as follow-up tickets.
Rbanh closed this issue 2026-06-06 05:06:31 -04:00
Sign in to join this conversation.
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Falling-Metal-Interactive/Blacksite#6
No description provided.