feat(web): Outliner restriction columns write the native flags
The web Outliner drew a single eye toggle while desktop draws the seven
restriction columns from SpaceOutliner.show_restrict_flags. The engine row
projection now carries restrict{...} read from the same flags the desktop
buttons use: the eye is Base.hide_viewport, the monitor/camera/select bits
live on Object, and exclusion/holdout/indirect-only come from the layer
collection. OUTLINER_SET_RESTRICTION writes the property through RNA; Shift
recurses through the collection subtree and its objects, Ctrl goes through
outliner_collection_isolate_flag (whose second click restores the default
visibility set). OUTLINER_SET_RESTRICT_COLUMNS toggles the popover
checkboxes; both are Main edits with changed=true.
The App renders the restriction buttons and the 限制列 popover group from
restrictColumns with optimistic drafts, except for isolate clicks, where
outliner_collection_isolate_flag forces the clicked collection back to
visible and a draft for that row could never reconcile with the snapshot.
Headed case [outliner-restrict-web] covers the popover columns, the object
eye plus the native VISIBLE filter, Shift recursion into a collection and
Ctrl isolate/restore on a product-created sibling collection; receipt
OUTLINER-HEADED-20261130-072807 (NOT_CLAIMED, 7/7). The armature panel
regression fails identically with this batch stashed, so it is tracked as
pre-existing.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -1589,6 +1589,32 @@ function assertFutureCapability(payload: Extract<WebEngineRequest["command"], {
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (edit.action === 'OUTLINER_SET_RESTRICTION') {
|
||||
const tree = area.space?.outliner;
|
||||
const row = tree?.rows.find(item => item.id === edit.rowId);
|
||||
const columns = ['enable', 'select', 'hide', 'viewport', 'render', 'holdout', 'indirectOnly'];
|
||||
if (area.nativeLayout?.editorType !== 'OUTLINER' ||
|
||||
!area.regions.some(item => item.kind === 'MAIN' && item.visible) ||
|
||||
!row || !row.restrict || row.restrictionEditable !== true ||
|
||||
!columns.includes(String(edit.column)) || typeof edit.value !== 'boolean' ||
|
||||
typeof edit.extend !== 'boolean' || typeof edit.isolate !== 'boolean' ||
|
||||
!(String(edit.column) in row.restrict)) {
|
||||
throw report('EDITOR_LAYOUT_INVALID', 'Native Outliner restriction requires a current editable row and column');
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (edit.action === 'OUTLINER_SET_RESTRICT_COLUMNS') {
|
||||
const columns = edit.columns;
|
||||
const keys = ['enable', 'select', 'hide', 'viewport', 'render', 'holdout', 'indirectOnly'];
|
||||
const valid = columns && typeof columns === 'object' &&
|
||||
Object.keys(columns).length > 0 &&
|
||||
Object.entries(columns).every(([key, value]) => keys.includes(key) && typeof value === 'boolean');
|
||||
if (area.nativeLayout?.editorType !== 'OUTLINER' ||
|
||||
!area.regions.some(item => item.kind === 'MAIN' && item.visible) || !valid) {
|
||||
throw report('EDITOR_LAYOUT_INVALID', 'Native Outliner restriction columns require a current visible tree');
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (edit.action === 'SET_ACTIVE_REGION') {
|
||||
// Native focus restores registered file-owned regions even before a GPU
|
||||
// desktop is attached. Keep ownership/revision checks above for both paths.
|
||||
|
||||
Reference in New Issue
Block a user