Skip to content

Commit df1cba5

Browse files
committed
fix(views): seed active view on init and state restore
Tools and rendering panels gate on currentImageID, which resolves through activeView -> viewByID[activeView].dataID. The slice manipulator's scroll-ref watcher used to set activeView as a side effect on first paint, so a fresh app and pre-5.0.2 session loads both relied on that. Removing the watcher (to stop cine playback from fighting over the active view) left activeView undefined on both paths, so the brush/ruler/etc. buttons stayed disabled and the layer opacity slider never rendered. Call ensureActiveViewIsVisible after pushing the initial layout views and after deserializing a manifest. Fixes ~10 previously failing e2e specs (full local wdio suite goes 23/23).
1 parent 4795212 commit df1cba5

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/store/views.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,11 @@ export const useViewStore = defineStore('view', () => {
331331
} as unknown as ViewInfo;
332332
});
333333
}
334+
335+
// Older manifests (pre-5.0.2) don't persist activeView, so the restored
336+
// state can land with no active view and tools/panels gated on
337+
// currentImageID never enable. Pick the first visible view as a fallback.
338+
ensureActiveViewIsVisible();
334339
}
335340

336341
function bindViewsToData(
@@ -353,6 +358,10 @@ export const useViewStore = defineStore('view', () => {
353358
firstLayout.views.forEach((viewInit) => {
354359
layoutSlots.value.push(addView(viewInit));
355360
});
361+
// The slice manipulators used to set the active view as a side effect of
362+
// their initial scroll-ref watcher firing. That watcher was removed so cine
363+
// playback wouldn't fight over the active view, so seed it explicitly here.
364+
ensureActiveViewIsVisible();
356365

357366
watch(disabledViewTypes, () => {
358367
applyDisabledViewTypesFilter();

0 commit comments

Comments
 (0)