Repository navigation
Conversation
Opening or switching a canvas waited for every node's media, including hidden nodes, before the workspace became interactive. Project the canvas from the opened snapshot and keep a stable asset source in node media fields. Object URLs are resolved only where media is displayed or read, so they no longer enter the document, undo history or save baseline. Saving compares asset identity, so a late media read cannot change a binding. Return text with open-canvas, show loading and failed states per node, and check reference-catalog files against its one snapshot. Refs ThinkFlowLab#446
68b0103 to
d369be5
Compare
Checked with no finding, so the next review can start lower:
Ran: Not run: |
|
The only failing check is |
|
I checked the flake hypothesis against the code rather than rerunning, and your reading is right about where it fails. So the defect is in the shared test helper on I am not rerunning the failed job from this review: a Reviewer does not rerun a red required check to turn it green. The failed job is run |
|
Closing in favor of #485, which contains this commit and the stage 2 commit; the review points from here are addressed there. |
Summary
Stage 1 of 2 for progressive canvas loading (#446). Opening or switching a canvas no longer waits for every node's media.
opendirector-asset://<projectId>/<assetId>). Object URLs are resolved only where media is displayed or read, so they stay out of the document, undo history and save baseline.open-canvasreturns text bodies, so hidden text, copy and export do not depend on a later read.reference-catalogchecks files against its one snapshot instead of replaying history for each asset.Stage 2 (independent, prioritised node media) is a separate pull request that builds on this one.
Linked issue
Labels
Test plan
Local, on this commit (rebased onto
3c151e15):tsc --noEmit,check:i18n,check:browser-locale,check:browser-manifestandpre-commit run --from-ref mainpass.canvas_progressive_load(both languages, 3 of 3 runs),canvas_switch,structured_editors,editor_save,timeline_workflow(includes a real MP4 export),canvas_cropandlocal_output_deliverypass.8258d4b0, which contains this change; the final rebase onto3c151e15adds only an agent job-state query.Not run or not passing:
A dialog obscures the canvasbefore the rebase, the same way as on the base commit52102ed0. It was not rerun after the rebase.Left to CI: the repository's pull request checks.
Evidence that it works
Node states on this commit, in English and Chinese: one media read is held open, one fails, one has loaded, and the text node arrived with the canvas. After Retry, the failed node recovers on its own.
Six-direction switch benchmark on three heavy fixtures: A image-heavy (180 nodes, 0.67 GiB of assets), B video-heavy (89 nodes, 2.05 GiB), C mixed with editors (116 nodes, 0.97 GiB). Apple M2, 16 GiB, macOS 26.5. Browser runtime: Chrome 158 headless against the source server. Desktop: the packaged Electron 45 app.
Per direction: 4 warm-up switches excluded, then 10 measured switches. Values are median / P90 in ms, nearest-rank. "Usable" means the target title is shown, the workspace is not busy or inert, and every visible node is mounted. "Content" means every in-viewport image is decoded, video has
readyState >= 2, audio>= 1, and text is rendered. The driver uses CDP without the Network domain, because with it Chromium keeps every response Blob until the browser closes.Measured on
52102ed0(base) and this change before the rebase (9b50c442). The rebase adds four upstream commits (lease renewal, upload throughrequest(), a mask-composite edge, agent job-state queries) that do not touch canvas open or media reads. The CI fixes after measurement only change how an editor probes a saved asset's size and how the browser test seeds its fixture.¹ The stage 1 desktop C↔B run stopped at switch 9 of 24, so these rows have 3 and 2 measured samples. See Known limitations.
Click feedback P90 is at most 31 ms with stage 1 (67 ms on base), within the 100 ms budget. Usable median is within 500 ms in every direction. Usable P90 misses the 1000 ms budget for A→C in both runtimes at this stage; stage 2 brings it under.
Cold open after a server restart, usable median: A 15339 → 2066 ms (browser) and 8250 → 1418 ms (desktop); B 7289 → 1269 and 3630 → 719; C 4033 → 1481 and 3487 → 878. Time to all in-view content after a cold open does not improve the same way: browser A 15535 → 12475 ms, B 7507 → 5546, C 4033 → 3499; desktop A 8250 → 10473, B 3801 → 3728, C 3487 → 3576. On desktop, A's media finishes 2.2 s later than on base, because the canvas is usable first and media loads afterwards.
Peak Blob storage during a run drops from 1.0–2.8 GiB on base to 0.7–1.4 GiB, because hidden nodes are no longer read and text arrives with
open-canvas. Base also logged failed side requests (409 onassistant/draft, timed-outtool-tasksreads) in every run; stage 1 logged none outside the stopped run.Known limitations
storage_busylock timeout. In the stage 1 desktop C↔B run, six of C's media reads and one runtimes read got 409storage_busyabout 15 s after C opened, which matches the catalog lock timeout. As onmain, each media read at this stage replays the project's history under the catalog lock, so a burst of reads on a project with many commits can queue past 15 s. Those nodes stayed on "Could not load media" until Retry.storageRequestandCreationClient.openalready retrystorage_busy, buttransientReadFailuredoes not, somainhas the same gap; there the read error is swallowed and the node shows no media. Stage 2 removes the per-read replay, which shortens the lock holds, but does not close the retry gap.mainthe workspace stays inert until every node's media has loaded, so it cannot switch during that period at all.Provider verification
Bilingual UI
zh-CNanden-USare updated together. The progressive loading browser test runs in both languages.