Skip to content

feat(viewer): keep the user's viewer settings - #65336

Open
skjnldsv wants to merge 1 commit into
masterfrom
feature/viewer-settings
Open

skjnldsv wants to merge 1 commit into
masterfrom
feature/viewer-settings

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Summary

The viewer library now has a settings dialog (nextcloud-libraries/nextcloud-viewer#136), and remembers the volume of videos and audio. These settings are stored on the server.

Following review, apps/viewer is a minimal, always enabled app again, the server side of the viewer. It already held the OCA.Viewer shim and the deprecated LoadViewer event. It now also keeps the user's viewer settings, the way the Files app keeps its own: a UserConfig service listing the allowed keys, an OCS endpoint to change one, and the settings handed to the viewer as the viewer/config initial state, for logged-in users only. They are the slideshow delay (1 to 60 seconds), the volume (0 to 100) and whether media start muted.

Core keeps loading the viewer itself. The app is back in shipped.json where it was before #63954, and off the abandoned apps the repair step cleans up. It continues the old app's versions at 9.0.0-dev.0, where nextcloud/viewer's master stood after 8.0.0 in 35, so an instance upgrading from 35 updates it like any other app.

curl -u alice:alice -X PUT -H 'OCS-APIRequest: true' -H 'Content-Type: application/json' \
  https://cloud.example/ocs/v2.php/apps/viewer/api/v1/config/volume \
  -d '{"value": 40}'

The endpoint takes JSON: value is a number or a boolean depending on the setting, and the framework doesn't cast a union from form data.

Checked on a fresh install and on one with the old viewer's installed_version 8.0.0, which occ upgrade updates to 9.0.0-dev.0.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

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

@skjnldsv

skjnldsv commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

Really not sure about this. Else we have to create an app folder again for viewer

@skjnldsv
skjnldsv requested review from susnux and removed request for sorbaugh October 9, 2026 10:41

@susnux susnux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure its a good thing we move more of viewer into lib.
Maybe rollback and make apps/viewer again a force enabled app to separate concerns here making it cleaner on where to put this.

@skjnldsv

Copy link
Copy Markdown
Member Author

I am not sure its a good thing we move more of viewer into lib. Maybe rollback and make apps/viewer again a force enabled app to separate concerns here making it cleaner on where to put this.

Maybe a minimal viewer app is necessary indeed. But this is also frustrating, there is no clean way to have libs register user settings without some php scafolding 😤😤

@skjnldsv
skjnldsv force-pushed the feature/viewer-settings branch 4 times, most recently from faa949b to 90f125e Compare October 10, 2026 18:35
@skjnldsv

Copy link
Copy Markdown
Member Author

@susnux, alright, done! I didn't use the provisioning api event-based approach in the end, I don't know, don't like it 🙈
I used the good old controller approach, like we do in Files.

@skjnldsv
skjnldsv force-pushed the feature/viewer-settings branch 2 times, most recently from 59ba09b to 3e5b699 Compare October 10, 2026 18:44
@skjnldsv
skjnldsv requested a review from susnux October 10, 2026 18:46
apps/viewer becomes a minimal, always enabled app again, the server side
of the viewer. It keeps the user's viewer settings the way the Files app
keeps its own: a UserConfig service listing the allowed keys, an OCS
endpoint to change one, and the settings handed to the viewer as initial
state. They are the slideshow delay, and the volume of videos and audio
and whether they start muted. Core keeps loading the viewer itself.

It is no longer an abandoned app to clean up after, and continues the
old app's versions at 9.0.0-dev.0, after 8.0.0 in 35.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
@skjnldsv
skjnldsv force-pushed the feature/viewer-settings branch from 3e5b699 to 5e9b016 Compare October 10, 2026 18:57
@skjnldsv
skjnldsv enabled auto-merge October 10, 2026 19:41

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adjust the speed (delay between images) of the autoplay feature

3 participants