-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(NcAppContent): don't remove list when showing details in mobile or no-split mode #6261
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6261 +/- ##
==========================================
- Coverage 42.50% 42.27% -0.23%
==========================================
Files 156 157 +1
Lines 4028 4040 +12
Branches 1036 1052 +16
==========================================
- Hits 1712 1708 -4
- Misses 2200 2217 +17
+ Partials 116 115 -1 ☔ View full report in Codecov by Sentry. |
@@ -67,9 +67,9 @@ The list size must be between the min and the max width value. | |||
'app-content-wrapper--show-list': !showDetails, | |||
'app-content-wrapper--mobile': isMobile,}"> | |||
<NcAppDetailsToggle v-if="showDetails" @click.native.stop.prevent="hideDetails" /> | |||
<slot v-if="!showDetails" name="list" /> | |||
<slot v-show="!showDetails" name="list" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v-show
is a node directive, it sets display: none
on the node. While <slot>
is not a node. It is a special tag specifying a place to execute a content render function.
Using v-show
on <slot>
is not possible in both Vue 2 and Vue 3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I understand. So it simply ignored the v-show part during my tests and worked like before 8.10.0, because hiding is done with this css, as I can see now.
.app-content-wrapper--no-split {
&.app-content-wrapper--show-list :deep() {
.app-content-list {
display: flex;
}
.app-content-details {
display: none;
}
}
&.app-content-wrapper--show-details :deep() {
.app-content-list {
display: none;
}
.app-content-details {
display: block;
}
}
}
But why the change to remove the list here completely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just wrap the <slot>
inside of a <div>
and put the v-show
directive on that instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wofferl I have also been playing around with allowing horizontal-split
in the NcAppContent
component when in mobile mode.
It would require adding another parameter mobileLayout
that we could use in the news app to show the feed item content below the list. This would also fix the weird behavior of the unread feed list always removing the article you just opened when you return to the list.
I'll try to get some PRs out this weekend if I have time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
created the nextcloud-vue PR here: #6364
I will try to create the nextcloud one that depends later this weekend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heres a link to the branch I will be creating the PR from: https://github.com/nextcloud/news/compare/master...devlinjunker:news:improve-mobile?expand=1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just wrap the
<slot>
inside of a<div>
and put thev-show
directive on that instead?
@devlinjunker
Unfortunately, I have not yet received an answer either here or in #6204 as to why the list is removed with v-if at all, but you're right <div v-show="...">
should work.
d82dbf3
to
c2832fa
Compare
…r no-split mode Signed-off-by: Wolfgang <[email protected]>
c2832fa
to
0bffe7b
Compare
hi, sorry for the late reply, i wrote on our frontend talk room, so more people are involved to get a decision. |
☑️ Resolves
As mentioned in #6204 the change in 8.10.0 causes the item list to rebuild every time the details of an item are shown.
With a dynamic list like in the news app, where read items are removed from the list when refreshing it, this means that the selected item you looked at the details are gone immediately when you close the details.
It also affects the performance, because of the rebuilding when closing the details, which is notable on mobile devices.
I think there is no technical reason to delete it, so it is better to just hide the list.