nextcloud-files icon indicating copy to clipboard operation
nextcloud-files copied to clipboard

feat(navigation): allow updating views

Open skjnldsv opened this issue 6 months ago • 7 comments

Use-case example:

SearchView.update({
	emptyCaption: t('files', 'No results found for "{searchText}"', { searchText }),
})

skjnldsv avatar Jul 03 '25 09:07 skjnldsv

Not sure, if its not better to let the view itself update

What do you mean ?

Also there needs to be a way to detect the update

I can emit an updated event sure.

skjnldsv avatar Jul 03 '25 10:07 skjnldsv

this only works currently with vue 2 reactivity

Fixed

skjnldsv avatar Jul 03 '25 10:07 skjnldsv

Basically the question is what do we want the view to be. Just a state-less data exchange as it is currently or to be state-full.

For most views this is not really necessary, but some like the folder tree or the search view are more or less stateful.

If we want to allow the view to have a state then the view should update itself and not need external update calls. Because then you need to track the view state externally.

susnux avatar Jul 03 '25 11:07 susnux

How do you suggest the view update itself ?

skjnldsv avatar Jul 03 '25 11:07 skjnldsv

Well it could just return another value for the field and emit an event if it changed internally, similar to #1067

susnux avatar Jul 03 '25 14:07 susnux

But I am also fine with this solution! I am just not sure if an evenbus event is the right type or if we should just use an native event like its done on the navigation.

susnux avatar Jul 03 '25 14:07 susnux

So, this was mostly useful for https://github.com/nextcloud/server/pull/53739

skjnldsv avatar Jul 29 '25 10:07 skjnldsv