fix(web): refresh the Outliner after visibility changes
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

The native visibility flag update left the Outliner tree empty and hid the
eye toggle. Refresh the active Outliner after setObjectVisibility.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
mes123456
2026-11-14 11:00:02 +08:00
parent cea4491607
commit 22c1ba696a
4 changed files with 103 additions and 1 deletions

View File

@@ -5770,6 +5770,18 @@ export function App({localOnly=false,course}:{localOnly?:boolean;course?:Availab
setGeometryBuffers(result.geometryBuffers);
setNonMeshGeometryBuffers(result.nonMeshGeometryBuffers ?? []);
setFrame(result.snapshot.frame.current);
if (command.type === 'setObjectVisibility') {
// The native visibility flag changes without touching the Outliner tree;
// refresh the active Outliner so rows and the eye state stay current.
const flow = nextSnapshot.editorWorkflow;
const workspace = flow?.workspaces.find(item => item.id === flow.context.workspaceId);
const outlinerArea = workspace?.areas.find(area => area.editor === 'OUTLINER' &&
area.regions.some(region => region.kind === 'MAIN' && region.visible));
if (flow && workspace?.writable && workspace.screenId && outlinerArea) {
void applyEditCommand({ type: 'editEditorContext', baseRevision: nextSnapshot.revision,
edit: { action: 'OUTLINER_REFRESH', workspaceId: workspace.id, screenId: workspace.screenId, areaId: outlinerArea.id } });
}
}
if (command.type === "setObjectTransform" && webPreferences.animation.useAutoKeying) {
const objectId = command.objectId;
const keyFrame = result.snapshot.frame.current;