feat(web): Outliner Data menu runs the desktop View operators

Desktop OUTLINER_MT_context_menu_view's Expand/Collapse All, Show Hierarchy
and Show One Level now run OUTLINER_OT_expanded_toggle, show_hierarchy and
show_one_level[open] on the native tree store through an
OUTLINER_VIEW_OPERATION editor-context action.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
mes123456
2026-12-01 05:19:07 +08:00
parent f73318acfa
commit 07f7c842b8
12 changed files with 155 additions and 14 deletions

View File

@@ -1529,6 +1529,14 @@ function assertFutureCapability(payload: Extract<WebEngineRequest["command"], {
}
return;
}
if (edit.action === 'OUTLINER_VIEW_OPERATION') {
if (area.nativeLayout?.editorType !== 'OUTLINER' ||
!area.regions.some(item => item.kind === 'MAIN' && item.visible) ||
!['EXPANDED_TOGGLE', 'SHOW_HIERARCHY', 'SHOW_ONE_LEVEL', 'HIDE_ONE_LEVEL'].includes(edit.operation)) {
throw report('EDITOR_LAYOUT_INVALID', 'Native Outliner view operation requires a current visible tree');
}
return;
}
if (edit.action === 'OUTLINER_TOGGLE_EXPAND' || edit.action === 'OUTLINER_TREE_SELECT') {
const row = area.space?.outliner?.rows.find(item => item.id === edit.rowId);
if (area.nativeLayout?.editorType !== 'OUTLINER' ||