Skip to content

How to deal with updates (view, action)? #1302

@susnux

Description

@susnux

Currently if you have registered a view or an action (or list action) then you cannot update it while the file list is already rendered.
For normal usage this is often fine, but there are use cases.

Example for the Action update:

  • The viewer app register a file action
  • App register viewer mime types

If now the file list is rendered when the mimetype registration was not finished yet (can happen because of network delays), then that mime types cannot be opened with the viewer until the file list is updated.

From my perspective there are a couple of solutions:

  1. Refactor the viewer app similar like this library:
  • allow to register mime types in an init script without the viewer app needed to be loaded yet
  1. Allow to update actions by emitting e.g. files:actions:updated event to force recreate the enabled actions
  2. Allow to update actions by making them classes with updated event to only need to reevaluate this action (similar like we do with navigation)

I personally think that 3 is better than 2 because we do not need to reevaluate all actions for all files of the current folder.
It is consistent with how we handle navigations and only needs adjustments in the files app.

But solution 1 would be the overall best as this would only need a single file library to be published which we can later also reuse to finally get away from the magic OCA.Viewer globals. And maintenance would be quite easy as it would be just included within the viewer app itself, so nothing we need to really care about.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. to triage0️⃣ Needs triage - check if valid and reproducible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions