Skip to content

feat(slideshow): gray out play button on last slide in sequential mode#296

Merged
lstein merged 1 commit into
masterfrom
lstein/feature/gray-out-play-on-last-slide
Jun 4, 2026
Merged

feat(slideshow): gray out play button on last slide in sequential mode#296
lstein merged 1 commit into
masterfrom
lstein/feature/gray-out-play-on-last-slide

Conversation

@lstein
Copy link
Copy Markdown
Owner

@lstein lstein commented Jun 4, 2026

Summary

A tiny UI tweak: when the slideshow mode is sequential and the current slide is the last slide (album or search results), the play button now grays out and is inactivated.

Behavior

  • Sequential mode, parked on the last slide → play button grays out (opacity 0.25, cursor: default) and clicks are ignored.
  • Shuffle mode → unaffected (there is no "end of list").
  • Wrap-navigation enabled → unaffected (resolveOffset always resolves to a real index).
  • Pause button → never disabled; only a stopped play button on the final slide is grayed.
  • The button re-activates automatically as soon as you navigate away from the last slide.

Implementation

  • slideshow.js — new atSequentialEnd() helper reuses slideState.resolveOffset(+1) (the same end-of-list signal the auto-pause path from fix(slideshow): stop on last slide in linear mode; reshuffle endlessly in shuffle mode #293 relies on). updateSlideshowButtonIcon() toggles a slideshow-disabled class; toggleSlideshowWithIndicator() no-ops a click in that state.
  • events.js — wired the icon refresh into the existing (previously empty) slideChanged listener so the button stays in sync across every navigation path (swipe, seek slider, UMAP, etc.).
  • control-and-search-panels.css — extended the existing .back-nav-disabled rule to also cover .slideshow-disabled, following the established disabled-button convention.

Testing

  • npm test — 343 frontend tests pass
  • npm run lint + npm run format:check — clean

🤖 Generated with Claude Code

When stopped on the final slide in sequential mode (album or search
results), the play button now grays out and ignores clicks — there is
nothing left to advance to. Shuffle mode (no "end") and wrap-navigation
(always resolves to a real index) are unaffected, and the Pause button
is never disabled.

Reuses slideState.resolveOffset(+1) — the same end-of-list signal the
auto-pause path from #293 relies on — and refreshes the button via the
existing slideChanged listener so it updates on every navigation path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lstein lstein merged commit bf9fe43 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