feat(xcui): add editor command and menu foundations

This commit is contained in:
2026-04-06 18:05:34 +08:00
parent 4afeb19d25
commit f912e81ade
29 changed files with 3581 additions and 61 deletions

View File

@@ -2,75 +2,68 @@
This directory contains editor-only XCUI manual validation scenarios.
Current status:
Rules:
- Shared Core primitives remain in `tests/UI/Core/integration/`.
- Only editor-only host, shell, widget, and domain-integrated validation should live here.
- The first authored scenario is `workspace_shell_compose/`, focused on shell compose only:
splitters, tab host, panel chrome placeholders, and hot reload.
- The second scenario is `state/panel_session_flow/`, focused on editor command dispatch and panel session state only:
`command dispatch + workspace controller + open / close / show / hide / activate`.
- The third scenario is `state/layout_persistence/`, focused on editor layout save/load/reset only:
`layout snapshot + serialize / deserialize + invalid payload reject`.
- Shared Core primitives stay in `tests/UI/Core/integration/`.
- Only editor-only shell, host, widget, and domain-integrated validation belongs here.
- Scenarios are organized as `tests/UI/Editor/integration/<category>/<scenario>/`.
- Each scenario owns its own `captures/` directory.
Layout:
- `shared/`: editor validation scenario registry, Win32 host wrapper, shared theme
- `workspace_shell_compose/`: first manual editor shell compose scenario
- `state/panel_session_flow/`: custom host scenario for editor panel session state flow
- `state/layout_persistence/`: custom host scenario for editor layout persistence flow
- `shared/`: shared host wrapper, scenario registry, shared theme
- `shell/workspace_shell_compose/`: split/tab/panel shell compose only
- `shell/menu_bar_basic/`: menu bar open/close/hover/dispatch only
- `state/panel_session_flow/`: panel session state flow only
- `state/layout_persistence/`: layout save/load/reset only
- `state/shortcut_dispatch/`: shortcut match/suppression/dispatch only
Current scenario:
Scenarios:
- Scenario id: `editor.shell.workspace_compose`
- Build target: `editor_ui_workspace_shell_compose_validation`
- Executable name: `XCUIEditorWorkspaceShellComposeValidation`
- Validation scope: split/tab/panel shell compose only, no business panels
- `editor.shell.workspace_shell_compose`
Build target: `editor_ui_workspace_shell_compose_validation`
Executable: `XCUIEditorWorkspaceShellComposeValidation.exe`
Scope: splitters, tab host, panel chrome placeholders, hot reload
Additional scenario:
- `editor.shell.menu_bar_basic`
Build target: `editor_ui_menu_bar_basic_validation`
Executable: `XCUIEditorMenuBarBasicValidation.exe`
Scope: menu bar open/close, hover, dismiss, menu command dispatch only
- Scenario id: `editor.state.panel_session_flow`
- Build target: `editor_ui_panel_session_flow_validation`
- Executable name: `XCUIEditorPanelSessionFlowValidation`
- Validation scope: editor command dispatch and panel session state only, no business panels
- `editor.state.panel_session_flow`
Build target: `editor_ui_panel_session_flow_validation`
Executable: `XCUIEditorPanelSessionFlowValidation.exe`
Scope: command dispatch + workspace controller + open/close/show/hide/activate
Additional scenario:
- `editor.state.layout_persistence`
Build target: `editor_ui_layout_persistence_validation`
Executable: `XCUIEditorLayoutPersistenceValidation.exe`
Scope: layout snapshot + serialize/deserialize + invalid payload reject
- Scenario id: `editor.state.layout_persistence`
- Build target: `editor_ui_layout_persistence_validation`
- Executable name: `XCUIEditorLayoutPersistenceValidation`
- Validation scope: layout save / load / reset / invalid payload reject only, no business panels
- `editor.state.shortcut_dispatch`
Build target: `editor_ui_shortcut_dispatch_validation`
Executable: `XCUIEditorShortcutDispatchValidation.exe`
Scope: shortcut match + scope + suppression + command dispatch
Run:
```bash
cmake --build build --config Debug --target editor_ui_workspace_shell_compose_validation
```
Then launch `XCUIEditorWorkspaceShellComposeValidation.exe` from the build output, or run it from your IDE by target name.
Controls:
- Drag authored splitters to verify live resize and min clamps.
- Click `Document A/B/C` to verify only the selected tab placeholder is visible.
- Press `F12` to write screenshots into `workspace_shell_compose/captures/`.
- Authored `.xcui` and `.xctheme` changes hot reload while the host is running.
Panel session flow controls:
- Click `Hide Active / Show Doc A / Close Doc B / Open Doc B / Activate Details / Reset`.
- Check `Last command` shows `Changed / NoOp / Rejected` consistently with the current state.
- Press `F12` to write screenshots into `state/panel_session_flow/captures/`.
Layout persistence controls:
- Click `Hide Active -> Save Layout -> Close Doc B -> Load Layout`.
- Check `Saved` summary captures the expected active/visible state, and `Load Layout` restores it.
- Click `Load Invalid` and confirm the result is `Rejected` while current state remains unchanged.
- Press `F12` to write screenshots into `state/layout_persistence/captures/`.
Build:
```bash
cmake --build build --config Debug --target editor_ui_integration_tests
```
Selected controls:
- `shell/workspace_shell_compose/`
Drag splitters, switch `Document A/B/C`, press `F12`.
- `shell/menu_bar_basic/`
Click `File / Window / Layout`, move the mouse across menu items, click outside the menu or press `Esc`, press `F12`.
- `state/panel_session_flow/`
Click `Hide Active / Show Doc A / Close Doc B / Open Doc B / Activate Details / Reset`, press `F12`.
- `state/layout_persistence/`
Click `Hide Active -> Save Layout -> Close Doc B -> Load Layout`, click `Load Invalid`, press `F12`.
- `state/shortcut_dispatch/`
Press `Ctrl+P / Ctrl+H / Ctrl+W / Ctrl+O / Ctrl+R`, toggle `Text Input`, press `F12`.