Skip to content

Commit 8d4ff67

Browse files
authored
fix(ui): align settings sidebar footer height (#130715)
Co-authored-by: roboclaw-bot <[email protected]>
1 parent 42e8444 commit 8d4ff67

3 files changed

Lines changed: 101 additions & 0 deletions

File tree

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
// Control UI sidebar footer tests cover cross-route layout parity.
2+
import { chromium, type Browser, type Page } from "playwright";
3+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
4+
import { readStyleSheet } from "../../../test/helpers/ui-style-fixtures.js";
5+
import {
6+
canRunPlaywrightChromium,
7+
resolvePlaywrightChromiumExecutablePath,
8+
} from "../test-helpers/control-ui-e2e.ts";
9+
10+
const chromiumExecutablePath = resolvePlaywrightChromiumExecutablePath(chromium.executablePath());
11+
const chromiumAvailable = canRunPlaywrightChromium(chromiumExecutablePath);
12+
const describeBrowserLayout = chromiumAvailable ? describe : describe.skip;
13+
14+
let browser: Browser;
15+
let page: Page;
16+
17+
function readUiCss(): string {
18+
return ["base.css", "components.css", "layout.css"]
19+
.map((file) => readStyleSheet(`ui/src/styles/${file}`))
20+
.join("\n");
21+
}
22+
23+
beforeAll(async () => {
24+
if (!chromiumAvailable) {
25+
return;
26+
}
27+
browser = await chromium.launch({ executablePath: chromiumExecutablePath, headless: true });
28+
page = await browser.newPage({ viewport: { width: 800, height: 400 } });
29+
});
30+
31+
afterAll(async () => {
32+
await page?.close().catch(() => {});
33+
await browser?.close().catch(() => {});
34+
});
35+
36+
describeBrowserLayout("sidebar footer layout", () => {
37+
it("keeps the settings footer the same height as the main sidebar footer", async () => {
38+
await page.setContent(`
39+
<!doctype html>
40+
<html data-theme-mode="light">
41+
<head>
42+
<style>${readUiCss()}</style>
43+
<style>
44+
.footer-layout-fixture {
45+
display: grid;
46+
grid-template-columns: 288px 288px;
47+
width: 576px;
48+
height: 180px;
49+
}
50+
.footer-layout-fixture > * {
51+
min-height: 0;
52+
}
53+
</style>
54+
</head>
55+
<body>
56+
<main class="shell footer-layout-fixture">
57+
<section class="sidebar-shell">
58+
<div class="sidebar-shell__content"></div>
59+
<div class="sidebar-shell__footer">
60+
<div class="sidebar-footer-bar">
61+
<div class="sidebar-agent-card">
62+
<button class="sidebar-agent-card__main" type="button">
63+
<span class="sidebar-agent-card__avatar"></span>
64+
<span class="sidebar-agent-card__name">Mason</span>
65+
</button>
66+
</div>
67+
<div class="sidebar-footer-actions">
68+
<button class="sidebar-brand__icon sidebar-footer-bar__custodian" type="button">
69+
Inbox
70+
</button>
71+
</div>
72+
</div>
73+
</div>
74+
</section>
75+
<aside class="settings-sidebar">
76+
<div class="sidebar-shell__content"></div>
77+
<footer class="settings-sidebar__footer">
78+
<openclaw-settings-save-indicator></openclaw-settings-save-indicator>
79+
<span class="sidebar-footer-build">2026.8.1 · git@5328856</span>
80+
</footer>
81+
</aside>
82+
</main>
83+
</body>
84+
</html>
85+
`);
86+
87+
const heights = await page.evaluate(() => ({
88+
main: document.querySelector(".sidebar-shell__footer")?.getBoundingClientRect().height,
89+
settings: document.querySelector(".settings-sidebar__footer")?.getBoundingClientRect().height,
90+
}));
91+
92+
expect(heights.main).toBeDefined();
93+
expect(heights.settings).toBeDefined();
94+
expect(heights.settings).toBeCloseTo(heights.main ?? 0, 2);
95+
});
96+
});

‎ui/src/styles/layout.css‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
--shell-chrome-controls-inset: 10px;
1111
--shell-chrome-control-size: 32px;
1212
--shell-chrome-controls-gap: 4px;
13+
/* Settings takeover and the main sidebar share the same bottom divider geometry. */
14+
--shell-sidebar-footer-height: 53px;
1315
--shell-native-titlebar-controls-inset: 92px;
1416
--shell-native-titlebar-controls-width: 156px;
1517
/* Collapsed navigation adds new-thread to the two persistent controls.
@@ -658,6 +660,7 @@ html.openclaw-native-web-chrome .shell-chrome-controls {
658660
flex-direction: column;
659661
align-items: stretch;
660662
gap: 8px;
663+
min-height: var(--shell-sidebar-footer-height);
661664
padding: 12px 21px;
662665
border-top: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
663666
font-size: calc(11.5px * var(--control-ui-text-scale));
@@ -1089,6 +1092,7 @@ openclaw-settings-save-indicator:empty {
10891092

10901093
.sidebar-shell__footer {
10911094
flex-shrink: 0;
1095+
min-height: var(--shell-sidebar-footer-height);
10921096
margin-inline: calc(-1 * var(--sidebar-pad-x));
10931097
padding: 4px var(--sidebar-pad-x) 0;
10941098
border-block-start: 1px solid color-mix(in srgb, var(--border) 55%, transparent);

‎ui/vitest.config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ const nodeDrivenBrowserLayoutTests = [
9999
"src/pages/chat/chat-responsive.browser.test.ts",
100100
"src/pages/chat/components/chat-swarm-progress.browser.test.ts",
101101
"src/components/form-controls.browser.test.ts",
102+
"src/components/sidebar-footer-layout.browser.test.ts",
102103
"src/pages/sessions/view.browser.test.ts",
103104
"src/styles/corner-shape.browser.test.ts",
104105
"src/styles/cursor-policy.browser.test.ts",

0 commit comments

Comments
 (0)