Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(dashboard): keep the chat room menu inside the room

Yudhi Armyndharis5bc9a975ece6
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fd1a40d1c..aee7e4e8c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -41,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Name the buttons that remove a staged file and close a reply above the dashboard chat composer for screen readers.
- Announce the unread badges on dashboard chat list rows to screen readers, including the dot of a chat marked as unread.
- Keep the reply, react and delete actions of dashboard chat messages visible beside each bubble on touch screens, which have no hover to reveal them.
+- Fit the dashboard chat room's menu to the room's height, scrolling its entries, so a short window no longer cuts off the last ones.
## [0.26.0] - 2026-10-28
diff --git a/dashboard/src/pages/Chats.css b/dashboard/src/pages/Chats.css
index da1803bc3..4af91deef 100644
--- a/dashboard/src/pages/Chats.css
+++ b/dashboard/src/pages/Chats.css
@@ -1730,6 +1730,8 @@
display: flex;
flex-direction: column;
height: 100%;
+ /* The room menu hangs from the room (see .room-menu-popover). */
+ position: relative;
}
.chats-page .room-header,
@@ -1817,14 +1819,17 @@
flex-shrink: 0;
}
-.chats-page .room-menu {
- position: relative;
-}
-
+/* The chat layout clips what runs past its bottom edge, so the menu is placed against the room rather than its button:
+ 6px under the button, which the 64px header centres (40px tall, 12px from the top), and at the button's end edge,
+ which the header's end padding, the contact panel button and the gap between them keep from the room's. Capped by
+ the room's height, the entries scroll inside it on a short window or a phone held sideways, as the session
+ picker's do. */
.chats-page .room-menu-popover {
position: absolute;
- top: calc(100% + 6px);
- inset-inline-end: 0;
+ top: calc(64px - 6px);
+ inset-inline-end: calc(0.75rem + 40px + 0.25rem);
+ max-height: calc(100% - 64px + 6px - 0.75rem);
+ overflow-y: auto;
z-index: 30;
min-width: 200px;
padding: 0.375rem;
diff --git a/dashboard/src/pages/Chats.css.test.ts b/dashboard/src/pages/Chats.css.test.ts
index 7eede8645..64c3ecceb 100644
--- a/dashboard/src/pages/Chats.css.test.ts
+++ b/dashboard/src/pages/Chats.css.test.ts
@@ -72,6 +72,29 @@ test('the session picker is capped by the list column, so the layout never clips
assert.equal(declared('.chats-page .session-picker-list', 'overflow-y'), 'auto');
});
+test('the room menu is capped by the room, so the layout never clips its last entries on a short window', () => {
+ // Hung from its button the menu had no cap, and at 740 by 360 it ran 190px past the layout's bottom edge.
+ const declared = (selector: string, property: string): string | undefined =>
+ rulesFor(selector)
+ .map(body => new RegExp(`(?:^|;)\\s*${property}:\\s*([^;]+)`).exec(body)?.[1].trim())
+ .filter(Boolean)
+ .pop();
+ assert.equal(declared('.chats-page .room-container', 'position'), 'relative');
+ assert.equal(declared('.chats-page .room-menu', 'position'), undefined, 'the menu button holds the menu');
+ assert.equal(declared('.chats-page .room-header', 'position'), undefined, 'the header holds the menu');
+ assert.equal(declared('.chats-page .room-menu-popover', 'position'), 'absolute');
+ assert.match(declared('.chats-page .room-menu-popover', 'max-height') ?? '', /^calc\(100% - /);
+ assert.equal(declared('.chats-page .room-menu-popover', 'overflow-y'), 'auto');
+ // Placed under the header and at the menu button's end edge: the header's end padding, the contact panel button
+ // and the gap between the two.
+ assert.equal(declared('.chats-page .room-header', 'height'), '64px');
+ assert.match(declared('.chats-page .room-header', 'padding-inline') ?? '', / 0\.75rem$/);
+ assert.equal(declared('.chats-page .room-header-actions', 'gap'), '0.25rem');
+ assert.equal(declared('.chats-page .icon-btn', 'width'), '40px');
+ assert.equal(declared('.chats-page .room-menu-popover', 'inset-inline-end'), 'calc(0.75rem + 40px + 0.25rem)');
+ assert.match(declared('.chats-page .room-menu-popover', 'top') ?? '', /^calc\(64px /);
+});
+
test('the page gives up the phone bar under the query that draws it, so 768px keeps its full height', () => {
const layout = readFileSync(join(here, '..', 'components', 'Layout.tsx'), 'utf8');
const mobile = /const MOBILE_QUERY = '([^']+)'/.exec(layout)?.[1];