Skip to content

feat(ui): add React chat interface with assistant-ui#1873

Closed
zerone0x wants to merge 1 commit intoopenclaw:mainfrom
zerone0x:feat/react-chat-assistant-ui
Closed

feat(ui): add React chat interface with assistant-ui#1873
zerone0x wants to merge 1 commit intoopenclaw:mainfrom
zerone0x:feat/react-chat-assistant-ui

Conversation

@zerone0x
Copy link
Copy Markdown
Contributor

Summary

  • Adds React + assistant-ui as an alternative chat interface implementation
  • Uses ExternalStoreRuntime to integrate with existing GatewayBrowserClient
  • Converts NormalizedMessage format to ThreadMessageLike for assistant-ui
  • Preserves streaming with abort functionality
  • Coexists with Lit implementation via useReactChat setting toggle

Implementation Details

New files in ui/src/ui/react-chat/:

  • message-adapter.ts - Converts internal message format to assistant-ui's ThreadMessageLike
  • gateway-runtime.tsx - Bridges GatewayBrowserClient with ExternalStoreRuntime
  • ChatApp.tsx - Main React chat component using assistant-ui primitives
  • index.tsx - Mount/unmount functions for Lit integration
  • styles.css - Styles matching existing Clawdbot UI using CSS variables

Modified files:

  • ui/package.json - Added React 19, react-dom, @assistant-ui/react deps
  • ui/vite.config.ts - Added @vitejs/plugin-react
  • ui/src/ui/storage.ts - Added useReactChat setting
  • ui/src/ui/app-render.ts - Conditional rendering based on setting
  • ui/src/main.ts - Import React chat styles

Test Plan

  • pnpm build passes
  • pnpm lint passes (0 errors)
  • pnpm test passes (4781 tests)
  • Manual testing with useReactChat: true setting
  • Verify streaming messages work correctly
  • Verify abort functionality works

Closes #1858

🤖 Generated with Claude Code

Adds a new React-based chat interface using the assistant-ui library as an
alternative to the existing Lit implementation. The new interface:

- Uses ExternalStoreRuntime to integrate with existing GatewayBrowserClient
- Converts NormalizedMessage format to ThreadMessageLike for assistant-ui
- Preserves streaming with abort functionality
- Maintains existing styling with CSS variables
- Coexists with Lit implementation via useReactChat setting toggle

The React chat mounts only in the chat tab, allowing gradual migration while
preserving all existing functionality.

Closes openclaw#1858

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@zerone0x zerone0x force-pushed the feat/react-chat-assistant-ui branch from d6aa68d to 7518192 Compare January 25, 2026 17:22
@thewilloftheshadow thewilloftheshadow added the app: web-ui App: web-ui label Jan 26, 2026
@sebslight
Copy link
Copy Markdown
Member

Closing due to merge conflicts that have been unresolved for several days. Please rebase on main and reopen if you'd like to continue with this contribution. We're happy to review an updated PR!

@sebslight sebslight closed this Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor web UI chat interface using assistant-ui

3 participants