Skip to content

fix(flow): bind edit controllers with scene delegation - #50

Closed
google-labs-stitch[bot] wants to merge 1 commit into
mainfrom
stitch/bind-edit-controllers-scene-delegation-jm0-4c8045a3-a6b3-44f7-bf00-e3c9fa6429b6
Closed

google-labs-stitch[bot] wants to merge 1 commit into
mainfrom
stitch/bind-edit-controllers-scene-delegation-jm0-4c8045a3-a6b3-44f7-bf00-e3c9fa6429b6

Conversation

@google-labs-stitch

@google-labs-stitch google-labs-stitch Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Bind verified Google Flow Angular edit controllers (ZX, su, and l6), write PromptState.Gp payloads through _.QI ({ kf }) on edit routes while keeping { Oe, Te, kf } on generation routes, delegate single-clip SCENE tiles and scene clips to /project/<id>/scene/<scene_id>, fail fast on blocked editors, fall back to downloading and re-uploading images when the editor does not open, and poll hx: false variant history in flow_edit.

Changes

  • Add ts/edit_builds.ts with EditBuildFormat, isEditRoute, and VERIFIED_EDIT_BUILDS (boq_labs-ai-sandbox-frontend_20261120.00_p0), and report ZX, su, QI, and kf checks under probeStore().operations.asset_edit in ts/frontend_compatibility.ts so failed edit-only checks do not fail probeStore() or block generation.
  • Add ts/edit_composer.ts and update ts/composer.ts, ts/setup_generation.ts, ts/attach_ingredients.ts, and ts/submit_generation.ts to bind flow-edit-image-prompt-box and flow-edit-video-prompt-box across /edit/, /scene/, and explicit edit contexts while excluding flow-agent-panel, flow-creative-agent-prompt-box, flow-editor-side-panel, and flow-editor-history-panel on all routes.
  • Update ts/types.ts and ts/prompt_writer.ts to build PromptState.Gp payloads via _.QI ({ kf: [{ type: "text", content }] }) on edit routes and { Oe, Te, kf } on non-edit routes so flow_generate preserves { Oe, Te }.
  • Extract src/edit.rs from src/generation.rs and update ts/open_edit_asset.ts, ts/edit_composer.ts, and ts/scene_tiles.ts to delegate single-clip SCENE tiles and scene clips to /project/<id>/scene/<scene_id>, verify target clip selection in selectSceneTimelineClip and check its result in openEditAsset, reject empty or multi-clip scenes with clip IDs, scope readEditBlockReason to .too-long-overlay and explicit l6 asset-block signals (ignoring submitDisabledReason before prompt entry and generic [role="alert"] notices), and fall back to downloading and re-uploading source images when the editor does not open.
  • Update ts/read_store_snapshot.ts, src/assets.rs, src/generation.rs, and src/edit.rs to emit normalized variants from tile.history and sceneTile.Cg without changing primary URLs, abort wait_for_new_assets within one 3-second poll on failed hx: false variants, and save newly completed variants before exiting subroutes.

Verification

  • Run cargo fmt --all and cargo xtask ci (CI: OK, including formatting, SPDX headers, line limits, Clippy, rustdoc, tsc --noEmit, esbuild, contract checks, and cargo deny).
  • Run headless Chrome and flow-mcp MCP stdio end-to-end checks against the 20261120.00_p0 Flow Angular runtime (probeStore isolation under operations.asset_edit, { Oe, Te, kf } generation payload vs _.QI({ kf }) edit payload, readEditBlockReason ignoring UO="Enter a prompt" and generic [role="alert"] notices while catching .too-long-overlay, selectSceneTimelineClip verification and scene_clip_not_selected enforcement, and src/edit.rs image download/re-upload fallback).

Angular Edit Controllers & Scene Delegation Verification

- Verify ZX, su, QI, and kf descriptors in edit_builds and probeStore
- Bind edit image and video prompt boxes on /edit/ and /scene/ routes
- Exclude Agent, side, and history panels from composer discovery
- Build PromptState.Gp payloads via _.QI with { kf, Te, Oe } fallback
- Delegate one-clip scenes to /scene/<id> and select timeline clips
- Fail fast on empty or multi-clip scenes and blocked editor alerts
- Poll variant history to abort failed edits and save new variants
@byteland-app

Copy link
Copy Markdown
Contributor

Closing as a duplicate. #43 changes almost the same files (open_edit_asset.ts, scene_tiles.ts, generation.rs, types.ts) for the same edit flow, and the two PRs cannot both merge. #43 is the PR to keep.

Review points that stay open for a later PR:

  1. ts/edit_composer.ts (readEditBlockReason): any non-empty submitDisabledReason is a block reason, and openEditAsset calls it before the prompt is written. If UO returns a text such as "Enter a prompt" for an empty prompt, every flow_edit fails in src/edit.rs:290. [role="alert"] also matches normal notices.
  2. ts/edit_builds.ts and ts/prompt_writer.ts: buildPromptPayload does not check the route, so a normal flow_generate on build 20261120 writes only {kf} and no longer {Oe,Te}.
  3. ts/open_edit_asset.ts (about L1926 and L2066): the result of selectSceneTimelineClip is ignored, so an edit can go to a wrong clip or to no selected clip.
  4. src/edit.rs:372: the fallback that downloads the file and uploads it again is removed, so an image edit fails when the editor does not open.
  5. A failed edit-only check fails probeStore for the whole 20261120 build, and it blocks generation too.
  6. The PR text has the line "Automated PR initiated by ... via Stitch Loop". AGENTS.md does not allow attribution lines.

You can reopen this PR if needed.

@byteland-app
byteland-app deleted the stitch/bind-edit-controllers-scene-delegation-jm0-4c8045a3-a6b3-44f7-bf00-e3c9fa6429b6 branch November 28, 2026 01:40
@google-labs-stitch

Copy link
Copy Markdown
Contributor Author

Kept PR #50 closed as a duplicate of #43, and pushed 549d8c7 to the branch (plus updated the PR text) so all six review points are resolved if this branch is referenced or reopened later:

  1. ts/edit_composer.ts (readEditBlockReason): Removed submitDisabledReason (UO) from readEditBlockReason() (moving post-prompt UO inspection to readEditSubmitDisabledReason() for start_generation_disabled diagnostics in ts/submit_generation.ts), and narrowed DOM block detection to .too-long-overlay inside edit containers so empty-prompt reasons ("Enter a prompt") and normal [role="alert"] notices no longer fail openEditAsset.
  2. ts/edit_builds.ts and ts/prompt_writer.ts: Added route/context gating (editRoute = isEditRoute() / opts.edit) to buildPromptPayload so _.QI ({ kf }) runs only in edit contexts while normal flow_generate on build 20261120.00_p0 writes { Oe, Te, kf }.
  3. ts/open_edit_asset.ts and ts/edit_composer.ts: Removed blind first-clip fallbacks in selectSceneTimelineClip, verified that the active clip ID matches the requested clip ID after selection and loading settle, and checked the boolean result at both /scene/ and /edit/ (scene_builder) call sites in openEditAsset (returning error: "scene_clip_not_selected" when selection fails).
  4. src/edit.rs and ts/open_edit_asset.ts: Required a visible textbox before reporting opened: true on unblocked editors, and restored the src/edit.rs image fallback that returns to the project workspace root, downloads (or reuses the cached file for) the source image, and uploads it via frames when the editor does not open.
  5. ts/frontend_compatibility.ts: Removed editBuildChecks from top-level probeStore().checks and reported it under probeStore().operations.asset_edit so an edit-only check failure does not fail probeStore().ok or block generation.
  6. PR description: Removed the attribution footer line per AGENTS.md.

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