Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
fix(dashboard): drop the phone bar offset from the 768px chat page
Yudhi Armyndharis01546ee2ff0e
diff --git a/dashboard/src/pages/Chats.css b/dashboard/src/pages/Chats.cssindex ac8730e10..f19f43f47 100644--- a/dashboard/src/pages/Chats.css+++ b/dashboard/src/pages/Chats.css@@ -3351,11 +3351,15 @@}}-@media (max-width: 768px) {+/* The phone shell's 3.5rem bar is drawn under Layout's MOBILE_QUERY, (max-width: 767px), and so is taken off here: at+ 768px the page is single pane (below) but has no bar above it, and taking it off left an empty strip. */+@media (max-width: 767px) {.chats-page {height: calc(100dvh - 3.5rem);}+}+@media (max-width: 768px) {/* Single-pane on mobile: the list and the open conversation each take the full panelinstead of being squeezed into one short stacked column. */.chats-page .chats-sidebar {@@ -3390,10 +3394,11 @@/* Between the mobile breakpoint and 889px the two-pane layout leaves the room narrower than the composeronce the list takes its 300px minimum beside the 260px navigation, so the send button fell outside thepanel's clip with no scrollbar to recover it. In that band the panes swap one at a time instead, the way- they already do on a phone. Bounded on both sides on purpose: at 768px and below the mobile shell owns the- layout, and from 890px the room fits the composer again. Keyed to the navigation as well as the viewport,- because that arithmetic only holds while the nav is expanded; collapsed it already fits and none of this- should apply. `.main-content.expanded` is Layout's class for the COLLAPSED nav. */+ they already do on a phone. Bounded on both sides on purpose: at 768px and below the single-pane rules+ above apply whatever the navigation, and from 890px the room fits the composer again. Keyed to the+ navigation as well as the viewport, because that arithmetic only holds while the nav is expanded; collapsed+ it already fits and none of this should apply. `.main-content.expanded` is Layout's class for the COLLAPSED+ nav. */@media (min-width: 769px) and (max-width: 889px) {.main-content:not(.expanded) .chats-page .chats-sidebar {width: 100%;diff --git a/dashboard/src/pages/Chats.css.test.ts b/dashboard/src/pages/Chats.css.test.tsindex 8d204a7ad..bd6b1cc01 100644--- a/dashboard/src/pages/Chats.css.test.ts+++ b/dashboard/src/pages/Chats.css.test.ts@@ -71,3 +71,12 @@ test('the session picker is capped by the list column, so the layout never clipsassert.equal(declared('.chats-page .session-picker', 'overflow'), 'hidden');assert.equal(declared('.chats-page .session-picker-list', 'overflow-y'), 'auto');});++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];+ assert.ok(mobile, 'Layout.tsx no longer names its phone query');+ const offset = /@media ([^{]+)\{\s*\.chats-page\s*\{\s*height:\s*calc\(100dvh - 3\.5rem\)/.exec(css);+ assert.ok(offset, 'the page no longer takes the phone bar off its height');+ assert.equal(offset[1].trim(), mobile);+});