feat: animate the UMAP reindex ring for updates started in the Album Manager#347
Open
lstein wants to merge 1 commit into
Open
feat: animate the UMAP reindex ring for updates started in the Album Manager#347lstein wants to merge 1 commit into
lstein wants to merge 1 commit into
Conversation
…Manager The semantic map's titlebar progress ring only attached to a run when the map was opened or the album changed, so an "Update Index" started from the Album Manager (or Update All) while the map sat open never animated it. updateIndex() now dispatches an "albumIndexStarted" window event whenever it successfully starts a run, and the Album Manager fires the same event when it attaches to a run it didn't start (e.g. begun in another tab). The ring listens for the event and, when it names the album being viewed, raises itself and polls that run to completion — a no-op if it is already tracking one. Co-Authored-By: Claude Fable 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 semantic map's titlebar refresh icon already swaps to a progress ring when it starts an index update, and the Album Manager's card shows progress for runs started from the map. But the reverse didn't hold: starting "Update Index" (or "Update All") from the Album Manager while the map sat open left the refresh icon inert. This PR makes the ring animate for the currently viewed album regardless of which control initiated the reindex.
How
index.js—updateIndex()dispatches a newalbumIndexStartedwindow event (with the album key) whenever it successfully starts a run. Every initiator — Album Manager button, Update All, auto-indexing, the UMAP button itself — funnels through this helper, so they all announce themselves.umap-reindex.js—initUmapReindexButton()listens foralbumIndexStarted; when the event names the album being viewed, it raises the progress ring and polls that run to completion (with the existing completion behavior: map reload + in-place slideshow refresh). If the ring is already tracking a run, the listener is a no-op, so the button's own runs aren't double-handled.album-manager.js— the "backend reports indexing already in progress" guard branch also fires the event, so the ring attaches when the Manager latches onto a run it didn't start (e.g. one begun in another tab), mirroring what the Manager's own card UI does.Tests
tests/frontend/umap-reindex.test.js:albumIndexStartedfor the current album raises the ring and tracks the run to completion; an event for a different album is ignored.tests/frontend/index-api.test.js(new):updateIndexdispatches the event and passes the response through on success; returns null and stays silent on failure.🤖 Generated with Claude Code