Skip to content

feat(chat): responsive one-pane-at-a-time layout on phones - #495

Open
bambinounos wants to merge 3 commits into
shridarpatil:mainfrom
bambinounos:feat/responsive-chat-mobile
Open

feat(chat): responsive one-pane-at-a-time layout on phones#495
bambinounos wants to merge 3 commits into
shridarpatil:mainfrom
bambinounos:feat/responsive-chat-mobile

Conversation

@bambinounos

Copy link
Copy Markdown
Contributor

Problem

ChatView is a fixed three-pane desktop layout: a 320px contact list (w-80) plus the conversation pane. On a phone (~360-400px) the panes can't fit side by side, and the conversation pane can't even shrink to the viewport (the composer's intrinsic width — textarea default size + four fixed buttons — exceeds a phone screen because of flexbox's min-width: auto), so message bubbles and the send button render past the right edge. The app is effectively unusable on mobile, which matters now that agents open it from a phone (PWA or browser).

Fix (template-only, desktop unchanged)

One pane at a time below md (768px), driven by the existing /chat/:contactId route:

  • Contact list: w-full md:w-80, hidden while a chat is open (hidden md:flex). Full-screen list on phones.
  • Conversation pane: shown only while a chat is open (inverse condition) + min-w-0 so it can actually shrink to the viewport (also on the textarea; shrink-0 on the send button).
  • Back button (md:hidden, ArrowLeft) in the chat header → router.push('/chat'), which the existing route watcher already handles. Since chat selection is route-based, Android's back gesture works for free.
  • Notes / contact info side panels become full-screen overlays on phones (max-md:fixed max-md:inset-0 max-md:z-50 max-md:!w-full); both already have close buttons.
  • App shell: h-screen100dvh where supported (supports-[height:100dvh]:h-dvh) — on Android, 100vh includes the area behind the system bars, cutting off the composer's bottom half.

At >=768px the conditional classes reproduce today's classes exactly — desktop is pixel-identical.

Testing

  • Phone (Android, 360-412px wide): list ↔ conversation full-screen navigation, back button and Android back gesture, side panels as overlays, composer and send button fully visible, bubbles inside the viewport.
  • Desktop: no visual change.
  • Verified in production with agents on both desktop and Android (installed PWA).

bambinounos and others added 3 commits July 2, 2026 15:26
On Android (PWA/TWA), 100vh includes the area behind the system bars, so
the bottom row — message textarea and send button — rendered half off
screen. Use 100dvh where supported, keeping h-screen as the fallback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Below md (768px) the contact list and the conversation alternate as full
width views driven by the existing /chat/:contactId route (Android back
gesture works via router history). Adds a back button in the chat header
and turns the notes/contact-info side panels into full-screen overlays.
Desktop layout (>=768px) is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The composer's intrinsic width (textarea default ~20ch + four fixed
buttons) exceeded a phone screen, and flex min-width:auto kept the
flex-1 chat panel from shrinking below it — bubbles (65% of the
oversized panel) and the send button rendered past the right edge.
min-w-0 on the panel and the textarea restores shrinking; shrink-0
keeps the send button at full size.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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