Skip to content

Chat revamp: file attachments, abort, session switching, voice UI, mute sync, overlay disable - #424

Merged
shanselman merged 10 commits into
openclaw:masterfrom
christineyan4:christiney/native-chat
May 18, 2026
Merged

shanselman merged 10 commits into
openclaw:masterfrom
christineyan4:christiney/native-chat

Conversation

@christineyan4

@christineyan4 christineyan4 commented May 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Comprehensive chat UI revamp developed through 8+ rounds of user testing. Covers file attachments, response abort, session/model switching, voice recording polish, mute synchronization, and overlay removal.

Chat Foundations

  • File attachment support with drag-and-drop and picker
  • Response abort/cancel functionality
  • Session switching and model selection dropdowns
  • Keyboard shortcuts and focus management

Voice Recording UI Polish

  • Split voice button into stop (keeps transcript) and cancel (discards) actions
  • Fixed audio level animation (WirePipelineEvents was never called in ListenOnceAsync)
  • Compact recording pill indicator (red dot + waveform bars)
  • Dropdown sizing fixes (model ComboBox explicit width)
  • Focus management: cursor goes to end of text after voice input, Enter sends instead of re-recording
  • Append mode for re-recording
  • Increased recording timeout from 10s to 120s

Mute Sync

  • Speaker mute persists across app restarts (VoiceTtsEnabled setting)
  • Mute state syncs between hub chat, tray chat, and Voice/Audio settings page
  • App.SpeakerMuteChanged event for cross-surface synchronization

Inline Test Voice UI

  • Replaced standalone dialog with inline toggle panel in Voice settings
  • Speech bubble transcript display, centered controls, minimal layout
  • Fixed disposal leak (_inlineTestVoiceService)

Voice Overlay Disable

  • Disabled standalone VoiceOverlayWindow (code preserved as comments)
  • All voice entry points redirect to inline chat voice mode
  • Voice button removed from tray menu

Hotkey Improvements

  • Ctrl+Alt+Shift+V opens chat and starts recording (RetryTriggerVoice mechanism)
  • Works from cold start (15 retries x 100ms for mount timing)

Node Auto-Connect Fix

  • Added TryConnectLocalNodeServiceAsync for local gateway restart case
  • NodeConnector suppression for local gateways left NodeService disconnected on restart

Merge

  • Merged with latest master, resolved conflicts in App.xaml.cs (tray menu refactor)

Christine Yan and others added 5 commits May 15, 2026 22:53
- Fix dropdown layout (MaxWidth caps, auto-sizing, breathing room)
- Fix session auto-switching bug (UseRef for stale closure in onChanged)
- Add speaker mute/unmute button with mid-speech TTS interrupt
- Add settings gear button → voice settings page
- Scroll to bottom on session switch
- Wire reasoning dropdown with 'medium (default)' label
- Add inline voice recording UI: transcript streams into textbox,
  accent border, red dot + level bars indicator row
- Wire VoiceService events (transcript + audio level) to composer
- Enable voice input in ChatWindow (tray) — was previously missing
- Expose VoiceServiceInstance from App for tray access

Co-authored-by: Copilot <[email protected]>
- Fix audio level responsiveness (wire pipeline events in ListenOnceAsync)
- Split voice cancel into stop (keep transcript) vs cancel (discard)
- Recording pill indicator with reactive waveform bars (Option D)
- Fix dropdown resize on ComboBox open (explicit Width for model)
- Redirect Ctrl+Alt+Shift+V hotkey to inline chat voice mode
- Hotkey auto-starts recording with retry for render timing
- Cursor placed at end of text after voice transcription
- Mute state persists to settings and syncs across all views
- Inline test voice input replaces dialog (speech bubbles, centered UI)
- Remove dead dialog-based test voice input code
- Increase recording timeout from 10s to 120s
- Append mode for re-recording (appends to existing text)
- Focus textbox after recording so Enter sends message

Co-authored-by: Copilot <[email protected]>
…oice

- Comment out ShowVoiceOverlay() and _voiceOverlayWindow field (code preserved)
- Comment out agent response routing to overlay window
- Redirect all voice entry points to ShowHub(voice) (settings page)
  - Deep-link voice handler
  - HubWindow.OpenVoiceAction
  - Tray OpenVoice action
- Ctrl+Alt+Shift+V hotkey already redirected to inline chat voice (prior commit)
- VoiceOverlayWindow.xaml/.cs files left intact for future re-enablement

Co-authored-by: Copilot <[email protected]>
# Conflicts:
#	src/OpenClaw.Tray.WinUI/App.xaml.cs
…e tray button

- Add TryConnectLocalNodeServiceAsync to connect NodeService when operator
  connects to a local gateway (fixes restart case where NodeConnector is
  suppressed but NodeService never connects)
- Comment out Voice menu item in TrayMenuStateBuilder (master's refactored
  menu builder re-introduced it during merge)

Co-authored-by: Copilot <[email protected]>
@christineyan4 christineyan4 changed the title Voice recording UI polish, mute sync, overlay disable, and node auto-connect Chat revamp: file attachments, abort, session switching, voice UI, mute sync, overlay disable May 16, 2026
Add Chat_Voice_ListeningPrompt and Chat_Voice_Cancel translations
to zh-cn, zh-tw, nl-nl, and fr-fr resource files.

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

Copy link
Copy Markdown
Collaborator

Hi @christineyan4 — thank you for the chat revamp work here. This branch was green on CI, but after the recent #423/#419 landing it now conflicts with current master in the app/window/chat/voice surfaces (App.xaml.cs, ChatPage.xaml.cs, VoiceSettingsPage.xaml.cs, and HubWindow.xaml.cs).

Could you please rebase this onto latest master and adapt the changes to the new AppState / IAppCommands / service split? The parts I’d be extra careful with are chat session switching, voice UI/trigger state, and the HubWindow navigation/state ownership that changed in #423/#419.

Once it’s rebased and CI is green again, I’ll take another careful pass and help get it landed. Thanks!

@shanselman

Copy link
Copy Markdown
Collaborator

Quick related note from today's large-list loading work: I opened #429 with a small reusable loading-state pattern for gateway-backed lists.

The important behavior is stale-while-refresh, but with actions/editing disabled while fresh data is actively loading. That lets pages keep useful existing content visible instead of flashing empty states, without letting users mutate stale rows.

This may be useful as the chat rewrite/refactor evolves too, especially for session/model/history/file lists or any attachment/history surfaces that can load slowly. Chat streaming will probably need append/stream-specific semantics, so I would treat #429 as a reusable pattern to adapt rather than a hard dependency.

@shanselman

Copy link
Copy Markdown
Collaborator

Post-refactor triage note: this is still a meaningful chat/voice revamp, but it is currently dirty against master and overlaps the AppState/IAppCommands/service split that landed after the branch was authored. Please rebase/update against current master before review; I am not going to maintainer-resolve these conflicts because the branch needs to be re-expressed through the current architecture rather than mechanically patched.

@christineyan4

Copy link
Copy Markdown
Contributor Author

Have been offline today, but will make sure to get this rebased and take into account the new architecture first thing tomorrow morning. Thanks!!

Christine Yan and others added 2 commits May 18, 2026 09:57
# Conflicts:
#	src/OpenClaw.Tray.WinUI/App.xaml.cs
#	src/OpenClaw.Tray.WinUI/Pages/ChatPage.xaml.cs
#	src/OpenClaw.Tray.WinUI/Pages/VoiceSettingsPage.xaml.cs
#	src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml.cs
These prototype settings/chat pages in src/OpenClaw.App/ were
accidentally committed during voice UI work and don't belong in this PR.

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

@shanselman shanselman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the substantial chat/voice work here. I ran this through a Copilot-assisted review: local validation in an isolated PR worktree plus two independent adversarial review passes. The direction is exciting, but I don't think we should merge this yet because the new attachment/abort paths have a few correctness and reliability issues that are easier to fix before they become part of the main chat architecture.

Validation did pass locally:

  • ./build.ps1 passed
  • Shared tests passed: 1795 total, 0 failed
  • Tray tests passed: 1086 total, 0 failed
  • Shared/Tray --no-restore reruns passed

Requested changes before merge:

  1. Please make file picking STA/UI-thread safe. Win32FilePickerHelper currently runs IFileOpenDialog inside Task.Run, which means an MTA thread-pool thread. IFileOpenDialog is an STA COM dialog and can fail or hang depending on shell extensions/machine configuration. Please use a dedicated STA thread or a supported WinUI picker initialized with the window handle.

  2. Please add an attachment size limit and avoid synchronous unbounded reads. ChatAttachment.FromFile reads the whole file synchronously and base64-encodes it without a size guard. A large file can freeze the UI, consume huge memory, and exceed gateway/WebSocket payload limits. A hard max size with user-visible feedback would make this much safer.

  3. Please make attachment display/history structured instead of local emoji text markers. Right now attachments appear to be represented in the optimistic local bubble and parsed back from ??? / ?? text lines. That means attachments can disappear after history reload or across surfaces, and normal user text can be misclassified. Please carry attachment metadata through the chat model/history path, or intentionally persist a durable textual placeholder if structured history support is out of scope.

  4. Please tighten abort/run tracking. The review found risks around deferred abort state, failed abort suppression, and overlapping sends while a turn is active. At minimum, failed aborts should not permanently suppress a thread, and either sending while a turn is active should be disabled or the provider should track multiple active runs safely.

  5. Please add meaningful tests for the new behavior. This PR touches 40 files and adds major user-facing chat/voice features, but the test changes look mostly like existing-test adjustments. Before merge, I'd like coverage for the core new paths: attachment send/reload behavior, file size rejection, abort suppression/recovery, voice stop vs cancel, model/session patching, and mute sync.

  6. Please avoid bypassing the chat provider abstraction for attachments. OpenClawChatRoot downcasts to OpenClawChatDataProvider to send attachments, so other providers silently drop them. An interface overload or explicit capability interface would keep this extensible and easier to test.

None of this is meant to take away from the user-testing and UX progress in the branch. I think the PR is close in spirit, but because it introduces file IO, chat transport changes, voice state, and abort/session behavior all at once, I want these reliability and test gaps closed before landing it.

Copilot transparency: this review was Copilot-assisted, then consolidated and posted by me.

Christine Yan and others added 2 commits May 18, 2026 13:06
- STA file picker: use dedicated STA thread instead of Task.Run for COM dialog
- Attachment size limit: 10MB max with async validation and user-facing error
- Provider abstraction: add SendMessageAsync overload with attachments to IChatDataProvider
- Abort tracking: clear suppression on failed abort, clear pending on new send, clear on lifecycle.end
- Structured attachments: use zero-width space prefix to prevent false-positive detection
- Tests: add ChatAttachmentTests (9 tests) and abort tracking tests (3 tests)

Co-authored-by: Copilot <[email protected]>
- Fix silence timeout resetting to 0: initialize _suppressEvents=true so
  XAML slider ValueChanged doesn't fire before LoadSettings
- Fix sound button not playing: bypass IsMuted check for manual play
  (mute is for auto-read only)
- Remove 500-char truncation: read full response, user can mute to stop
- Add SanitizeForSpeech: strip markdown, code blocks, URLs, emojis, and
  special characters before passing text to TTS engine

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants