fix(seek-slider): show position index for favorites instead of uniform scores#294
Merged
Merged
Conversation
…m scores Favorites/bookmarks are stored in state.searchResults with score=1.0 on every entry, so the seek slider fell into the "Score" branch and displayed a uniform 1.000 for every tick. Add a state.searchType === "bookmarks" branch (before the score check) in both renderSliderTicks() and onSliderInput() so favorites show their slide position within the set, matching how cluster selections display positions. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Problem
When viewing the set of favorite images, the seek slider tick labels were in "Score" mode and showed a uniform
1.000for every position. This is not useful — the indices should indicate the slide # within the set of favorites, similar to how cluster positions are shown when a cluster is selected.Cause
Favorites/bookmarks are stored in
state.searchResultswithscore: 1.0on every entry (bookmarks.js). The seek slider chose its label mode by checkingsearchResults[0].score !== undefined, so favorites incorrectly fell into the "Score" branch.Fix
Use
state.searchType, which is already set to"bookmarks"when favorites are shown. Added asearchType === "bookmarks"branch before the score check in both rendering paths inseek-slider.js:renderSliderTicks()— labels the context"Favorite"and renders each tick as its position index, matching cluster mode.onSliderInput()— the hover/drag info panel now showsFavorite: <n>instead ofScore: 1.0000.The branch is correctly scoped:
searchTypeis always reassigned throughsetSearchResults, and bookmarks.js restores the prior type (or"clear") on exit, so it only triggers while actually viewing favorites.Testing
🤖 Generated with Claude Code