fix(studio): keep timeline selection authoritative in the preview sync

The store-to-preview sync no longer applies a partial selection: if a resolvable member's
DOM node is not ready yet it bails and retries on the next effect run, so the write-back can
never shrink the store's selection by dropping an unresolved member.

Marquee row hit-testing reuses shouldShowTimelineLayerGroupHeader instead of re-deriving
the group-header placement rule, keeping one owner for that predicate.
This commit is contained in:
Miguel Angel Simon Sierra
2026-07-09 16:54:34 -04:00
parent 0fe38e8cc8
commit 6673c32868
2 changed files with 9 additions and 1 deletions
@@ -2,6 +2,7 @@ import { formatTime } from "../lib/time";
import { roundToCenti } from "../../utils/rounding";
import type { StackingTimelineLayer, TimelineLayerId } from "./timelineTrackOrder";
import { resolveTimelineLayerStackingMove } from "./timelineLayerDrag";
import { shouldShowTimelineLayerGroupHeader } from "./TimelineLayerGroupHeader";
import type { TimelineStackingElement, TimelineStackingReorderIntent } from "./timelineStacking";
import {
@@ -348,7 +349,7 @@ export function selectTimelineElementsInMarquee({
for (const layerId of layerOrder) {
const layer = layerById.get(layerId);
if (!layer) continue;
if (layer.contextKey !== "" && layer.contextKey !== previousContextKey) {
if (shouldShowTimelineLayerGroupHeader(layer.contextKey, previousContextKey)) {
rowTop += groupHeaderHeight;
}
const rowBottom = rowTop + trackHeight;