Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(dashboard): close the zoomed-width gap at the single-pane band

Yudhi Armyndharis006e51ebfe26
diff --git a/dashboard/src/pages/Chats.css b/dashboard/src/pages/Chats.css
index e2342c482..f2934c3b6 100644
--- a/dashboard/src/pages/Chats.css
+++ b/dashboard/src/pages/Chats.css
@@ -3401,12 +3401,13 @@
/* Between the mobile breakpoint and 889px the two-pane layout leaves the room narrower than the composer
once the list takes its 300px minimum beside the 260px navigation, so the send button fell outside the
panel'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 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) {
+ they already do on a phone. From 890px the room fits the composer again. There is no lower bound: at 768px
+ and below these rules repeat the single-pane ones above, and a window zoomed to a width between 768 and
+ 769px, which neither a 768px maximum nor a 769px minimum matches, would get two panes too narrow for the
+ room. 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 (max-width: 889px) {
.main-content:not(.expanded) .chats-page .chats-sidebar {
width: 100%;
max-width: none;
diff --git a/dashboard/src/pages/Chats.css.test.ts b/dashboard/src/pages/Chats.css.test.ts
index d4616dda1..7eede8645 100644
--- a/dashboard/src/pages/Chats.css.test.ts
+++ b/dashboard/src/pages/Chats.css.test.ts
@@ -115,3 +115,11 @@ test('the room is never narrower than its composer, so the emoji button cannot s
// The list column is what gives way when the room needs the width.
assert.notEqual(value('.chats-page .chats-sidebar', 'flex-shrink'), '0');
});
+
+test('the band that swaps the panes beside the expanded navigation has no lower edge a zoomed width falls through', () => {
+ // With a 768px maximum below it, a 769px minimum left 768.5px, a zoomed width, matched by neither.
+ const band = /@media ([^{]+)\{\s*\.main-content:not\(\.expanded\) \.chats-page \.chats-sidebar\s*\{/.exec(css);
+ assert.ok(band, 'the band no longer swaps the panes beside the expanded navigation');
+ assert.doesNotMatch(band[1], /min-width/);
+ assert.match(band[1], /max-width:\s*889px/);
+});