Skip to content

feat(viewer): start the slideshow on open - #39

Open
skjnldsv wants to merge 2 commits into
mainfrom
feat/start-slideshow
Open

feat(viewer): start the slideshow on open#39
skjnldsv wants to merge 2 commits into
mainfrom
feat/start-slideshow

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

nextcloud/viewer master got startSlideshow in nextcloud/viewer@6534fcd5 after this library forked from it, and Photos already passes it from MemoriesView.vue and TimelineView.vue. The library had no way to start the slideshow from outside, and no way for a video to hold it.

open(nodes, file, { startSlideshow: true }) now starts the slideshow, ignored for a single file, and the state resets on close. Handlers get a fourth emit, update:playing: the slideshow pauses while it is true. The video and audio players emit it from the media element's play and pause events, so a playing clip finishes before the slideshow moves on. The old viewer only did this for videos; I wired the audio player too since the same argument holds.

Important

Depends on nextcloud-libraries/nextcloud-vue#8955, which exposes NcModal's slideshow state as v-model:slideshow-running. Until that is released and the @nextcloud/vue requirement bumped here, the option is a no-op at runtime (the modal ignores the unknown prop), and the slideshow.spec.ts e2e run is red on purpose: it drives the real modal and is the only check that can tell.

Covered by component tests: the option, its single-file and unasked cases, following the play / pause button, reset on close, a handler holding and releasing the slideshow, the hold dropping when the file changes, and both players emitting. The component tests stub NcModal, so they pass either way; the e2e spec passed locally with a build of the nextcloud-vue branch swapped into node_modules, and fails against 9.11 / 9.12.

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

`open(nodes, file, { startSlideshow: true })` opens straight into the
slideshow, which Photos does from its Memories and Timeline views. The
option is ignored for a single file. The slideshow state is bound to
NcModal's `slideshowRunning` model, so the play / pause button and the
last-slide stop are followed, and the state resets on close.

Handlers get an `update:playing` emit. The slideshow waits while it
is true, and the video and audio players emit it from the media
element's play and pause events, so a slideshow does not move on in
the middle of a video.

Needs @nextcloud/vue with the `slideshowRunning` model on NcModal.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv added type: enhancement 🚀 New feature or request AI assisted labels Sep 12, 2026
@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.96%. Comparing base (7735d90) to head (0df8bcb).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #39      +/-   ##
==========================================
+ Coverage   87.83%   87.96%   +0.12%     
==========================================
  Files          36       36              
  Lines        2474     2500      +26     
  Branches      519      522       +3     
==========================================
+ Hits         2173     2199      +26     
  Misses        297      297              
  Partials        4        4              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@skjnldsv
skjnldsv marked this pull request as ready for review September 12, 2026 15:47
The component tests stub NcModal, so they cannot tell whether the modal
takes the slideshow state. This drives the real one through the
playground, which gets a `slideshow` flag, and reads the state off the
play / pause button. It fails until @nextcloud/vue ships the
`slideshowRunning` model.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted type: enhancement 🚀 New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant