Skip to content

fix(flow): reconcile scene clips in store and timeline - #34

Closed
google-labs-stitch[bot] wants to merge 1 commit into
mainfrom
stitch/reconcile-scene-clips-store-timeline-dom-jm0-44e57cdc-6397-4fdc-82e9-f0fd8a036f07
Closed

google-labs-stitch[bot] wants to merge 1 commit into
mainfrom
stitch/reconcile-scene-clips-store-timeline-dom-jm0-44e57cdc-6397-4fdc-82e9-f0fd8a036f07

Conversation

@google-labs-stitch

Copy link
Copy Markdown
Contributor

Summary

Align flow_scenes and flow_video with Google Flow build boq_labs-ai-sandbox-frontend_20261120.00_p0 without adding minified su or B6 controller symbols to VERIFIED_BUILDS:

  • Scene aspect ratio and collection ID (ts/angular.ts): Normalize clip 0 from getMap() with legacyTile, derive float width-to-height aspectRatio (0.5625 for 9:16 clips and 16 / 9 for 16:9 clips or empty scenes), and pass the parent collection ID (Dc) via Fc and wc from collectionIdOf, parentCollectionId, or the active /collection/<cid> route.
  • Timeline clip selection and cold-load binding (ts/video_ops.ts, ts/project_store.ts): Inspect own component-slot data properties in findProjectStoreInView for ProjectStore (GO) on cold scene loads, poll flow-scene-timeline until .clip.selected or Add clip settles, remove video from click selectors so prepare_extend never clicks <video> in flow-scene-editor-canvas, match target clips via resolveLView and pickerAssetMatches, select unselected target clips, and open Add clip then Extend.
  • Active clip media reconciliation (ts/read_store_snapshot.ts, src/scenes.rs): Reconcile active sceneTile.Uc clips (clip !== null) in place on matching VIDEO entries, skip trailing Cg history entries so hist[0] does not revert primary_media_id, url, or duration, clear url while status is pending or scheduled (or when primary_media_id changes without an inline URL), copy error states, preserve Oc and Yf fallbacks in ts/scene_tiles.ts, and keep the store bound in run_video_extend so ready extends finish without 420-second timeouts.
  • Pre-mutation checks and clip confirmation (ts/scene_ops.ts, src/scenes.rs): Reject non-SCENE targets and non-VIDEO asset IDs before helper.mutate runs, and poll sceneContents(tile).clips for up to 6 seconds to confirm clip insertion before returning ok: true.

Verification

  • cargo xtask ci passes with zero warnings (CI: OK).
  • RUSTFLAGS="-D warnings" cargo build --release --locked --bin flow-mcp succeeds with zero warnings.
  • External headless Chrome runtime verification (23 assertions against compiled flow_runtime.js) and MCP stdio check (initialize and tools/list on compiled flow-mcp) pass.

Scene clips verification


Automated PR initiated by user @byteland-app via Stitch Loop.

- Derive float scene aspect ratio and collection ID from clip 0
- Select target clip on flow-scene-timeline without video clicks
- Reconcile active scene clips in place and keep store bound
- Check scene and video IDs before mutations and confirm clips

Copy link
Copy Markdown
Contributor

ts/scene_ops.ts confirms additions by workflow membership. An unchanged scene that already has clip A can return confirmed: true when the request to add A did nothing. Check the expected insert position and the ordered before and after clip counts, with duplicate workflows in the test. Closing this implementation so the scene addition confirmation work can continue in #28.

@byteland-app
byteland-app deleted the stitch/reconcile-scene-clips-store-timeline-dom-jm0-44e57cdc-6397-4fdc-82e9-f0fd8a036f07 branch November 25, 2026 07:47
@google-labs-stitch

Copy link
Copy Markdown
Contributor Author

Acknowledged — confirmSceneClips in ts/scene_ops.ts:77–103 checks workflow membership (present.has(wfId)) without recording the ordered pre-mutation clip list or expected insert index, so an unchanged scene that already holds workflow A (or a request with duplicate workflows) satisfies workflowIds.every(...) and returns confirmed: true even when add_workflows_to_scene adds nothing. Confirming add_clips requires checking after.length === before.length + expected.length and matching the ordered before and expected slices around the expected insert position (position clamped to 0..before.length, defaulting to before.length), with duplicate workflow coverage in the verification test.

Leaving PR #34 closed as requested so the scene clip addition confirmation work continues in #28.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant