Skip to content

[RFC] Viewer 4.0 API #2395

Open
Open
@skjnldsv

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)

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions