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

[stable28] fix: Prioritize un-collapsible menubar entries for mobile and aggregate children in the hidden entries #5228

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/components/Menu/MenuBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,20 @@ export default {
return list
},
hiddenEntries() {
const entries = this.entries.filter(({ priority }) => {
// reverse logic from visibleEntries
return priority !== undefined && priority > this.iconsLimit
}).reduce((acc, entry) => {
// If entry has children, merge them into list. Otherwise keep entry itself.
const children = entry.children ?? [entry]
return [...acc, ...children]
}, [])

return {
key: 'remain',
label: this.t('text', 'Remaining actions'),
icon: DotsHorizontal,
children: this.entries.filter(({ priority }) => {
// reverse logic from visibleEntries
return priority !== undefined && priority > this.iconsLimit
}),
children: entries,
}
},
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/Menu/entries.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export default [
},
},
],
priority: 3,
priority: 6,
},
{
key: 'code-block',
Expand Down Expand Up @@ -340,13 +340,13 @@ export default [
action: (command, emojiObject = {}) => {
return command.emoji(emojiObject)
},
priority: 5,
priority: 3,
},
{
key: 'insert-attachment',
label: t('text', 'Insert attachment'),
icon: Images,
component: ActionAttachmentUpload,
priority: 4,
priority: 1,
},
]