Skip to content

Commit e983d57

Browse files
committed
fix(ui): keep side panel tab labels visible
Restore the block-axis padding reset lost in #125368 so Web Awesome tab labels remain vertically legible while retaining logical inline spacing. Add LTR and RTL browser geometry coverage for the visible label boundary.
1 parent b5b17c6 commit e983d57

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

‎ui/src/e2e/chat-sidebar-panel-contract.e2e.test.ts‎

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,14 +301,25 @@ suite.define(() => {
301301
panel.dir = dir;
302302
const tabBase = node.shadowRoot?.querySelector<HTMLElement>("[part~='base']");
303303
const leadingGlyph = node.querySelector<HTMLElement>(".tabstrip-tab__icon svg");
304+
const label = node.querySelector<HTMLElement>(".tabstrip-tab__label");
305+
const labelClipper = node.querySelector<HTMLElement>(".tabstrip-tab__tooltip-trigger");
304306
const close = node.nextElementSibling;
305307
const trailingGlyph = close?.querySelector<HTMLElement>("svg");
306-
if (!(close instanceof HTMLElement) || !tabBase || !leadingGlyph || !trailingGlyph) {
307-
throw new Error("Active side-panel tab must render both edge glyphs");
308+
if (
309+
!(close instanceof HTMLElement) ||
310+
!tabBase ||
311+
!leadingGlyph ||
312+
!label ||
313+
!labelClipper ||
314+
!trailingGlyph
315+
) {
316+
throw new Error("Active side-panel tab must render its label and both edge glyphs");
308317
}
309318
const tabBounds = tabBase.getBoundingClientRect();
310319
const closeBounds = close.getBoundingClientRect();
311320
const leadingBounds = leadingGlyph.getBoundingClientRect();
321+
const labelBounds = label.getBoundingClientRect();
322+
const labelClipperBounds = labelClipper.getBoundingClientRect();
312323
const trailingBounds = trailingGlyph.getBoundingClientRect();
313324
const rtl = dir === "rtl";
314325
const tabStyle = getComputedStyle(tabBase);
@@ -320,6 +331,8 @@ suite.define(() => {
320331
trailing: rtl
321332
? trailingBounds.left - closeBounds.left
322333
: closeBounds.right - trailingBounds.right,
334+
labelBlockStartInset: labelBounds.top - labelClipperBounds.top,
335+
labelBlockEndInset: labelClipperBounds.bottom - labelBounds.bottom,
323336
tabOuterRadius: Number.parseFloat(
324337
rtl ? tabStyle.borderTopRightRadius : tabStyle.borderTopLeftRadius,
325338
),
@@ -335,6 +348,14 @@ suite.define(() => {
335348
};
336349
}, direction);
337350
expect(tabPadding.trailing, `${direction} glyph insets`).toBeCloseTo(tabPadding.leading, 0);
351+
expect(
352+
tabPadding.labelBlockStartInset,
353+
`${direction} label block-start containment`,
354+
).toBeGreaterThanOrEqual(0);
355+
expect(
356+
tabPadding.labelBlockEndInset,
357+
`${direction} label block-end containment`,
358+
).toBeGreaterThanOrEqual(0);
338359
expect(tabPadding.tabJoinRadius, `${direction} tab join`).toBe(0);
339360
expect(tabPadding.closeJoinRadius, `${direction} close join`).toBe(0);
340361
expect(tabPadding.tabOuterRadius, `${direction} tab outer`).toBeGreaterThan(0);

‎ui/src/styles/chat/sidebar.css‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ openclaw-chat-sidebar-region,
427427
align-items: center;
428428
justify-content: flex-start;
429429
gap: 7px;
430+
padding-block: 0;
430431
padding-inline: 8px 0;
431432
border: 0;
432433
border-radius: var(--radius-md);

0 commit comments

Comments
 (0)