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

feat(NcAppNavigationItem): Add prop to show collapse icon #5940

Closed
wants to merge 1 commit into from

Conversation

Pytal
Copy link
Contributor

@Pytal Pytal commented Aug 8, 2024

☑️ Resolves

Adds opt-in showCollapse to override internal collapsible state

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable
  • 3️⃣ Backport to next requested with a Vue 3 upgrade

Signed-off-by: Christopher Ng <chrng8@gmail.com>
@Pytal Pytal added enhancement New feature or request 3. to review Waiting for reviews feature: app-navigation Related to the app-navigation component labels Aug 8, 2024
@Pytal Pytal added this to the 8.17.0 milestone Aug 8, 2024
@Pytal Pytal self-assigned this Aug 8, 2024
@Pytal Pytal enabled auto-merge August 8, 2024 04:09
@susnux
Copy link
Contributor

susnux commented Aug 8, 2024

What is the use case? So when do you want collapsible behavior but not the toggle?
Because if you want only children you can remove the allow-collapse prop.

Having a collapsible item without toggle seems very inconsistent to me and should probably go through a design decision so we do not end up with inconsistent app navigation design.
Also this makes discovering the collapsible feature much harder.
cc @nextcloud-libraries/designers

@sorbaugh
Copy link

sorbaugh commented Aug 8, 2024

What is the use case? So when do you want collapsible behavior but not the toggle? Because if you want only children you can remove the allow-collapse prop.

Having a collapsible item without toggle seems very inconsistent to me and should probably go through a design decision so we do not end up with inconsistent app navigation design. Also this makes discovering the collapsible feature much harder. cc @nextcloud-libraries/designers

cc @jancborchardt would this be a blocker to you?

Copy link
Contributor

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

Fully agree with @susnux. What’s the use-case for this? Otherwise it seems like an unnecessary prop.

@susnux
Copy link
Contributor

susnux commented Aug 8, 2024

To me it seems the use case should be:
if a files view is not yet loaded, do not show the sub views in the navigation.

I think is quite an edge case and adding a prop for that will lead to inconsistency, because people will misuse it.

But there are some other options:

  1. Let the component respect open=false even when allow-collapse is set to false -> will be the same behavior as with this prop here.
  2. Or simply do not render the list while the view is loading (see my comment here https://github.com/nextcloud/server/pull/47122/files?diff=unified&w=0#r1709647015 )

@Pytal
Copy link
Contributor Author

Pytal commented Aug 8, 2024

The use case is showing the collapse icon even when there are no children in the default slot yet so the user can click expand which triggers loading of the children

  1. Let the component respect open=false even when allow-collapse is set to false -> will be the same behavior as with this prop here.

I think this sounds like the same as showCollapse as this would also need a new prop to force this and without a prop it would break existing design and show the collapse icon everywhere by default

Maybe we could name it forceShowCollapse?

@susnux
Copy link
Contributor

susnux commented Aug 8, 2024

The use case is showing the collapse icon even when there are no children in the default slot yet so the user can click expand which triggers loading of the children

But this is already possible? You do not need a prop for this, you just need to make sure the slot is available, like:

<NcAppNavigationItem ...>
    <template>
        <li style="display: none"></li>
    </template>
</NcAppNavigationItem>

@Pytal
Copy link
Contributor Author

Pytal commented Aug 8, 2024

But this is already possible? You do not need a prop for this, you just need to make sure the slot is available, like:

<NcAppNavigationItem ...>
    <template>
        <li style="display: none"></li>
    </template>
</NcAppNavigationItem>

Sure can do it this way! Still seems like more of a hack than showCollapse imo 🙈

@Pytal Pytal closed this Aug 8, 2024
auto-merge was automatically disabled August 8, 2024 17:49

Pull request was closed

@Pytal Pytal deleted the feat/nav-item-collapse-icon branch August 8, 2024 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request feature: app-navigation Related to the app-navigation component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants