From 3937f1f1275279f665de802fa26ac6e52f802ce9 Mon Sep 17 00:00:00 2001 From: silver Date: Mon, 26 Oct 2026 12:45:08 +0100 Subject: [PATCH 1/3] fix(menu): make component actions work from the remaining actions menu Signed-off-by: silver Assisted-by: ClaudeCode:claude-opus-5.5 --- src/components/Menu/MenuBar.vue | 17 +++++++++++++---- src/components/Menu/entries.ts | 5 +---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/components/Menu/MenuBar.vue b/src/components/Menu/MenuBar.vue index 372e86c90c2..130da486758 100644 --- a/src/components/Menu/MenuBar.vue +++ b/src/components/Menu/MenuBar.vue @@ -156,10 +156,15 @@ export default { computed: { visibleEntryKeys() { // if entry has no priority, we assume it always will be visible (priority: 0) - return this.entries + const keys = this.entries .toSorted((a, b) => (a.priority ?? 0) - (b.priority ?? 0)) .map((e) => e.key) .slice(0, this.iconsLimit) + if (this.forcedEntryKey && !keys.includes(this.forcedEntryKey)) { + // Make room for the entry that was opened from the remaining actions + keys.splice(-1, 1, this.forcedEntryKey) + } + return keys }, visibleEntries() { // only entries from `visibleEntryKeys but in original order @@ -174,14 +179,18 @@ export default { }) const entries = remainingEntries.reduce((acc, entry, index) => { // If entry has children, merge them into list. Otherwise keep entry itself. - const children = entry.children ?? [entry] + // Entries rendered by their own component cannot run inside the list, + // so they are moved into the menu bar and opened there. + const children = entry.children ?? [entry.component + ? { ...entry, click: () => this.openRemainingEntry(entry.key) } + : entry] // If this block has menu entries, it should be separated for better visibility and a11y (menu item radio grouping) if (children.length > 1) { const hasPreviousItem = acc.length && !acc.at(-1).isSeparator const separatorBefore = hasPreviousItem ? [ { - key: `separator-before-${entry.id}`, + key: `separator-before-${entry.key}`, isSeparator: true, }, ] @@ -189,7 +198,7 @@ export default { const hasNextItem = index !== remainingEntries.length - 1 const separatorAfter = hasNextItem - ? [{ key: `separator-after-${entry.id}`, isSeparator: true }] + ? [{ key: `separator-after-${entry.key}`, isSeparator: true }] : [] return [ diff --git a/src/components/Menu/entries.ts b/src/components/Menu/entries.ts index 5a6b507c3a3..ed35e23ab2b 100644 --- a/src/components/Menu/entries.ts +++ b/src/components/Menu/entries.ts @@ -508,10 +508,7 @@ export const getMenuEntries = (isRichWorkspace: boolean): MenuEntry[] => { component: ActionAttachmentUpload, priority: 5, }, - ] - - if (!isMobileDevice) { - menuEntries.push({ + { key: 'emoji-picker', label: t('text', 'Insert emoji'), icon: Emoticon, From 5821811bbb61fcf06db00ffbc1aa44406f3da8ab Mon Sep 17 00:00:00 2001 From: silver Date: Mon, 26 Oct 2026 13:00:19 +0100 Subject: [PATCH 2/3] chore(tests): add tests Signed-off-by: silver Assisted-by: ClaudeCode:claude-opus-5.5 [skip ci] --- playwright/e2e/mobile.spec.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/playwright/e2e/mobile.spec.ts b/playwright/e2e/mobile.spec.ts index 4e030421ef2..91746192e52 100644 --- a/playwright/e2e/mobile.spec.ts +++ b/playwright/e2e/mobile.spec.ts @@ -23,3 +23,33 @@ test('Formatting help', async ({ editor }) => { await editor.formattingHelp.getByLabel('Close').click() await expect(editor.formattingHelp).not.toBeVisible() }) + +test.describe('Actions with their own menu in remaining actions', () => { + test.beforeEach(async ({ page }) => { + // Narrow enough to move link, attachment and emoji into the remaining actions + await page.setViewportSize({ width: 280, height: 640 }) + }) + + test('Insert emoji', async ({ editor }) => { + await editor.clickMenu('Remain', 'Insert emoji') + const picker = editor.el.getByRole('dialog', { name: 'Emoji picker' }) + await expect(picker).toBeVisible() + const search = picker.getByRole('textbox', { name: 'Search' }) + await search.fill('cat') + await expect(picker.getByLabel('🐱, cat')).toHaveClass(/emoji-mart-emoji-selected/) + await search.press('Enter') + await expect(editor.content).toContainText('🐱') + await expect(editor.content).not.toContainText('undefined') + }) + + test('Insert attachment', async ({ editor }) => { + await editor.clickMenu('Remain', 'Insert attachment') + await expect(editor.getMenuItem('Upload from computer')).toBeVisible() + await expect(editor.getMenuItem('Insert from Files')).toBeVisible() + }) + + test('Insert link', async ({ editor }) => { + await editor.clickMenu('Remain', 'Insert link') + await expect(editor.getMenuItem('Link to website')).toBeVisible() + }) +}) From 1ed693736a66b7f7e26b17ebf7f7973727a85abf Mon Sep 17 00:00:00 2001 From: silver Date: Tue, 27 Oct 2026 11:05:11 +0100 Subject: [PATCH 3/3] fix(backport): add the missing changes Signed-off-by: silver Assisted-by: ClaudeCode:claude-opus-5.5 --- playwright/e2e/mobile.spec.ts | 14 ++++++++--- src/components/Menu/ActionList.vue | 2 +- src/components/Menu/BaseActionEntry.js | 27 +++++++++++--------- src/components/Menu/MenuBar.vue | 34 +++++++++++++++++++++++--- src/components/Menu/entries.ts | 5 ++-- 5 files changed, 60 insertions(+), 22 deletions(-) diff --git a/playwright/e2e/mobile.spec.ts b/playwright/e2e/mobile.spec.ts index 91746192e52..aed8f1b6cb6 100644 --- a/playwright/e2e/mobile.spec.ts +++ b/playwright/e2e/mobile.spec.ts @@ -27,7 +27,7 @@ test('Formatting help', async ({ editor }) => { test.describe('Actions with their own menu in remaining actions', () => { test.beforeEach(async ({ page }) => { // Narrow enough to move link, attachment and emoji into the remaining actions - await page.setViewportSize({ width: 280, height: 640 }) + await page.setViewportSize({ width: 240, height: 640 }) }) test('Insert emoji', async ({ editor }) => { @@ -36,7 +36,9 @@ test.describe('Actions with their own menu in remaining actions', () => { await expect(picker).toBeVisible() const search = picker.getByRole('textbox', { name: 'Search' }) await search.fill('cat') - await expect(picker.getByLabel('🐱, cat')).toHaveClass(/emoji-mart-emoji-selected/) + await expect(picker.getByLabel('🐱, cat')).toHaveClass( + /emoji-mart-emoji-selected/, + ) await search.press('Enter') await expect(editor.content).toContainText('🐱') await expect(editor.content).not.toContainText('undefined') @@ -49,7 +51,13 @@ test.describe('Actions with their own menu in remaining actions', () => { }) test('Insert link', async ({ editor }) => { - await editor.clickMenu('Remain', 'Insert link') + await editor.getMenu('Remain').click() + // Insert link toggles with the link mark, so depending on the version of + // @nextcloud/vue it is rendered as a checkbox + await editor + .getMenuItem('Insert link') + .or(editor.el.getByRole('menuitemcheckbox', { name: 'Insert link' })) + .click() await expect(editor.getMenuItem('Link to website')).toBeVisible() }) }) diff --git a/src/components/Menu/ActionList.vue b/src/components/Menu/ActionList.vue index e7820e60883..b17185309cd 100644 --- a/src/components/Menu/ActionList.vue +++ b/src/components/Menu/ActionList.vue @@ -22,7 +22,7 @@