feat(NcAppSidebar): Add subname
slot
#5285
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
☑️ Resolves
This adds a
subname
slot for the same purpose as thesubname
prop, but this allows more advanced usage.My use case: Add an icon with alt text / aria label.
Nextcloud files does not use the
starred
button anymore (design decision) but simply an action menu entry + an ⭐ icon on the subname.The problem is that the star icon (just a unicode symbol) is not announced by screen readers, so we need some accessible alternative. Fixed by allowing inline content as the slot content.
To implement this I also added an
inline
prop to the SVG icon wrapper to allow it to render icons inline (this is BTW something I really often saw people "hack" into the component usingdeep
selectors to get rid of themin-width
andmin-height
).🖼️ Screenshots
Inline icon:
App sidebar:
🏁 Checklist
next
requested with a Vue 3 upgrade