Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wofferl
Copy link
Contributor

@wofferl wofferl commented Nov 23, 2024

☑️ 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.

Copy link

codecov bot commented Nov 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.27%. Comparing base (4c77334) to head (0bffe7b).
Report is 151 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

@@ -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" />
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link

@devlinjunker devlinjunker Jan 10, 2025

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?

Copy link

@devlinjunker devlinjunker Jan 10, 2025

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

Choose a reason for hiding this comment

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

here's a screen shot from my dev machine:
Screenshot 2025-01-10 at 10 49 12 AM

Copy link

@devlinjunker devlinjunker Jan 11, 2025

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

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@wofferl wofferl Jan 11, 2025

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?

@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.

@wofferl wofferl force-pushed the fix_appcontent_list branch from d82dbf3 to c2832fa Compare January 11, 2025 11:32
@wofferl
Copy link
Contributor Author

wofferl commented Feb 4, 2025

@GretaD @ShGKme Is there any information on this problem, whether the old behavior should be restored or whether it will remain as it is in the future.

@wofferl wofferl force-pushed the fix_appcontent_list branch from c2832fa to 0bffe7b Compare February 14, 2025 11:14
@GretaD
Copy link
Contributor

GretaD commented Feb 14, 2025

hi, sorry for the late reply, i wrote on our frontend talk room, so more people are involved to get a decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NcAppContent] list is rebuild every time when details were shown with no-split or mobile view
4 participants