Skip to content

Commit 81ce206

Browse files
authored
improve(control-ui): move dev branch badge to its own footer strip (#104300)
The sidebar footer icon row got crowded with the inline branch label. The dev-checkout branch now renders on a slim tinted strip above the icon bar with a git-branch icon, keeping the full name readable and the footer controls uncluttered.
1 parent f9ebefb commit 81ce206

3 files changed

Lines changed: 43 additions & 13 deletions

File tree

ui/src/components/app-sidebar.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1941,6 +1941,14 @@ class AppSidebar extends OpenClawLightDomContentsElement {
19411941
.soundsEnabled=${this.lobsterPetSounds}
19421942
.gatewayVersion=${this.gatewayVersion}
19431943
></openclaw-lobster-pet>
1944+
${this.devGitBranch
1945+
? html`<div class="sidebar-footer-branch" title=${this.devGitBranch}>
1946+
<span class="sidebar-footer-branch__icon" aria-hidden="true"
1947+
>${icons.gitBranch}</span
1948+
>
1949+
<span class="sidebar-footer-branch__name">${this.devGitBranch}</span>
1950+
</div>`
1951+
: nothing}
19441952
<div class="sidebar-footer-bar">
19451953
<openclaw-tooltip .content=${gatewayStatusTooltip}>
19461954
<span
@@ -1952,11 +1960,6 @@ class AppSidebar extends OpenClawLightDomContentsElement {
19521960
aria-label=${gatewayStatus}
19531961
></span>
19541962
</openclaw-tooltip>
1955-
${this.devGitBranch
1956-
? html`<span class="sidebar-footer-branch" title=${this.devGitBranch}
1957-
>${this.devGitBranch}</span
1958-
>`
1959-
: nothing}
19601963
<span class="sidebar-footer-bar__spacer"></span>
19611964
<openclaw-tooltip .content=${settingsTooltip}>
19621965
<a

ui/src/e2e/sidebar-dev-branch.e2e.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ describeControlUiE2e("Control UI sidebar dev branch badge E2E", () => {
5252

5353
const badge = page.locator(".sidebar-footer-branch");
5454
await badge.waitFor();
55-
await expect.poll(() => badge.textContent()).toBe(DEV_BRANCH);
55+
await expect
56+
.poll(() => badge.locator(".sidebar-footer-branch__name").textContent())
57+
.toBe(DEV_BRANCH);
5658
await expect.poll(() => badge.getAttribute("title")).toBe(DEV_BRANCH);
5759

5860
const colors = await badge.evaluate((element) => {

ui/src/styles/layout.css

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,20 +1735,45 @@ openclaw-session-menu[popover] {
17351735
flex: 1 1 auto;
17361736
}
17371737

1738-
/* Dev-checkout branch badge: only rendered when the gateway runs from a git
1739-
checkout off main, so operators notice non-release gateway code at a glance. */
1738+
/* Dev-checkout branch strip: only rendered when the gateway runs from a git
1739+
checkout off main. Sits on its own row above the icon bar so the full branch
1740+
name stays readable without crowding the footer controls. */
17401741
.sidebar-footer-branch {
1741-
flex: 0 1 auto;
1742+
display: flex;
1743+
align-items: center;
1744+
gap: 6px;
17421745
min-width: 0;
1743-
margin-left: 6px;
1744-
overflow: hidden;
1745-
text-overflow: ellipsis;
1746-
white-space: nowrap;
1746+
margin: 0 10px 2px;
1747+
padding: 2px 8px;
1748+
border-radius: var(--radius-sm);
1749+
background: color-mix(in srgb, var(--danger) 12%, transparent);
17471750
font-size: 11px;
17481751
font-family: var(--font-mono);
17491752
color: var(--danger);
17501753
}
17511754

1755+
.sidebar-footer-branch__icon {
1756+
display: inline-flex;
1757+
flex: 0 0 auto;
1758+
}
1759+
1760+
.sidebar-footer-branch__icon svg {
1761+
width: 12px;
1762+
height: 12px;
1763+
stroke: currentColor;
1764+
fill: none;
1765+
stroke-width: 1.7px;
1766+
stroke-linecap: round;
1767+
stroke-linejoin: round;
1768+
}
1769+
1770+
.sidebar-footer-branch__name {
1771+
min-width: 0;
1772+
overflow: hidden;
1773+
text-overflow: ellipsis;
1774+
white-space: nowrap;
1775+
}
1776+
17521777
/* Footer icons mix in-app anchors, buttons, and one external docs link: the
17531778
chrome gets the default arrow; only the external (target=_blank) anchor is
17541779
a real hyperlink and keeps the pointer. */

0 commit comments

Comments
 (0)