fix(ui): keep the tab bar as wide as its tabs

This commit is contained in:
Zakk committed 2026-09-29 19:31:00 +10:00
1 parent 1a47e2ff8d
commit e19bf6f43f
2 files changed
+11 -1

No files matched your search

+9
View File
@@ -82,3 +82,12 @@ for (const path of ['dns?tab=cache', 'dns?tab=log', 'nodes?tab=list', 'flows?tab
test(`${path}: a table comes back from another tab at its final column widths`, async ({page}) => {
await switchBack(page, path);
});
// The bar is as wide as its tabs, not the row the panels share.
test('a tab bar keeps the width of its tabs', async ({page}) => {
await page.goto('/#/dns?tab=stats');
const bar = page.locator('.rp-tabbar').first();
await expect(bar).toBeVisible();
const [barWidth, rowWidth] = await bar.evaluate(el => [el.getBoundingClientRect().width, el.parentElement!.getBoundingClientRect().width]);
expect(barWidth).toBeLessThan(rowWidth / 2);
});
+2 -1
View File
@@ -9,7 +9,8 @@
.rp-tabbar {
position: relative;
display: inline-flex;
align-self: flex-start;
/* A grid item: justify-self keeps the bar as wide as its tabs instead of the row. */
justify-self: start;
max-width: 100%;
/* More tabs than a phone is wide scroll within the bar, not the page; the slider scrolls with them. */
overflow-x: auto;