Channel menu: Send message to channel opens the side chat ready to type
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -39,7 +39,8 @@ export function channelMenu(c: Channel): MenuItem[] {
|
|||||||
return [
|
return [
|
||||||
{ header: true, label: c.name || 'Root' },
|
{ header: true, label: c.name || 'Root' },
|
||||||
{ label: here ? 'You are here' : 'Join channel', action: () => session.joinChannel(c.id), disabled: here || !c.canEnter },
|
{ 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; } },
|
{ label: 'Show description', action: () => { session.showChannel(c.id, 'info'); ui.panelOpen = true; } },
|
||||||
{ separator: true, label: '' },
|
{ separator: true, label: '' },
|
||||||
{ label: session.isExpanded(c.id) ? 'Collapse' : 'Expand', action: () => session.toggleExpanded(c.id), disabled: c.id === 0 },
|
{ label: session.isExpanded(c.id) ? 'Collapse' : 'Expand', action: () => session.toggleExpanded(c.id), disabled: c.id === 0 },
|
||||||
|
|||||||
+9
-1
@@ -716,7 +716,15 @@ try {
|
|||||||
await page.locator('.channel .name', { hasText: 'Lobby' }).click({ button: 'right' });
|
await page.locator('.channel .name', { hasText: 'Lobby' }).click({ button: 'right' });
|
||||||
await page.getByRole('menuitem', { name: 'Join channel' }).click();
|
await page.getByRole('menuitem', { name: 'Join channel' }).click();
|
||||||
await page.locator('.me .who span', { hasText: 'Lobby' }).waitFor();
|
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
|
// Side panel can be resized by dragging its left edge
|
||||||
const panelBox = (await page.locator('aside.panel').boundingBox())!;
|
const panelBox = (await page.locator('aside.panel').boundingBox())!;
|
||||||
|
|||||||
Reference in New Issue
Block a user