Skip to content

fix(seek-slider): show position index for favorites instead of uniform scores#294

Merged
lstein merged 2 commits into
masterfrom
lstein/fix/favorites-seek-slider-index
Jun 4, 2026
Merged

fix(seek-slider): show position index for favorites instead of uniform scores#294
lstein merged 2 commits into
masterfrom
lstein/fix/favorites-seek-slider-index

Conversation

@lstein
Copy link
Copy Markdown
Owner

@lstein lstein commented Jun 4, 2026

Problem

When viewing the set of favorite images, the seek slider tick labels were in "Score" mode and showed a uniform 1.000 for 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.searchResults with score: 1.0 on every entry (bookmarks.js). The seek slider chose its label mode by checking searchResults[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 a searchType === "bookmarks" branch before the score check in both rendering paths in seek-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 shows Favorite: <n> instead of Score: 1.0000.

The branch is correctly scoped: searchType is always reassigned through setSearchResults, and bookmarks.js restores the prior type (or "clear") on exit, so it only triggers while actually viewing favorites.

Testing

  • Verified manually in the app (favorites view now shows position indices).
  • Prettier and ESLint pass clean on the changed file.

🤖 Generated with Claude Code

lstein and others added 2 commits June 4, 2026 00:11
…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>
@lstein lstein enabled auto-merge (squash) June 4, 2026 04:12
@lstein lstein merged commit 0001908 into master Jun 4, 2026
10 checks passed
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