Skip to content

improve(control-ui): public conversation pages match the chat design and add copy buttons - #168156

Merged
steipete merged 3 commits into
mainfrom
steipete/control-ui-openclaw-blog-design-3a4593
Oct 10, 2026
Merged

steipete merged 3 commits into
mainfrom
steipete/control-ui-openclaw-blog-design-3a4593

Conversation

@steipete

@steipete steipete commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Publicly shared conversations rendered as a generic dark page that looked nothing like the Control UI: the page's Content Security Policy blocked the Gateway-hosted typeface so it fell back to the system font, there was no way to copy a code block, and a visitor who had never seen OpenClaw learned nothing about it.

User Impact

User impact: public readers now see a shared conversation in the Control UI's chat layout and typeface, following the system light/dark setting; every code block and the install command have a one-click copy control; and the page closes with a short OpenClaw introduction and install line. Login handoff, live refresh, pagination, the unavailable page, and the content filters (no tool output, reasoning, files, images, hidden messages, or credential patterns) are unchanged. The bearer /share/session route now serves the same small hashed page script as the canonical thread URL (it previously shipped no script).

Why This Change Was Made

The public page is server-rendered HTML with a strict CSP, so it cannot load the Control UI bundle; instead it now carries the Control UI's own design tokens and chat element styles (ui/src/styles/base.css, ui/src/styles/chat/text.css): tinted right-aligned user bubbles, flat assistant prose with the lobster avatar in the gutter, grouped consecutive turns, and the same code, quote, and table treatment. The closing section reuses the README's wording and links.

Both public routes now share one PUBLIC_SESSION_CONTENT_SECURITY_POLICY. It adds font-src 'self' and style-src 'self' so the page can link <mount>/fonts/instrument-sans.css, which the Gateway already serves as a public root asset for the login page; nothing third-party is allowed. The fixed entry script is emitted on every page (its login probe and live refresh stay gated as before) and now also injects the copy control into code blocks as progressive enhancement, using the Clipboard API with a selection fallback. Fenced code is wrapped in a div.code so the control stays pinned while a wide block scrolls. renderPublicSessionDocument takes the Control UI mount as assetBasePath.

Release-note context: public conversation pages match the Control UI, load its typeface, offer copy buttons on code, and end with an OpenClaw introduction.

Evidence

Synthetic transcript rendered by the real renderer and served under the real policy.

Before (dark):

Before: generic dark public page

After (dark):

After: Control UI layout, dark

After (light):

After: Control UI layout, light

After (phone, dark):

After: phone width

Code block with the copy control on hover:

Code block hover with copy button

  • Browser proof against a server sending the shared policy: fonts/instrument-sans.css and instrument-sans-latin.woff2 load with 200, document.fonts.check('16px "Instrument Sans"') is true, and the body resolves to Instrument Sans. A real click on the install copy control sets the copied state and shows the check icon; no CSP violations in the console.
  • pnpm test src/gateway/control-ui-public-session-render.test.ts src/gateway/control-ui-public-session.http.test.ts src/gateway/control-ui-public-chat.http.test.ts --maxWorkers=1: 3 files, 38 tests passed (about 95 s wall, dominated by the gateway compile step). New assertions cover the font link, the shared policy carrying the page's only inline script hash on both routes, grouped turns, and the closing section's presence on public pages and absence on the unavailable page.
  • pnpm tsgo clean; oxfmt applied.
  • Docs: one sentence in docs/web/urls.md (Public session transcripts).
  • Independent Codex autoreview of the local diff: scoped-clean, no actionable findings (P0 scope).
  • Rebased onto main after fix(control-ui): skip the reader bounce on operator reloads #168007 (public-reader login handoff); the resolution carries that change's hide-Log-in-while-probing rule into the new stylesheet, script, and noscript block.
  • On the rebased head, the two other renderer callers in tests (control-ui-public-session-entry.test.ts, chat-display-projection.cold-imports.test.ts) pass the new assetBasePath; six suites (those two, the three public-page suites, and control-ui-session-entry-document.http.test.ts) pass with 71 tests, and pnpm tsgo is clean.
  • The public reader refresh suite (control-ui-public-session-refresh.test.ts), which runs the entry script against a hand-built document stub, now stubs querySelectorAll for the copy-control enhancer; it passes alongside the renderer suite. The first CI run on the rebased head (38021922035) failed only there.

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: M labels Oct 10, 2026
…and add copy buttons

Public share pages now carry the Control UI's design tokens and chat element
styles (tinted user bubbles, flat assistant prose with the lobster avatar in
the gutter, grouped turns, matching code/quote/table treatment), follow the
system light/dark setting, and close with a short OpenClaw introduction and
install line.

Both public routes share one Content Security Policy that adds font-src and
style-src 'self' so the page can link the Gateway-hosted Instrument Sans
stylesheet, which is already a public root asset. The fixed entry script is
emitted on every public page and injects a copy control into code blocks and
the install line; its login probe and live refresh stay gated as before. The
renderer takes the Control UI mount as assetBasePath.
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR gives public conversations the Control UI’s chat styling, self-hosted typeface, code-copy buttons, and an OpenClaw introduction.

Example: A shared conversation contains curl -fsSL https://openclaw.ai/install.sh | bash.

  • Before: Readers see a generic dark page and select code manually.
  • After: Readers see a system-themed chat layout with a copy button.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful and correct with both earlier findings resolved; browser evidence covers the generated document under CSP rather than a complete Gateway navigation.
Proof confidence 🦐 gold shrimp (3/6) ✨ media proof bonus Sufficient (screenshot): Inspected browser screenshots exercise the real generated reader in dark, light, and phone layouts; the supplied browser report covers fonts and copying under the shared CSP using a synthetic transcript server.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Public readers see inconsistent conversation styling and lack convenient code copying or an introduction to OpenClaw.
Reason: The established feature owner proposes a focused improvement to the existing reader without new configuration or persisted state.

Merge readiness

✅ Ready for maintainer review

Keep this PR: it provides useful public-reader improvements, both earlier findings are resolved, and no actionable defect remains.

Priority: P2
Reviewed head: 52b0e2247538c9b5940a9494b09ef63528155118

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway public routes authorize publication, filter transcript content, and render standalone HTML whose browser script handles login handoff, refresh, and copying.

flowchart LR
  A[Public conversation URL] --> B[Gateway public route]
  B --> C[Publication checks]
  C --> D[Filtered transcript]
  D --> E[Shared HTML renderer]
  E --> F[Browser reader]
  F --> G[Clipboard]
Loading

Technical review

Best possible solution:

Retain the shared renderer and CSP with the completed caller and refresh-fixture fixes.

Do we have a high-confidence way to reproduce the issue?

The supplied before screenshots establish the presentation problem; source inspection confirms the earlier integration defects are repaired without running target code.

Is this the best way to solve the issue?

The existing shared renderer is the appropriate owner, and one CSP for both routes prevents policy drift while preserving publication checks.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2d6f7a3052a0.

Provenance checked

  • Public-reader presentation and bearer-page scripting changes intended behavior with a stated reason (48307ec: Provide a bounded, anonymous, text-only reader with inert Markdown and no operator bootstrap.)
  • Canonical-thread handoff and refresh lifecycle keeps the original intent (8787ee0: Serve public conversations at regular URLs while preserving protected handoff, conditional refresh, and revocation.)
  • Pending login visibility keeps the original intent (430f975: Avoid the login affordance flashing while access checking is pending.)
  • Shared response handling keeps the original intent (2c3cab6: Share public response handling while retaining explicit authority checks and variant-specific behavior.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +90, Tests +49, Docs +2. Total +141 across 10 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 123 33 +90
Tests 5 59 10 +49
Docs 1 3 1 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 185 44 +141

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: A useful, bounded improvement to public conversation readability and code-copy ergonomics.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-10T03:41:23.379Z sha 492709eabe0477fee09508101866481c23cbaec0 :: needs changes before merge. :: [P2] Pass the new asset path from every renderer caller | [P2] Update the refresh fixture for copy enhancement
  • reviewed 2026-10-10T03:54:57.806Z sha 60d7e16 :: needs changes before merge. :: [P2] Update the refresh fixture for copy enhancement

Reviewed October 10, 2026, 12:18 AM ET / 04:18 UTC (Revision 3).

@steipete
steipete force-pushed the steipete/control-ui-openclaw-blog-design-3a4593 branch from 492709e to 60d7e16 Compare October 10, 2026 03:48
@steipete
steipete marked this pull request as ready for review October 10, 2026 03:49
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 10, 2026
@steipete
steipete merged commit 45ec7dc into main Oct 10, 2026
124 of 125 checks passed
@steipete
steipete deleted the steipete/control-ui-openclaw-blog-design-3a4593 branch October 10, 2026 04:27
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 10, 2026
#168156 named an HTML constant OPENCLAW_PITCH, which the production
OPENCLAW_* name ratchet counts as an environment variable (456 > 455).
Rename it so the budget reflects real environment names again.
steipete added a commit that referenced this pull request Oct 10, 2026
#168156 removed the last production importer of PUBLIC_SESSION_ENTRY_SCRIPT, so knip --production flags it as an unused export. The refresh test now extracts the exact inline script from renderPublicSessionDocument output (the same bytes the CSP hash covers) instead of importing the constant.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
…and add copy buttons (openclaw#168156)

* improve(control-ui): public conversation pages match the chat design and add copy buttons

Public share pages now carry the Control UI's design tokens and chat element
styles (tinted user bubbles, flat assistant prose with the lobster avatar in
the gutter, grouped turns, matching code/quote/table treatment), follow the
system light/dark setting, and close with a short OpenClaw introduction and
install line.

Both public routes share one Content Security Policy that adds font-src and
style-src 'self' so the page can link the Gateway-hosted Instrument Sans
stylesheet, which is already a public root asset. The fixed entry script is
emitted on every public page and injects a copy control into code blocks and
the install line; its login probe and live refresh stay gated as before. The
renderer takes the Control UI mount as assetBasePath.

* test(gateway): pass the Control UI mount to public session renderer callers

* test(gateway): give the public reader refresh stub the enhancer's DOM surface
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
openclaw#168156 named an HTML constant OPENCLAW_PITCH, which the production
OPENCLAW_* name ratchet counts as an environment variable (456 > 455).
Rename it so the budget reflects real environment names again.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
openclaw#168156 removed the last production importer of PUBLIC_SESSION_ENTRY_SCRIPT, so knip --production flags it as an unused export. The refresh test now extracts the exact inline script from renderPublicSessionDocument output (the same bytes the CSP hash covers) instead of importing the constant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant