nextcloud / nextcloud/viewer

[RFC] Viewer 4.0 API

Open
#2,395 25 comments 3 reactions 1 assignee View on GitHub

@skjnldsv is already working on this.

Since Sep 29, 2025.

1. to develop discussion enhancement technical debt
Dominant language
JavaScript
Stars
119
Forks
72
Avg merge
18h 42m
Merged PRs (30d)
24

Description

Let's discuss and plan the new Viewer handling.
cc @juliushaertl @susnux @R0Wi @ariselseng @artonge @max-nextcloud

Challenges

With the new Files app and the new Files/Folder/Node API, we finally have a proper and official way of dealing with files
It's time to re-draft the Viewer and clean the various issues we encountered over the last years

Requirements

Viewer
  • The Viewer is a component that can mount itself within a Modal to render a single or an array of Files
  • The Viewer can also be requested to be mounted within a specified div to render a single file only. In that case there would be no interaction possible (zooming, slideshow, editing, actions.... are disabled)
  • The Viewer can also be used to render two files next to each others, to compare them
Handlers

Apps can register their own views, called "Handlers"
A handler provide the following

  • A unique id
  • A display name
  • A render function to process the current file
  • A open function to change the node while keeping the handler mounted
  • A toggle function to show/hide the handler (for preloading, like videos or images)
    ❓ Is this still the right approach?
  • A condition to which the handler would work for the provided file (true/false)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.