feat(web): Outliner header exposes the desktop controls and drops the web-only ones

LIBRARIES/ORPHAN_DATA gain the ID-type filter, LIBRARY_OVERRIDES the
lib_override_view_mode selector, VIEW_LAYER the header collection_new
button, ORPHAN_DATA Purge, and DATA_API the keying-set selector with
keyframe insert/delete. The web-only refresh and select/clear/invert/
toggle buttons are removed; selection stays on the keyboard.

The active filter_id_type stays in the ID-type menu after opening a file
whose Main has no data of that type, matching rna_enum_id_type_items,
so the snapshot decoder no longer rejects the open.

Headed case [outliner-header-controls-web] passes; full outliner suite
43/43.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
mes123456
2026-12-02 04:23:53 +08:00
parent 8173426da2
commit 44ce5cf402
12 changed files with 403 additions and 31 deletions

View File

@@ -1561,11 +1561,36 @@ function assertFutureCapability(payload: Extract<WebEngineRequest["command"], {
if (edit.action === 'OUTLINER_EDIT_OPERATION') {
if (area.nativeLayout?.editorType !== 'OUTLINER' ||
!area.regions.some(item => item.kind === 'MAIN' && item.visible) ||
!['KEYINGSET_ADD', 'KEYINGSET_REMOVE', 'DRIVERS_ADD', 'DRIVERS_DELETE'].includes(edit.operation)) {
!['KEYINGSET_ADD', 'KEYINGSET_REMOVE', 'DRIVERS_ADD', 'DRIVERS_DELETE',
'KEYFRAME_INSERT', 'KEYFRAME_DELETE'].includes(edit.operation)) {
throw report('EDITOR_LAYOUT_INVALID', 'Native Outliner edit operation requires a current visible tree');
}
return;
}
if (edit.action === 'OUTLINER_SET_LIB_OVERRIDE_VIEW_MODE') {
if (area.nativeLayout?.editorType !== 'OUTLINER' ||
!area.regions.some(item => item.kind === 'MAIN' && item.visible) ||
(edit.mode !== 'PROPERTIES' && edit.mode !== 'HIERARCHIES')) {
throw report('EDITOR_LAYOUT_INVALID', 'Native Outliner library override view mode requires a current visible tree');
}
return;
}
if (edit.action === 'OUTLINER_SET_ID_TYPE_FILTER') {
if (area.nativeLayout?.editorType !== 'OUTLINER' ||
!area.regions.some(item => item.kind === 'MAIN' && item.visible) ||
typeof edit.use !== 'boolean' || typeof edit.idType !== 'string' || edit.idType.length > 64) {
throw report('EDITOR_LAYOUT_INVALID', 'Native Outliner ID type filter requires a current visible tree');
}
return;
}
if (edit.action === 'OUTLINER_SET_ACTIVE_KEYINGSET') {
if (area.nativeLayout?.editorType !== 'OUTLINER' ||
!area.regions.some(item => item.kind === 'MAIN' && item.visible) ||
typeof edit.name !== 'string' || new TextEncoder().encode(edit.name).byteLength > 63) {
throw report('EDITOR_LAYOUT_INVALID', 'Native Outliner keying set 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' ||
@@ -1641,6 +1666,10 @@ function assertFutureCapability(payload: Extract<WebEngineRequest["command"], {
!['UNLINK', 'SINGLE', 'LOCAL', 'SELECT_HIERARCHY', 'SELECT', 'DESELECT', 'SELECT_LINKED', 'COPY', 'PASTE', 'FAKE_ADD', 'FAKE_CLEAR', 'ASSET_MARK', 'ASSET_CLEAR', 'ASSET_CLEAR_FAKE', 'LIBOVERRIDE_MAKE', 'LIBOVERRIDE_RESET', 'LIBOVERRIDE_CLEAR', 'COLLECTION_NEW', 'COLLECTION_SELECT', 'COLLECTION_DESELECT', 'COLLECTION_DUPLICATE', 'COLLECTION_DUPLICATE_LINKED', 'COLLECTION_INSTANCE', 'COLLECTION_COLOR_TAG', 'COLLECTION_ISOLATE', 'COLLECTION_SHOW', 'COLLECTION_HIDE', 'COLLECTION_SHOW_INSIDE', 'COLLECTION_HIDE_INSIDE', 'COLLECTION_ENABLE', 'COLLECTION_DISABLE', 'COLLECTION_ENABLE_RENDER', 'COLLECTION_DISABLE_RENDER', 'COLLECTION_EXCLUDE_SET', 'COLLECTION_EXCLUDE_CLEAR', 'COLLECTION_HOLDOUT_SET', 'COLLECTION_HOLDOUT_CLEAR', 'COLLECTION_INDIRECT_ONLY_SET', 'COLLECTION_INDIRECT_ONLY_CLEAR', 'COLLECTION_LINK', 'PURGE'].includes(edit.operation) ||
(purge
? area.space?.outliner?.displayMode !== 'ORPHAN_DATA'
/* The header's collection_new button has no row: the native exec
* reads the tree selection and falls back to the master collection
* (outliner_collections.cc collection_new_exec). */
: edit.operation === 'COLLECTION_NEW' && !row ? false
: !row || ((edit.operation === 'FAKE_ADD' || edit.operation === 'FAKE_CLEAR') && row.fakeUser == null) ||
(edit.operation === 'LOCAL' && row.linked !== true) ||
(edit.operation === 'SELECT_HIERARCHY' && !row.objectId) ||