Skip to content

improve(chat): refine composer sizing and context controls - #2117

Merged
bkudiess merged 10 commits into
openclaw:mainfrom
bkudiess:bkudiess-fix-chat-composer-text-size
Nov 12, 2026
Merged

bkudiess merged 10 commits into
openclaw:mainfrom
bkudiess:bkudiess-fix-chat-composer-text-size

Conversation

@bkudiess

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Native chat's oversized composer controls, bright placeholder, and separate context strip did not match the more compact web chat experience.

User Impact

User impact: chat gains a compact composer with a muted agent-specific placeholder, smaller Send/filled Stop controls, clearer assistant text, more bottom spacing, and a context ring that opens usage details.

The attachment action uses "+", and the sandbox shield moves beside it with an "On" label and check when supported. The throughput strip is removed. The context popup includes context-window and latest-run token counts; web cost and plan-quota sections are not included. Sandbox enforcement, sending, and attachment behavior are unchanged.

Why This Change Was Made

Use native theme resources and existing chat state to match the supplied visual references without introducing a WebView or new Gateway calls. The transcript fades into the composer by masking only its bottom 32px, leaving the real scrolling content opaque. Shared color-change observation keeps Markdown, the placeholder, and the fade synchronized with live contrast changes.

Evidence

  • Full build passed; Shared: 5,615 passed, 28 ordinary opt-in skips; Tray: 6,174 passed; focused native UI: 17 passed, zero skips.
  • Native regressions cover live contrast changes, TextBox cleanup, matching ring geometry and thresholds, consistent usage counters, translated enlarged-text layout, toolbar reachability, and sandbox flyout placement.
  • An owned-window pixel test scrolls synthetic content from red to blue and verifies the partially transparent bottom band updates with it. Separate coverage verifies that ordinary RenderTargetBitmap captures retain readable transcript content.
  • The earlier Hanselman review used Claude Opus 5.5 and GPT-6 Astra. Its ten findings were addressed. A post-repair Copilot code-review subagent reviewed all 29 paths and the implementation/proof plan at P0-P3, with no actionable findings. Its model identity was unverified, and prior findings were provided as context; this was independent, not blind.

This remains a draft pending GitHub CI and the complete proof pools below. Local captures are retained privately; no real chat contents or user-profile data are attached.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • windows-winui-interactive: composer layout, context flyout, accessibility, live contrast changes, and transcript fade.
  • windows-11-arm64: retain native ARM64 launch and rendering coverage for the composition-based transcript edge.

Validation

Run on the uncommitted candidate on November 10-11, 2026. All 29 source paths were hash-checked against the saved source manifest before PR preparation; these are retained results, not newly executed runs.

Command Result
.\build.ps1 Passed: Shared, CLI, WinNode CLI, SetupEngine, WinUI
dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore Passed: 5,615; skipped: 28 ordinary opt-ins
dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore Passed: 6,174; skipped: 0
dotnet build .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -r win-arm64 -v quiet Passed
.\scripts\validate-docs.ps1 Passed: 74 Markdown files
git diff --check Passed
Exact focused native selection and retained failure

The native commands ran through scripts\Invoke-PrivateDesktop.ps1 with isolated tray roots. A temporary short drive alias to this worktree's parent avoided long-path FileWorker copy failures without changing product code. $artifacts below denotes the local evidence directory.

$filter = 'FullyQualifiedName~ComposerContrast_|FullyQualifiedName~ContextRing_|FullyQualifiedName~ContextPopup_|FullyQualifiedName~TranscriptFade_|FullyQualifiedName~SandboxFlyout_ReflectsSettingsWithoutChangingDraftAndOpensSettings|FullyQualifiedName~ProductionRoot_AlignsColumnAndKeepsEveryComposerActionReachable|FullyQualifiedName~ReactorMarkdownWebParityProofTests'
dotnet test .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -r win-arm64 --no-build --filter $filter --logger 'trx;LogFileName=composer-review.trx' --results-directory (Join-Path $artifacts 'native-review-results')

Result: 17 passed, 0 failed, 0 skipped. OPENCLAW_MOUNTED_CONTROL_CAPTURE_DIR was set, enabling the owned-window pixel assertions rather than just the structural checks.

One Shared attempt failed during InstalledFileWorkerResolverTests.ChangedPreparationCannotPublishEvenWithoutCancellation(mutation: "replaced-identical") teardown because coreclr.dll was locked. Its assertions had completed. The failure was retained; no FileWorker code or assertion was changed. The isolated two-case rerun and subsequent complete Shared run passed:

dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-build --no-restore --filter 'FullyQualifiedName~ChangedPreparationCannotPublishEvenWithoutCancellation'

Result: 2 passed, 0 failed, 0 skipped. This replay does not claim the underlying intermittent cleanup issue is fixed.

Real Behavior Proof

  • Environment tested: native Windows ARM64; Debug WinUI build; isolated private desktop for mounted-control tests. Earlier application observations used synthetic fixture data and the explicitly authorized normal profile separately.
  • PR head or commit tested: runs used the uncommitted candidate based on a6ff6a164b20835bd5d77200c9134578dd7ce0c6. All 29 manually recorded source hashes match the content committed as a3c03f9d22371d72d40ef7ef4d0b16ab534493a3; the commit itself was not rebuilt or retested.
  • Exact steps or command run: focused native selection above. TranscriptFade_ScrollingRefreshesComposedEdge captures the owned HWND, changes the ScrollViewer offset from 0 to 600, and checks red-to-blue pixel changes at the middle of the fade band.
  • Evidence after fix: Passed! - Failed: 0, Passed: 17, Skipped: 0, Total: 17. The scrolling test verifies band pixels remain partially transparent and change to the new content; the lifetime test verifies only a 32px surface is redirected and normal transcript opacity remains 1.
  • Observed result: context details open from the composer; scaled French/Portuguese text wraps; live contrast refresh and pooled-control cleanup pass without remounting; the fade does not retain stale pixels after scrolling.
  • Screenshot or artifact links verified? (Yes/No/N/A): N/A; local receipts and synthetic captures retained, no public artifact links claimed.
  • Not verified or blocked: complete scheduled proof pools, full accessibility scan, native physical keyboard/wheel input, Release, Windows 10/x64 native runs, and current-upstream merge CI. WinApp CLI was unavailable. Local mounted-control captures are not a complete native-compositor or live-provider acceptance claim.

Security Impact

  • New permissions or capabilities? (Yes/No): No
  • Secrets or tokens handling changed? (Yes/No): No
  • New or changed network calls? (Yes/No): No
  • Command or tool execution surface changed? (Yes/No): No
  • Data access scope changed? (Yes/No): No
  • If any answer is Yes, explain the risk and mitigation: N/A

Compatibility and Migration

  • Backward compatible? (Yes/No): Yes; presentation changes only. The below-composer throughput display is intentionally removed.
  • Config or environment changes? (Yes/No): No
  • Migration needed? (Yes/No): No
  • If yes, list the exact upgrade steps: N/A. Windows 10 retains the layered shield/check fallback; Windows 11 uses the native shield-check glyph.

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

Align the native composer with the requested web references. Add context details and a bounded transcript fade with high-contrast and control-lifetime regression coverage.

Co-authored-by: Copilot App <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

🦞👀
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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 11, 2026
@clawsweeper

clawsweeper Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

This PR makes the native chat composer more compact, replaces the throughput strip with context details, and adds a transcript-edge fade.

Example: A chat has used 1,000 of its 5,000 context tokens.

  • Before: Context usage appears below the composer beside throughput statistics.
  • After: A 20% context ring beside the model picker opens context and input/output token details.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The source change is coherent with no definite introduced defect, but supplied proof remains within tests and native acceptance is unfinished.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Preference · Worth it: Yes · Fix scope: Complete
User problem: The composer occupies more visual space and separates context information from its controls.
Reason: The collaborator author has prior merged ownership of this presentation, and explicitly accepts the compact layout and removal of throughput statistics.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored draft open: current main retains the older presentation, and the reviewed diff contains no definite introduced correctness bug.

Priority: P3
Reviewed head: a3c03f9d22371d72d40ef7ef4d0b16ab534493a3

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Supply visible evidence from running Companion for the composer, opened context details, and scrolling fade, complete the declared native acceptance pools, and identify any unavailable base-failure comparison.
Agent review details

How this fits together

The native Reactor chat reads existing session and message metadata, renders the transcript and composer, and forwards user actions to the existing composer controller.

flowchart TD
  A[Chat provider snapshots] --> B[Reactor chat root]
  B --> C[Usage formatter]
  C --> D[Composer and context flyout]
  B --> E[Timeline and edge fade]
  D --> F[Existing composer controller]
  G[System theme changes] --> D
  G --> E
Loading

Technical review

Best possible solution:

Land the focused native presentation change after its declared acceptance gates are satisfied, preserving existing controller, metadata, and sandbox enforcement ownership.

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

This is an intentional presentation improvement; source comparison confirms the previous layout on main, but no runtime reproduction was performed.

Is this the best way to solve the issue?

The implementation uses existing composer and usage owners, replaces the old display, and shares the existing contrast observer without introducing a competing workflow.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 018a207a839f.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Introduced change size Production +874/-296; tests +426/-31; documentation/design +66/-27 Growth principally implements the context flyout, bounded composition fade, shared theme lifetime, localization, and distinct mounted-control regressions.

Labels

Label changes:

  • add P3: This is native chat presentation polish without an established broken core workflow.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is native chat presentation polish without an established broken core workflow.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach visible running-app evidence for the changed composer, context flyout, and scrolling fade.
  • Complete the declared native acceptance pools and obtain the required current-head CI results.

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 execution lanes are retired.

Reviewed November 11, 2026, 4:03 PM ET / 21:03 UTC.

@bkudiess
bkudiess marked this pull request as ready for review November 11, 2026 21:04
bkudiess and others added 3 commits November 11, 2026 15:11
Use content-bottom anchoring instead of WinUI extent-edge anchoring. Preserve the native scrollbar-end and streaming assertions, normalize proof widths for DPI, and wait for the retained workspace navigation peer after closing the timeline.

Co-authored-by: Copilot App <[email protected]>
Use the native show-more action before locating the fixed main-session row. Keep the date-dependent fixture data, existing geometry assertions, and test timeouts unchanged.

Co-authored-by: Copilot App <[email protected]>
bkudiess and others added 6 commits November 12, 2026 06:26
Retain the compact composer, context indicator and primary assistant ink while integrating the tool-details panel and exact bottom-landing policy from main.

Co-authored-by: Copilot App <[email protected]>
Capture final-row identity and bounds plus queried native anchor information only after the existing timeout. Label the streaming stage without changing assertions, deadlines or scrolling actions.

Co-authored-by: Copilot App <[email protected]>
Keep ring geometry with each native Path rather than a component reference that survives a hidden ring. Preserve geometry across unchanged typing renders and refresh it for percentage changes or cleared Data. Extend mounted coverage through hide/show without requiring a new native Path.

Co-authored-by: Copilot App <[email protected]>
Allow followed transcript growth to use the existing exact-bottom correction once per immutable content update. Preserve input cancellation, initial-positioning gates and the follow threshold without allowing native remeasurement to replenish the correction budget.

Co-authored-by: Copilot App <[email protected]>
Do not arm the new extent-growth correction while a disclosure, keyboard reader, or pending reader bring owns the native anchor. Preserve viewport and explicit-jump behavior and cover the following-but-reader-anchored admission case.

Co-authored-by: Copilot App <[email protected]>
Retain the existing qualified overshoot guard in the schema-constrained cell. Streaming-growth coverage remains in the same test class; no production behavior or test assertion changes.

Co-authored-by: Copilot App <[email protected]>
@larroy

larroy commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

This removed toks/s throughput indicator

larroy added a commit that referenced this pull request Nov 30, 2026
* feat: show tokens per second in the chat context popover

- The composer context popover now ends with a Tokens per second section:
  current rate, mean (mu) and p95 over recent model calls in the session.
- Live estimates are prefixed with ~ while a turn streams; unavailable values
  show a placeholder until the first sample.
- The popover subscribes to the provider's throughput notifications through a
  new IChatThroughputSource, so an open popover refreshes without re-rendering
  the transcript. The pre-#2117 strip below the composer stays removed.
- Restored ChatUsageFormatter.FormatThroughput and localized the new strings in
  all six resource languages.

* fix(chat): localize the throughput value line

- Move the tokens-per-second sentence into a Chat_Throughput_ValueFormat resource for all six locales; each unit matches that locale's existing section label.
- Keep ChatUsageFormatter pure: the popover passes the localized template and the English fallback lives in DefaultThroughputValueFormat.
- Add a formatter test for a supplied localized template.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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.

2 participants