feat(sidebar): provide public API to register a sidebar tab#1305
feat(sidebar): provide public API to register a sidebar tab#1305
Conversation
| * | ||
| * @param active - The new active state of this tab | ||
| */ | ||
| setActive: (active: boolean) => void | Promise<void> |
There was a problem hiding this comment.
So, we've been using events lately since you introduced them :)
Maybe it's time to make it a common pattern at Nextcloud?
There was a problem hiding this comment.
But this is the opposite direction - currently this is used by the sidebar to notify a tab that is was "navigated to".
So that it could e.g. refresh its content.
| * The lifecycle method for unmounting the sidebar tab. | ||
| * This is called if the sidebar is unmounted from the files app and thus the sidebar tab needs to do its cleanup and unmounting. | ||
| */ | ||
| unmount: () => void | Promise<void> |
There was a problem hiding this comment.
destroy maybe? I think unmounting is an odd edge case. We should maybe be clearer and let devs know the sidebar is actually destroyed.
There was a problem hiding this comment.
would work for me - no strong opinion. I just used the names of the Vue lifecyles (mount and unmount).
But it could also be that the tab is only unmounted but the sidebar is not destroyed (e.g. the current node is changed to something this tab is not enabled for).
This replaces the legacy `OCA.Files.Sidebar`. It also allows to define the order of the tab to prevent diffent order depending on the localized name like with the legacy tabs. Signed-off-by: Ferdinand Thiessen <[email protected]>
ccf8eb7 to
3124c4e
Compare
susnux
left a comment
There was a problem hiding this comment.
Question about this:
- keep this approach
- use web components as we do for workflowengine and files_sharing?
Just to align on a common API pattern :)
This. |
|
@skjnldsv thank you for confirmation! :) |
This replaces the legacy
OCA.Files.Sidebar.It also allows to define the order of the tab to prevent different order depending on the localized name like with the legacy tabs.
We probably need to support both in the files app for at least one version as we too short on the feature freeze - but at least this allows to properly use the
NodeAPI from this library inside tabs - instead of the oldFileInfomodel.