Skip to content

fix(macos): merge the WebChat window title band into the toolbar row#109318

Merged
steipete merged 1 commit into
mainfrom
feat/macos-webchat-titlebar-merge
Jul 16, 2026
Merged

fix(macos): merge the WebChat window title band into the toolbar row#109318
steipete merged 1 commit into
mainfrom
feat/macos-webchat-titlebar-merge

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The standalone WebChat window stacks a full native title band (traffic lights + "OpenClaw" title) above the SwiftUI toolbar row (sidebar toggle, search, session title, pickers), wasting a band of vertical space. User-reported with screenshot.

Why This Change Was Made

Apply the merged-chrome pattern the Dashboard window already ships (#105902): hidden title, transparent titlebar, no separator, movable-by-background — one header row with the traffic lights inline.

User Impact

The chat window's toolbar controls and traffic lights share a single row; the empty title band is gone. Close/miniaturize/resize/fullscreen and frame restoration unchanged. The quick-chat panel (borderless) is untouched.

Two subtle traps are handled and regression-tested:

  • SwiftUI's toolbar bridge can restore visible title chrome → a window subclass pins titleVisibility = .hidden.
  • Attaching an NSHostingController resets sceneBridgingOptions to .all → re-set to [.toolbars] after attachment so the title never bridges back (toolbar controls investigated and kept: sidebar toggle, search, title/subtitle, context usage, Thinking/Model pickers, session actions, New Session).

Evidence

  • swift build + swift test --filter WebChatSwiftUISmokeTests (3/3: hidden-title pinning, bridging options, style mask) + scripts/format-swift.sh + scripts/lint-swift.sh (zero violations).
  • Visual capture blocker, stated plainly: the dev-harness (bare SPM binary / locally packaged bundle) renders this SwiftUI window's content blank on both baseline main and this branch (pre-existing harness limitation, verified by stash-baseline comparison), so honest before/after window screenshots could not be produced off-desktop. The chrome change itself is deterministic AppKit config identical to the Dashboard window. Reporter can confirm visually on first relaunch after landing.

The standalone chat window stacked a visible title bar (traffic lights +
"OpenClaw" title) above the SwiftUI toolbar row, wasting a full band of
vertical space. Apply the Dashboard window's merged chrome: hidden title,
transparent titlebar, no separator, movable-by-background — the unified
toolbar (sidebar toggle, search, pickers, session actions) now shares its row
with the traffic lights. A window subclass pins titleVisibility to hidden
because SwiftUI's toolbar bridge can restore visible title chrome, and scene
bridging is reset to toolbars-only after controller attachment (attaching an
NSHostingController resets it to .all).
@openclaw-barnacle openclaw-barnacle Bot added app: macos App: macos size: S maintainer Maintainer-authored PR labels Jul 16, 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: 570c1a234b

ℹ️ 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 on lines +728 to +729
(contentViewController as? NSHostingController<OpenClawChatWindowShell>)?
.sceneBridgingOptions = [.toolbars]

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 Restore title bridging for WebChat metadata

In the full chat window, OpenClawChatWindowShell is still the only place that renders the active session title and model/cost subtitle (apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatWindowShell.swift:34-35), and title scene bridging is what lets those navigationTitle/navigationSubtitle values reach the AppKit window. Resetting the attached host to only .toolbars keeps the buttons but drops the existing title/subtitle bridge, so users who open the standalone WebChat window—especially with the sidebar hidden or after switching sessions/models—lose the current-session metadata that was present before. Please keep .title bridged while pinning only the unwanted native chrome, or render an explicit toolbar title/subtitle item.

Useful? React with 👍 / 👎.

@steipete steipete self-assigned this Jul 16, 2026
@steipete
steipete merged commit 8f74762 into main Jul 16, 2026
73 of 77 checks passed
@steipete
steipete deleted the feat/macos-webchat-titlebar-merge branch July 16, 2026 20:12
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 17, 2026
…penclaw#109318)

The standalone chat window stacked a visible title bar (traffic lights +
"OpenClaw" title) above the SwiftUI toolbar row, wasting a full band of
vertical space. Apply the Dashboard window's merged chrome: hidden title,
transparent titlebar, no separator, movable-by-background — the unified
toolbar (sidebar toggle, search, pickers, session actions) now shares its row
with the traffic lights. A window subclass pins titleVisibility to hidden
because SwiftUI's toolbar bridge can restore visible title chrome, and scene
bridging is reset to toolbars-only after controller attachment (attaching an
NSHostingController resets it to .all).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant