Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(dashboard): scroll a pinned Plugins rail taller than the window

Yudhi Armyndharis207d7a7f2bcd
diff --git a/dashboard/src/pages/Plugins.css b/dashboard/src/pages/Plugins.css
index a9915ecc2..8a4e96a81 100644
--- a/dashboard/src/pages/Plugins.css
+++ b/dashboard/src/pages/Plugins.css
@@ -630,6 +630,10 @@
flex: 0 0 280px;
position: sticky;
top: 1.5rem;
+ /* Pinned, so never taller than the window less its 1.5rem offset: a longer list scrolls inside the rail. */
+ max-height: calc(100vh - 3rem);
+ max-height: calc(100dvh - 3rem);
+ overflow-y: auto;
display: flex;
flex-direction: column;
gap: 1.25rem;
@@ -820,6 +824,8 @@
flex-basis: auto;
width: 100%;
position: static;
+ max-height: none;
+ overflow-y: visible;
}
}
diff --git a/dashboard/src/pages/Plugins.responsive.test.ts b/dashboard/src/pages/Plugins.responsive.test.ts
index 623eb3495..28a3c666d 100644
--- a/dashboard/src/pages/Plugins.responsive.test.ts
+++ b/dashboard/src/pages/Plugins.responsive.test.ts
@@ -56,3 +56,23 @@ test('the status rail stacks above the cards before the card column gets too nar
const width = Number(/max-width: (\d+)px/.exec(stacked[0].media)?.[1]);
assert.ok(width >= 950, `the rail stacks at ${stacked[0].media || 'every width'}`);
});
+
+// The side-by-side rail is pinned with position: sticky. A rail taller than the window (about 17 enabled plugins in a
+// 650px window) stayed pinned with its lower entries below the fold at every scroll position, so it is bounded by the
+// window and scrolls inside itself; stacked above the cards it flows with the page again.
+const RAIL = '.plugins-page .plugins-rail';
+
+test('the pinned status rail is bounded by the window and scrolls inside itself', () => {
+ const rail = rules.find(r => !r.media && r.selectors.includes(RAIL));
+ assert.ok(rail, 'no base rail rule');
+ const heights = [...rail.body.matchAll(/max-height\s*:\s*([^;]+)/g)].map(m => m[1].trim());
+ assert.deepEqual(heights, ['calc(100vh - 3rem)', 'calc(100dvh - 3rem)']);
+ assert.equal(decl(rail.body, 'overflow-y'), 'auto');
+});
+
+test('the stacked rail is not bounded', () => {
+ const stacked = rules.find(r => r.media === '@media (max-width: 950px)' && r.selectors.includes(RAIL));
+ assert.ok(stacked, 'no stacked rail rule');
+ assert.equal(decl(stacked.body, 'max-height'), 'none');
+ assert.equal(decl(stacked.body, 'overflow-y'), 'visible');
+});