Skip to content

Conversation

@juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented Aug 2, 2018

This should fix #10398. Once you switch to a different file list type like FavoritesFileList the detailsview element from the first file list has been removed from the DOM. Because of that it could not be shown when going back to the first file list.

The underlying reason is that the current files app layout is based on one DetailsView per file list, we should change that for 15 maybe, but I would not introduce such a change now, since it might cause even more breakage.

Edit: I have a branch that switches to use a single instance at 01f885e but as expected this will lead to various issues with the plugins that are registered for each file list.

Turns out, we simply can run render to make sure that the sidebar view is updated in the dom when updating the details view from the file list. Thanks @skjnldsv 👍

} else {
$('#app-sidebar').replaceWith(this.$el)
}
this.$el.insertAfter($('#app-content'));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that will lead to multiple divs with the same id of app-content, but I'd still keep it like this as a temporary fix, as it was like that before as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I fixed this before. The multiple content are not acceptable according to the acceptance tests, we removed all the old tests for this reason. I really think we should not do that.

Why the replacement of the sidebar with the new element does not work?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The replacement is only done once when loading the list for the first time, when you try to show the details view for a second time, after a different view has been used, it will not call render and therefore not replace it again. But maybe that is a good idea to just make sure it gets replaced on each opening of the details sidebar. I'll have a look.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about replacing ids or stuff like that?
#app-sidebar-favorites, when selected -> #app-sidebar

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was actually even easier: 16f6c07 I now just run the render function on every details sidebar change and just replace it if the element is from a different filelist.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!! Well done! 🎉 :)

@juliusknorr

This comment has been minimized.

@juliusknorr

This comment has been minimized.

@juliusknorr juliusknorr force-pushed the bugfix/10398/acceptance-files-changedir branch from de1c5da to 16f6c07 Compare August 3, 2018 09:49
@juliusknorr juliusknorr added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Aug 3, 2018
@juliusknorr juliusknorr changed the title Make all files DetailViews available in the DOM Always replace the app sidebar view when switching from a different file list Aug 3, 2018
Copy link
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works!

@juliusknorr
Copy link
Member Author

Some other acceptance test is failing, i'll investigate.

@juliusknorr juliusknorr force-pushed the bugfix/10398/acceptance-files-changedir branch from 744c2ad to 1b4d502 Compare August 3, 2018 12:06
@juliusknorr
Copy link
Member Author

juliusknorr commented Aug 3, 2018

Ok, I've adjusted the acceptance test to test for the original issue #1448 that the test was about. Moving to a single #app-sidebar container now allows to keep the sidebar open when we show the file in folder, since that is the default behavior when a file is highlighted in the list.

Failure at https://drone.nextcloud.com/nextcloud/server/9428/146 is unrelated.

Ready for review.

@skjnldsv
Copy link
Member

skjnldsv commented Aug 3, 2018

Wee, green acceptance tests!

@rullzer rullzer merged commit c623345 into master Aug 3, 2018
@rullzer rullzer deleted the bugfix/10398/acceptance-files-changedir branch August 3, 2018 13:10
@rullzer rullzer mentioned this pull request Aug 6, 2018
58 tasks
@MorrisJobke MorrisJobke added this to the Nextcloud 14 milestone Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opening details after coming from favorites view is broken

5 participants