Chat: one phone header button, quick-prompt chips, double-click to reuse a message

The phone header carries a single speech bubble: Control on Home, the
assistant elsewhere. Chips above the input offer the user's most sent
messages per tab, then starters; a tap or a double-click on a sent or
heard message fills the input without sending.

Claude-Session: https://claude.ai/code/session_01SSi5AvZ7pFmySK8zy3NPMh
This commit is contained in:
2026-10-27 17:39:36 +01:00
parent 79142b16d8
commit e487588710
7 changed files with 444 additions and 85 deletions
+5 -26
View File
@@ -1,23 +1,16 @@
import { useQuery } from "@tanstack/react-query"
import {
createFileRoute,
Outlet,
redirect,
useRouterState,
} from "@tanstack/react-router"
import { Bot } from "lucide-react"
import {
aiStatusQueryOptions,
ControlTrigger,
} from "@/components/Chat/ChatPanel"
import { chatStore } from "@/components/Chat/chatStore"
import { ChatTrigger } from "@/components/Chat/ChatPanel"
import { ConnectionNotice } from "@/components/Common/ConnectionNotice"
import ErrorComponent from "@/components/Common/ErrorComponent"
import { Footer } from "@/components/Common/Footer"
import { useFlowSocket } from "@/components/Flow/useFlowSocket"
import AppSidebar from "@/components/Sidebar/AppSidebar"
import { Button } from "@/components/ui/button"
import {
SidebarInset,
SidebarProvider,
@@ -45,8 +38,6 @@ function Layout() {
// here rather than only inside the editor.
useFlowSocket()
const home = useRouterState({ select: (s) => s.location.pathname === "/" })
// Gated as the sidebar's entry is: with no provider there is nothing to open.
const assistant = useQuery(aiStatusQueryOptions())
return (
<SidebarProvider className="bg-card">
@@ -56,25 +47,13 @@ function Layout() {
served through a portal: it raises the offline notification. */}
<ConnectionNotice />
{/* The sidebar carries its own collapse control; a phone has no
sidebar on screen to carry it. Home's chat sits opposite, where
the brain view has it on a wider screen, and the assistant in the
corner, one tap away rather than behind the sidebar sheet. */}
sidebar on screen to carry it. The chat sits opposite, one tap
away rather than behind the sidebar sheet: Home's conversation
with the house, the assistant anywhere else. */}
<header className="sticky top-0 z-10 flex h-16 shrink-0 items-center gap-2 px-4 md:hidden">
<SidebarTrigger className="-ml-1 text-muted-foreground" />
<div className="-mr-3 ml-auto flex items-center">
{home ? <ControlTrigger className="size-11" /> : null}
{assistant.data?.available ? (
<Button
variant="ghost"
size="icon-touch"
className="text-muted-foreground"
onClick={chatStore.toggle}
aria-label="Assistant"
title="Assistant"
>
<Bot />
</Button>
) : null}
<ChatTrigger tab={home ? "control" : "build"} />
</div>
</header>
<main className="flex-1 p-4 sm:p-6 md:p-8">