Skip to content

fix: mobile tools layout, tools-in-chat preference, cross-client user messages - #14

Open
bmurray wants to merge 1 commit into
daniel-farina:mainfrom
bmurray:fix/mobile-tools-and-cross-client-sync
Open

fix: mobile tools layout, tools-in-chat preference, cross-client user messages#14
bmurray wants to merge 1 commit into
daniel-farina:mainfrom
bmurray:fix/mobile-tools-and-cross-client-sync

Conversation

@bmurray

@bmurray bmurray commented Jul 10, 2026

Copy link
Copy Markdown

Summary

Three related UI/SSE fixes for multi-device and phone use:

  1. Mobile tools pane — On viewports ≤720px the tools column stacked under the chat (up to ~40vh) and made conversations nearly unusable. The side tools column is now hidden on narrow screens; tool cards can live inline in the turn stream instead.

  2. Tools-in-chat preference — Settings → general → “tool calls in conversation” (client-only, localStorage). When on, tool cards render inline in the chat stream on both wide and narrow. When off, they only appear in the desktop tools side panel. Unset default: inline on mobile, side panel on desktop. Toggling re-homes existing tool groups live.

  3. Cross-client blank / ghost user messages — The server already broadcast user_message over SSE, but the browser EventSource client never registered that event name, so remote clients never received the prompt text. The first assistant/tool chunk then called ensureTurn('') and painted an empty “you” bubble (and similar ghosts when late events arrived after a turn ended).

    • Register user_message (and a few related lifecycle events) in KNOWN_EVENTS
    • Do not render a user bubble when text/attachments are empty
    • If an empty shell turn already exists, fill it when user_message arrives

Test plan

  • npm run typecheck
  • npm test (356 pass), including new user_message SSE client coverage
  • Manual: narrow viewport — no stacked tools pane; chat stream fills height
  • Manual: Settings → general → toggle tools-in-chat; cards move stream ↔ side panel live
  • Manual / E2E: two SSE subscribers both receive user_message with full text on /prompt
  • Manual: send from desktop, second device shows full user text without hard refresh
  • Reviewer: smoke on a phone PWA + desktop against the same agent

Mobile was stacking the tools column under the chat and eating ~40vh.
Hide it on narrow viewports and place tool cards by preference instead.

Add a client-only "tool calls in conversation" setting (localStorage)
so inline tool cards can be toggled on wide and narrow. Default stays
responsive (inline on mobile, side panel on desktop) until the user
picks an explicit value.

Cross-client: user_message was never registered on the EventSource
client, so remote browsers never received the prompt text and
ensureTurn('') painted blank "you" ghosts. Listen for user_message
(and related lifecycle events), skip empty user bubbles, and fill an
empty shell turn when user_message arrives late.
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.

1 participant