Skip to content

feat(control-ui): show non-main gateway checkout branch in sidebar footer#104262

Merged
steipete merged 1 commit into
mainfrom
claude/branch-name-display-9d39dc
Jul 11, 2026
Merged

feat(control-ui): show non-main gateway checkout branch in sidebar footer#104262
steipete merged 1 commit into
mainfrom
claude/branch-name-display-9d39dc

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Operators who run the gateway from a source checkout (dev installs) have no visual cue in the Control UI when that gateway is on a feature branch instead of main. It is easy to test against a stale or experimental branch without noticing, because the sidebar footer only shows a connection dot.

Why This Change Was Made

The gateway now resolves its own checkout branch once per process (src/infra/dev-install-branch.ts) and ships it in the Control UI bootstrap config as devGitBranch. The value is only present for source-checkout installs whose package root is itself the git toplevel — the same install-kind rule update-check uses — and is suppressed for main, master, and detached HEAD. Release (npm/package) installs never report a branch, so the badge cannot appear there. The sidebar footer renders the branch in the danger color next to the connection dot, truncating with an ellipsis when the sidebar is narrow.

User Impact

When the gateway runs from a git checkout on a non-main branch, the sidebar footer shows that branch name in red. Release installs and mainline checkouts are unchanged.

Evidence

Footer with a dev branch active (from the e2e run's screenshot artifact):

sidebar footer with red dev branch badge

  • src/infra/dev-install-branch.test.ts — resolver behavior: feature branch reported; null for package installs, nested installs, main/master/detached HEAD, and git failures (9 tests, Testbox).
  • src/gateway/control-ui.http.test.ts — bootstrap config includes devGitBranch when the resolver reports a branch and omits it otherwise (312 tests across 4 gateway lanes, Testbox).
  • ui/src/e2e/sidebar-dev-branch.e2e.test.ts — mocked-gateway Playwright proof: badge text/title match the branch, computed color equals the resolved --danger token, badge absent without a branch (2 tests, Testbox).
  • pnpm check:changed and autoreview: results in PR comments/commits below.

…oter

Source-checkout (non-release) gateways now report their git branch in the
Control UI bootstrap config; the sidebar footer renders it in red next to
the connection dot. Package installs, main/master, and detached HEAD never
show it.
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: M maintainer Maintainer-authored PR labels Jul 11, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e7ebe66a5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ui/src/app/app-host.ts
.gatewayVersion=${context.config.current.serverVersion ??
gatewaySnapshot.hello?.server?.version ??
null}
.devGitBranch=${context.config.current.devGitBranch}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Source the branch from the connected Gateway

Here the sidebar reads context.config.current.devGitBranch, but that config is loaded from the page-relative /control-ui-config.json rather than the selected gateway.connection.gatewayUrl. When the supported Gateway URL flow connects a page served by one Gateway to a different remote Gateway, the badge reflects the page-serving checkout (or disappears) instead of the connected Gateway, so operators can still miss that the remote Gateway under test is on a feature branch.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit c16bd0d into main Jul 11, 2026
137 of 143 checks passed
@steipete
steipete deleted the claude/branch-name-display-9d39dc branch July 11, 2026 07:25
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
…oter (openclaw#104262)

Source-checkout (non-release) gateways now report their git branch in the
Control UI bootstrap config; the sidebar footer renders it in red next to
the connection dot. Package installs, main/master, and detached HEAD never
show it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant