-
Notifications
You must be signed in to change notification settings - Fork 12
Description
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:
- Refactor the viewer app similar like this library:
- allow to register mime types in an
initscript without the viewer app needed to be loaded yet
- Allow to update actions by emitting e.g.
files:actions:updatedevent to force recreate the enabled actions - Allow to update actions by making them classes with
updatedevent 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.