Repository navigation
improve(chat): refine composer sizing and context controls - #2117
Conversation
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]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Preference · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe 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
Technical reviewBest 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
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Preflight sourceSource 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
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 11, 2026, 4:03 PM ET / 21:03 UTC. |
Co-authored-by: Copilot App <[email protected]>
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]>
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]>
|
This removed toks/s throughput indicator |
* 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.
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
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
Scope
winnodeRequired 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.
.\build.ps1dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restoredotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restoredotnet build .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -r win-arm64 -v quiet.\scripts\validate-docs.ps1git diff --checkExact focused native selection and retained failure
The native commands ran through
scripts\Invoke-PrivateDesktop.ps1with isolated tray roots. A temporary short drive alias to this worktree's parent avoided long-path FileWorker copy failures without changing product code.$artifactsbelow denotes the local evidence directory.Result: 17 passed, 0 failed, 0 skipped.
OPENCLAW_MOUNTED_CONTROL_CAPTURE_DIRwas set, enabling the owned-window pixel assertions rather than just the structural checks.One Shared attempt failed during
InstalledFileWorkerResolverTests.ChangedPreparationCannotPublishEvenWithoutCancellation(mutation: "replaced-identical")teardown becausecoreclr.dllwas 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:Result: 2 passed, 0 failed, 0 skipped. This replay does not claim the underlying intermittent cleanup issue is fixed.
Real Behavior Proof
a6ff6a164b20835bd5d77200c9134578dd7ce0c6. All 29 manually recorded source hashes match the content committed asa3c03f9d22371d72d40ef7ef4d0b16ab534493a3; the commit itself was not rebuilt or retested.TranscriptFade_ScrollingRefreshesComposedEdgecaptures 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.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.Yes/No/N/A): N/A; local receipts and synthetic captures retained, no public artifact links claimed.Security Impact
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain the risk and mitigation: N/ACompatibility and Migration
Yes/No): Yes; presentation changes only. The below-composer throughput display is intentionally removed.Yes/No): NoYes/No): NoReview Conversations