From 0a290de2296f02108f0882aaa56a0815ff46a6a2 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Thu, 1 Oct 2026 23:12:10 +0200 Subject: [PATCH] Channel menu: Send message to channel opens the side chat ready to type Co-Authored-By: Claude Opus 5.5 --- src/lib/actions.ts | 3 ++- test/e2e/app.e2e.ts | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lib/actions.ts b/src/lib/actions.ts index 9139946..443a70d 100644 --- a/src/lib/actions.ts +++ b/src/lib/actions.ts @@ -39,7 +39,8 @@ export function channelMenu(c: Channel): MenuItem[] { return [ { header: true, label: c.name || 'Root' }, { label: here ? 'You are here' : 'Join channel', action: () => session.joinChannel(c.id), disabled: here || !c.canEnter }, - { label: 'Open chat', action: () => { session.showChannel(c.id, 'chat'); ui.panelOpen = true; } }, + // Opens the channel's chat in the side panel, ready to type, without joining it + { label: 'Send message to channel', action: () => { session.showChannel(c.id, 'chat'); ui.panelOpen = true; } }, { label: 'Show description', action: () => { session.showChannel(c.id, 'info'); ui.panelOpen = true; } }, { separator: true, label: '' }, { label: session.isExpanded(c.id) ? 'Collapse' : 'Expand', action: () => session.toggleExpanded(c.id), disabled: c.id === 0 }, diff --git a/test/e2e/app.e2e.ts b/test/e2e/app.e2e.ts index 7413c5c..1ac4beb 100644 --- a/test/e2e/app.e2e.ts +++ b/test/e2e/app.e2e.ts @@ -716,7 +716,15 @@ try { await page.locator('.channel .name', { hasText: 'Lobby' }).click({ button: 'right' }); await page.getByRole('menuitem', { name: 'Join channel' }).click(); await page.locator('.me .who span', { hasText: 'Lobby' }).waitFor(); - console.log('ok: channel context menu joins'); + // Messaging a channel from its menu opens the side chat, ready to type, without joining + await page.locator('.channel .name', { hasText: 'Games' }).click({ button: 'right' }); + await page.getByRole('menuitem', { name: 'Send message to channel' }).click(); + const sideInput = page.locator('.panel .composer [contenteditable]'); + await sideInput.waitFor(); + assert.equal(await sideInput.getAttribute('data-placeholder'), 'Message #Games'); + await page.waitForFunction(() => document.activeElement === document.querySelector('.panel .composer [contenteditable]'), null, { timeout: 3000 }); + await page.locator('.me .who span', { hasText: 'Lobby' }).waitFor(); + console.log('ok: channel context menu joins, and messages a channel from the side chat'); // Side panel can be resized by dragging its left edge const panelBox = (await page.locator('aside.panel').boundingBox())!;