Repository navigation
[perf] canvas: filter the asset list in the browser instead of per keystroke - #593
Merged
princepride merged 2 commits intoNov 29, 2026
Merged
Conversation
…ystroke The asset list re-read the whole listing from the server for every search change, visibility choice and type tab, although it already reads every page of it. Each read recomputes inventory and usage over the full commit history, and the list was cleared while it ran. Load the unfiltered listing once when the list opens and filter search, visibility and type in the browser, with the same matching as the server's asset search. The open list now refreshes when the project changes (an agent adding media, for example), keeping the current rows on screen until the new list is complete; a change during a load reloads once after it, and pages from different revisions are retried before the list reports the change. Deleted rows leave at once after the delete receipt. Video hover previews now read like on-screen canvas media, at visible priority with an abort signal, so moving the pointer down a list of videos abandons reads nobody is waiting for instead of queueing every whole file ahead of the canvas. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
github-actions
Bot
requested review from
FayeSpica,
Probiotics5333,
allendyu and
kunkunblueberry
November 29, 2026 15:44
The open list reread every page whenever the project's event cursor moved, so moving nodes or an agent adding media one item at a time kept it reading, and each read recomputes inventory and usage over the commit history. It now compares a fingerprint of the snapshot parts the list is computed from (assets, owning nodes' titles, visibility and bindings, current results, pinned references, editor documents) and ignores other events, and refreshes start at least 2 s after the previous read ends. With the list open in the browser test, five node moves caused five list reads before and none now; eight text writes 300 ms apart caused 13 reads before and 3 now. A failed background refresh no longer empties the list: the rows stay, a notice says the list may be out of date, and the next change refreshes it again. Only a failed first read clears the list and shows the error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The asset list (资产列表) asks the server for the whole listing again on every search change, visibility choice and type tab, although it already reads every page of the listing. Each of those reads recomputes inventory and usage over the project's full commit history, and the list is cleared while the read runs. On large projects, every pause in typing therefore blanks the list and waits on the server.
This PR:
toLowerCaseand the server withcasefold; they differ only for a few characters such as German "ß", and Chinese text is unaffected. The text input usesuseDeferredValue, so typing stays responsive on long lists. Type counts are computed from the same filtered rows. The server'sasset-listand the agent'sasset.searchare unchanged.MEDIA_PRIORITY.visibleplus an abort signal), so moving off a row abandons the read. Before, every video previewed while moving down the list was downloaded in full, queued ahead of the canvas's own media and kept in memory.Linked issue
Labels
type:bug,area:assets,area:performance)Test plan
npx tsc --noEmitnpm test(1032 passed)npm run check:i18n(0 problems)node tests/browser/creation_asset_list.mjsagainst the isolatedtests/browser/creation_server.py+ Vite, with Chrome for Testing. It passes, and unmodifiedmainalso passes it in the same setup. The test now also checks that:Evidence that it works
mainasset-listrequests per searchReads while the list stays open and the project changes, measured with the browser test's scenario on the first commit of this PR and on its final version:
maindoesn't refresh an open list at all, so it sends no reads in either case, but it also doesn't show media an agent adds until the list is reopened.The fixture server is fast. Each
asset-listread scans the whole history, so the per-search cost grows with project size, while filtering in the browser does not.Provider verification
Bilingual UI
canvasNodes.assets.outdated: "资产列表可能已过期。" / "The asset list may be out of date."🤖 Generated with Claude Code