Repository navigation
feat(chat): use the new composer and live answer on the Chat pages - #1835
Conversation
…iles, Help and add-on packs Chat's Wave 1 tables in one PR (one DB PR per wave), behind CHAT_AGENTIC: nothing reads or writes them while the flag is off. Tables, types and the demo's coverage only; the code that uses them comes in the Wave 1 PRs. - 00407: chat_conversations gets shared_at (Share with team: every member of the workspace reads it), last_read_at (unread results), deleted_at (Delete with Undo; deleted chats are hidden from every member) and a title search column; chat_messages gets context_json (what a person's message was scoped to) and a text search column. 'simple' text search, so a chat in any language is found. The author policy now leaves deleted chats out, and a shared policy reads shared ones. - 00408: chat_user_prefs gets the rest of Settings › General and the one-time notices: rail_open, panel_size, default_mode, answer_language, notify_via, show_thought, panel_on_pages, focus_prompted_at, usage_notice_period, legacy_imported_at. - 00409: chat_uploads and the private bucket chat-uploads: 10 MB a file, the composer's 11 types, 5 a message (a trigger backs the server's check), kept 90 days. - 00410: chat_tool_cache (a chat's read results by tool and scope, server only) and each step's and model call's measure: latency, cache hit, truncation, result tokens on chat_run_steps (never granted to members), prompt cache read/write tokens and latency on the ledger. - 00411: chat_files (filed deliverables and saved answers, the workspace's, kept a year, searchable by title, summary and tags), chat_file_task_links, chat_storage_usage kept by a trigger, and the private bucket chat-files. - 00412: help_answer_cache and help_gaps (server only, no workspace or person ids). - 00413: add_on_products seeded with the owner's packs (AI credits $10, $50, $250, $1,000 at half their price in budget, 12 months; storage +25/+100/+250 GB at $5/$15/$29 a month; $50 and +25 GB Most picked), add_on_purchases (Admins read), ai_credit_grants and storage_grants (server only), and prompt_improve_usage.grant_id. Members only ever read; every write is the server's. Tool names, tool results and dollars stay server only. web/src/types/supabase.ts carries the new tables and columns; schema.test.ts checks the policies, the server-only tables, the limits and the seeded packs from the SQL; steps.test.ts keeps the step measure out of the member columns. The demo coverage skips chat_files and chat_tool_cache (a person's own Chat work). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Behind CHAT_AGENTIC; with it off, the Agent page and its menu link stay as
they are today.
- /dashboard/agent and every path under it answer a 301 to the matching
/dashboard/chat path, query kept, where the new Chat is on for the
person's workspace (CHAT-01 item 2). Sent with no-store, so turning the
flag off again takes effect at once. The sidebar and mobile menu link
Chat straight to /dashboard/chat.
- The chats API (CHAT-01 §1-3, 7-8, 26): GET /api/chat/conversations lists
the person's chats and the team's shared ones (or their archived ones),
newest first, with each row's brand name, dot and live step in words, and
the Chats / Archived counts; POST starts an empty chat; GET .../{id} opens
one with its messages and steps; DELETE stops a running agent, then hides
the chat for everyone; .../restore is the Undo (one minute); .../read
marks its result read for the author. Refusals come back as values
(ansvisor#1777), never thrown.
- A chat that isn't there, was deleted or isn't shared says "This chat isn't
available." with New chat (item 26); opening one marks it read.
- The engine and access requests read chats with the service role, so they
now leave deleted chats out too (ansvisor#1812 note).
- Help: a "chat" area and its first article (approved: false).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Behind CHAT_AGENTIC; with it off the Chat pages have no frame, as today. - Every Chat route now sits in a shell (CHAT-01 items 5, 9a-9f; CHAT-23 G1): the 256px chat menu beside the page and a 52px header with the open chat's title and status pill, and the runs tray. - The menu, top to bottom: the toggle and New chat (Ctrl+Shift+O / ⌘⇧O); Menu with Home and the count of what needs the person; Governance with Activity, What Chat can do and Tool policy (the governance mockup's menu); Agents at work (needs you, running, unread results: three rows, See all / Show less, the dots' legend); Chats with its count, Pinned, Today, Yesterday, Previous 7 days, Previous 30 days, then by month, in the person's own time zone. Rows show the dot, the title (bold while a result is unread), the live step or the result's time, or the brand, and a teammate's initials on a shared chat. Items whose pages aren't built yet stay out (Inbox, Settings, Skills, Integrations, Scheduled, Files, Search, All chats, Archived). - The toggle and Ctrl+\ (⌘\) hide or show the menu and keep the choice on the person for every device (chat_user_prefs.menu_open, a server action that answers as a value, ansvisor#1777). Hidden, the header starts with a strip: toggle, New chat, runs pill. Below 1100px the menu is a drawer that leaves the saved choice alone. Ctrl+B stays Bold. - The list is read from the chats API, again on each page change, every 5 s while a chat works or waits and every 30 s otherwise. - Thin, quiet scrollbars for Chat's lists (chat-scroll). - Help: the chat menu and how to hide it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ete with Undo
Behind CHAT_AGENTIC, like the rest of the Chat shell.
- PATCH /api/chat/conversations/{id} `{ pinned?, title?, shared?,
archived? }`: the author's own chat only (else 404), a trimmed title of
1 to 200 characters, answered as a value (ansvisor#1777).
- Each chat row's ⋯ (CHAT-23 chatMenu.rowMore, G9), on hover and focus:
Open, Open in new window, then for the author Pin / Unpin, Rename,
Share with team / Stop sharing, Archive, and Delete for the author or an
Admin on a shared chat. A teammate's shared chat only opens.
- The open chat's ⋯ in the header (G10): Chat settings, Open in new
window, Pin, Rename (in the title), Share with team, Export chat, Activity
log, Archive, Delete. Export chat is shown disabled ("Coming soon"):
wiring it to the answer exports is left to W1-25.
- Rename edits the name in place, in the row or the header: Enter or
clicking away saves, Esc cancels; double-clicking a row's title starts it.
- Every change shows at once and is then sent; a refused one is put back
with "Couldn't save that". Archive's toast and Delete's (10 s) carry
Undo; Delete asks first ("Delete this chat?", focus on Cancel, a red
Delete), stops a running agent, and leaves the open chat for Chat Home.
- A pinned chat shows the pin where its dot is.
- Help: managing and sharing a chat.
Split view, Pause / Stop run, Schedule this and Save as agent come with
their pages (Wave 2 and 4).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…heir initials Other members' profiles are hidden from the person by their policy, so a teammate's shared chat showed no initials. Read with the service role, kept to the person's workspace, for the name only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Behind CHAT_AGENTIC, like the rest of the Chat shell.
- Chat Home (CHAT-01 items 10-12, mockup #s-home): "Good morning /
afternoon / evening, {first name}" by the person's own clock (switching
at 12:00 and 18:00; no name, no comma), then one line: "Your agents
worked while you were away. N things need you." linking to the Inbox, or
"All caught up.". The composer stays below it.
- The Action Center line (item 12, CHAT-09 item 3): "N Action Center tasks
are due this week" (singular at 1, hidden at 0): the active brand's open
actions due by Sunday, overdue ones included, read as the person by a
server action that answers as a value (ansvisor#1777). Complete with Chat asks
Chat to complete this week's tasks in a new chat and opens it while the
run goes on.
- The Inbox at /dashboard/chat/inbox (mockup #s-inbox): what needs the
person (Review), what runs (its progress, Watch) and unread results
(Open), with "1 needs you · 1 running · 1 done today"; a row opens its
chat; one line when empty.
- The chat menu gets Inbox, with its count and an amber dot while
something needs the person (also beside Menu when folded), and the
collapsed strip gets an Inbox button, as in the mockup.
- Help: Chat Home and the Inbox.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… and a read-only view Chat Wave 1, W1-10 (CHAT-02, agentic update). A copy of the mockup's composer (compHTML), as components to be wired into the Chat pages by the shell (W1-01). - ChatComposer: the box, a toolbar with the run mode and Send, and the line under it. Variants: home (2 rows), dock and panel (1 row). The box grows to 240px, then scrolls. - Enter sends, Shift+Enter adds a line. Enter during an input method's composition or on a touch screen is the box's own (composerKeyAction). Send is off for an empty box. - While a run answers, Send is Stop, and Esc stops too. The box steers: "Steer while I work…". Enter stops the run, its done steps kept, and sends the text as the next message (onSteer; decided 2026-10-30). The line under reads "Enter stops this run and sends your message". A page without steering keeps the text until the run ends. - ModeSwitch: Ask me first · Auto, ask before changes · Full auto, each pick with the mockup's toast. Full auto below Growth is locked: "Needs Growth", and it can't be picked. - Analysts and Agency partners read only: no mode switch, a "Read-only · Analyst" link to Your access, and "@ data · read-only" under the box. - The model button reads "Auto · Haiku reads, Sonnet writes". Slots for the + / @ tools (W1-12) and the usage meter (W1-23). - The Chat pieces preview gets a Composer section: home, a dock with a pretend run, and an Analyst's panel. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…poser
Chat Wave 1, W1-11 (CHAT-02 items 5–10c), on the composer (W1-10).
- Context chips above the text: what Chat looks at, by name ("Ansvisor",
"Last 30 days"), never an ID. A label over 28 characters is cut, with the
whole name in its tooltip. × asks the page to drop it for the chat
(onRemoveChip). A send or a steer carries the chips left
(onSend(text, { context })).
- One ghost suggestion in the empty box, dim, with a Tab key hint. Tab, or a
click on it, makes it the text with the cursor after it. Typing replaces
it, and it comes back when the box is empty again. It never sends by
itself: while only it shows, Enter does nothing and Send stays off. With
text, Tab moves on as usual. No ghost while a run answers. The page picks
the suggestion: the variant's starter, then a clear follow-up, and a READ
one for Analysts and Agency partners.
- The line under reads "Tab to accept · / skills · @ data" while the ghost
shows.
- The preview's composers get the mockup's chips and starters.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Chat Wave 1, W1-12 (CHAT-02 items 11–17, agentic update; mockup #slash,
#atmenu, #plusmenu), on the composer's chips (W1-11). Menus open above the
box: ↑ ↓ move, Enter picks, Esc closes and keeps the text, and a click
outside closes them.
- /: typed first in an empty box, or from the / button. It lists Wave 1's
shortcuts, which start a message: /analyze "Analyze", /report "Create a
report on", /create "Create content for". Typing filters them by command
or a word of the name. From the button, the box's text stays after the
starter. Analysts and Agency partners have no / (as the mockup). Skills
join the menu in Wave 2.
- @: typed at the start of a word, or from the @ button at the cursor. It
references data: the page's own charts and metrics first (references,
for W1-08), then the brand's matches (searchReferences), up to eight. A
pick leaves the "@…" text and shows as a chip by name. × takes it off,
and the send carries it (references: type, id, label, scope). No ID
shows.
- searchChatReferences (server action, CHAT_AGENTIC): the brand's tracked
prompts, its pages and its open Action Center tasks that match, a source
at a time. Read with the person's session; site_pages isn't in the
generated types, so it is read with the service role for a brand the
session can read. Template tasks are named from their keys. A search is
made safe for PostgREST's filters. It answers { ok, failure } and never
throws (ansvisor#1777).
- +: Attach files when the page uploads (onAttach, W1-13). Connect a tool:
Settings › Integrations for an Admin; for others, "Ask your Admin to
connect" sends one access request (B2). Read a page and Create an image
stay hidden until their waves.
- The preview's composers reference the mockup's chart, metric, table,
page and task.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… Data used and its stamp Chat Wave 1, W1-14 (CHAT-03 items 12a–14, the v2 timestamps), on the composer's menus (W1-12). RunAnswer draws an answer from its run's events, with the shared pieces (D1/D2): - The agent works beside it (AgentAvatar), waits on the person, or is still. - One status line, updated in place, in the running step's words: "Reading Citations…", "Opening ansvisor.com/pricing…", "Checking facts…". With no step running, "Writing the answer…" while text streams, else "Thinking…". "Reconnecting…" when the stream dropped. - The steps under their header (RunSteps). Each step done, thinking left out, is a ✓ chip with its rows, and a click shows its detail. W1-21's "Checked facts" step (ansvisor#1822) is one of them. - The answer streams in (Markdown). - "Data used": one chip per source a read step read, with its largest row count, and per page a step opened. Skills, thinking, checks and failed reads are no source. The header counts these chips as its sources. - "Generated Oct 30, 2026 · 09:14 · Data as of …" in the person's time zone, the GMT offset in its tooltip. - What follows (next moves, the answer's actions) fades in once the run is done, and not at all with reduced motion. - run-view.ts holds the status line, chips and Data used, from the steps alone. - The Chat pieces preview plays the mockup's answer a step at a time ("Live answer"); its counts take the new pieces in. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… days
Chat Wave 1, W1-13 (CHAT-02 items 18–22, 00409), on the live answer
(W1-14), behind CHAT_AGENTIC.
- The composer attaches files from + Attach files, a drop or a paste
(uploader prop). Each file is a chip: type tag, name, "Uploading…", ×.
Under the box: "This file type isn't supported.", "Files must be 10 MB or
smaller.", "You can attach up to 5 files.", or "Upload failed." with
Retry. Send waits while a file goes up, and a send carries the ready
files' ids (ComposerSend.attachments).
- lib/chat/uploads.ts holds the rules the bucket and table also hold: the
listed types (a type from the extension when the browser gives none),
10 MB, 5 files.
- Server actions (chat-uploads.ts), which answer { ok, failure } and never
throw:
- prepareChatUpload checks the type, the size, Chat on, an active plan
and the person's own chat. It keeps a pending row
({organization_id}/{id}) and gives a one-time upload address.
- finishChatUpload marks the file ready once it is there.
- removeChatUpload takes a draft's file and row away.
- Named in the subscription guard's open actions with why.
- lib/chat/upload-client.ts sends the file to its address. A failure takes
its row back, so Retry starts over.
- startChatRun takes attachmentIds (up to 5). Each must be the person's
own, ready and not sent with another message, checked before anything is
kept; then the files are linked to the message and its chat. Reading
attachments in the run is CHAT-04's work.
- Server: sweepExpiredChatUploads deletes each attachment past its 90 days,
file first, then row, in the daily run.
- The preview's home composer attaches files that are "up" after a moment.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Chat Wave 1: lane A's pages (W1-01…05) with lane B's composer and answer (W1-10…14), merged and joined. The engine's test page goes. - ChatThreadView (components/chat) carries the test view's run handling: send, streaming, reconnecting from the last event, Approve/Skip and Stop. ChatComposer and RunAnswer now draw it, with D2's approval and denial cards under each answer. Chat Home uses the home composer (2 rows); an open chat docks it under the messages. - The composer starts in the person's default mode (chat_user_prefs; a saved Full auto the plan no longer opens starts as Auto). Full auto opens as the plan facts say (chatComposerSetup). - Steering stops the run, then sends the text as the next message (decided 2026-10-30). - @ searches the chat's brand (searchChatReferences). Files go up with uploadChatFile and go with the message as attachmentIds. - A teammate's shared chat is read only: the box says so, with Start your own chat (loadChatThread's new `mine`). - The test page's title and box go, with their unused chatPage strings. - Help: chat.md covers asking, the modes, Stop and steering, shortcuts and your data, attaching files, and watching the work. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…workspace Creating an empty chat, deleting, restoring and marking your own chat read start no cost; a chat's first message is a run, which the engine refuses with 402. The read-only coverage test lists them with that reason. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…read-only workspace Co-Authored-By: Claude Opus 5.5 <[email protected]>
…workspace Co-Authored-By: Claude Opus 5.5 <[email protected]>
The × button unmounts with its chip, so a keyboard user lost their place (focus fell to the page body). Focus the message box after removing a chip. Claude-Session: https://claude.ai/code/session_0121amRjX7UFrgmGELAtkc7A
# Conflicts: # web/src/components/chat/composer/chat-composer.tsx
…e clock with each list read A teammate's shared chat that waits on its author's OK no longer shows under Agents at work or in Home's count. A chat that waits on an OK or is paused no longer keeps the list on the 5 s pace. A menu left open past midnight now moves Today's chats to Yesterday on the next list read.
A person reads only their own profile, so the author's name came back empty on every teammate's shared chat. Read it on the server, within the workspace; only the initials leave.
…count A shared chat that waits for approval waits on its author, who alone can answer it. The Inbox, its counts in the menu and the strip, and Home's "things need you" now count the person's own chats only.
PostgREST reads * as % in like and ilike, so "@price*list" matched anything between the two words. Strip it with the other pattern characters. Claude-Session: https://claude.ai/code/session_0121amRjX7UFrgmGELAtkc7A
…s) into take-1835
…nswer A read step whose words aren't "Read …" (the app's own "Opened a page" from the page router) read no source: it no longer shows as a Data used chip or as "Reading Opened a page…". The answer's Markdown links only http(s) addresses (in a new tab) and pages of the app, and shows an image as its alt text. Claude-Session: https://claude.ai/code/session_0121amRjX7UFrgmGELAtkc7A
…hen its bytes are that type - upload-client: a File goes up as a form part with the browser's type, not contentType, so a .md the browser gave no type reached the bucket as application/octet-stream and was refused. It now goes up as a File with the type the app named. - finishChatUpload: ready only when the object is there with the type it was prepared for, at most 10 MB, and its first 1 KB is that type's (contentMatchesType: %PDF-, zip, PNG/JPEG/WebP signatures, no NUL in text). The row keeps the bucket's size. A file that fails the check is deleted at once instead of waiting 90 days. Claude-Session: https://claude.ai/code/session_0121amRjX7UFrgmGELAtkc7A
…it, and steer only after Stop is taken The composer's Full auto now follows the same facts the approval check uses: the plan, and for anyone but an Admin the Admin's Full auto for members switch. When the switch closes it, the mode says Off by Admin rather than Needs Growth. Steering sends the new message only once the Stop is taken; otherwise the text stays in the box.
…ew fix) into take-1835
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good with 3572464: this PR, merges of #1828's and #1832's new heads, one fix commit (d9c4aac, described below), and merges of the fixed #1833 and #1834 branches. On the result, tsc is clean and src/lib/chat, src/components/chat and plan-row.test.ts pass (535 tests).
I reviewed only what this PR adds on top of its stacks: ddbebf3 (the wiring) and the two stack merges (7473d18, ca435dd). Neither merge carries extra changes. The scope is ChatThreadView, the two Chat pages, chatComposerSetup, loadChatThread's mine, the shared-chat line in the composer, the removed test view and strings, and the Help article. There's no migration, no new route or server action, and no new embed.
What I checked
- Flag off: both pages still call
notFound()before anything else unlessCHAT_AGENTICis on for the workspace.chatComposerSetup()runs only after that check. With the flag off, nothing changes. - Sending: the body is the same as the test view's, plus
attachmentIds. The server checks each attachment (the person's own, ready, not sent yet), the chat (the person's own, not deleted) and the brand (in the workspace). A refused send takes back both the question and the answer placeholder, and the composer puts the text back. Tested. - Shared chat:
minecompareschat_conversations.user_idwith the signed-in user. A teammate gets the read-only line and Start your own chat. On the server,startChatRunonly takes a chat withuser_id = actor, so a hand-made send into a teammate's chat is refused anyway. - Read-only workspace:
POST /api/chat/runsanswers 402 and the view opens the upgrade dialog, keeping the text. Theediting your own chatentry inOPEN_ROUTES(from #1831) matches what the PATCH route does.subscription-guard-coverage.test.tspasses. - Steer and the queue: Stop moves the run to
stoppedin the database straight away, even when another instance drives it, andchat_claim_run_slotcounts by that status. So the steered message gets a slot and doesn't sit in the queue behind the old run. The old driver notices the Stop within about 1.5 s and only writes to its own answer. - Build:
_chat-page-access.tsis imported only by the server pages.chat-thread-view.tsximports only client-safe modules and server actions.plan-row.test.tspasses, and so doesnext build.
What the fix commit changes
- Full auto shows open where the server will still ask.
chatComposerSetupopens Full auto from the plan alone. When an Admin turns off "Full auto for members" in Settings › Chat, a Manager still sees Full auto open and can pick it. Then the precedence check (full_auto_off) turns every change into a card. A saved Full auto default also kept starting as Full auto for that Manager. The fix reads the same facts the approval check uses (readPrecedenceContext: role, plan, Chat settings). Full auto is open whenplan.fullAuto && (role === 'admin' || settings.fullAutoForMembers). When the Admin's switch is what closes it, the mode says Off by Admin (with a title naming Settings › Chat) instead of Needs Growth. The Help article says the Admin can turn it off. - Steer sends even when Stop wasn't taken.
onSteerawaitedstop()and then sent, whatever Stop answered. If Stop fails (a network error or a 5xx), the new message starts a second run in the same chat while the first is still answering. Nowstop()returns whether the Stop was taken. If it wasn't, steer shows "Couldn't send that. Try again." and the text stays in the box.
Tests: _chat-page-access.test.ts covers a Manager with the switch off, an Admin, a Manager with the switch on, the plan lock, and facts that can't be read. chat-thread-view.test.tsx covers a failed Stop (nothing sent, text kept) and the Off by Admin label. All 6 fail without the fix.
Follow-ups (none block)
- A teammate's shared chat with a run under way. The resume effect clears the answer and then reads
/events, which answers 404 to anyone but the owner. The answer then stays empty. Approve / Skip on a waiting run's card also show for the teammate, and the server refuses them. For!thread.mine, skipping the resume and showing the cards without their buttons would fit the read-only view. - Read-only workspace before typing. Today the upgrade dialog opens on send. A line (or
disabledwith a reason) from the plan facts would say so before the person types. - @ search in a chat with no brand falls back to the active brand, while the run itself has no brand. That's fine while references don't reach the engine (CHAT-04). Worth a look when they do.
Merging
- The PR head (ca435dd) merges clean on current main (merge-base a8121a6, main's tip).
- On the base PRs' new heads: #1828 (602a4e2, which carries #1827's fix), #1832 (7ebe5d3, which carries the #1829–#1831 fixes) and #1833's fix branch merge clean. On their own, #1827's head conflicts in
chat-composer.tsx, and #1829, #1830 and #1831's heads conflict inlib/chat/conversations.tsand its test. Those conflicts are already resolved inside #1828 and #1832, so merging those two brings them in cleanly.
Tests
On the PR merged with #1828's and #1832's new heads, plus the fix and #1833's fix branch:
components/chat,components/agentic,components/ui,lib/chat, the Chat pages,lib/guards(plan-row.test.ts),subscription-guard-coverage,api/chatand Help validation: 55 files, 679 tests, all pass.tsc --noEmitis clean, and eslint and Prettier are clean on the touched web files.next build(webpack, dummy env): passes.
…ew fixes) into take-1840 # Conflicts: # web/src/app/[locale]/(dashboard)/dashboard/chat/_chat-page-access.ts # web/src/components/chat/chat-thread-view.tsx
…ts review fix) into take-1841
…svisor#1833 and ansvisor#1834 fixes) into take-1843 # Conflicts: # web/src/app/[locale]/(dashboard)/dashboard/chat/_chat-page-access.test.ts # web/src/app/[locale]/(dashboard)/dashboard/chat/_chat-page-access.ts # web/src/components/chat/chat-thread-view.tsx # web/src/components/chat/composer/chat-composer.test.tsx
…isor#1838 heads and its review fix) into take-1843 # Conflicts: # web/src/app/[locale]/(dashboard)/dashboard/chat/_chat-page-access.test.ts # web/src/app/[locale]/(dashboard)/dashboard/chat/_chat-page-access.ts # web/src/components/chat/chat-thread-view.tsx
review fixes) into take-1857 Conflicts: the layout keeps the Get more provider around ansvisor#1844's lazy side panel slot; answers keep the prose styling with ansvisor#1844's safe link and image rules; chatRunsOnOwnKey follows ownKeyAccess (Enterprise, or a kept key's 30 days), as ansvisor#1851 changed the rule.
gkhngyk
left a comment
There was a problem hiding this comment.
Merging in order with the other approved Chat PRs. This head merges current main; where they overlapped, both sides are kept. Its tree is what main will be after this squash, checked with the full server and web suites, tsc, lint, format and next build. Chat stays behind CHAT_AGENTIC.
Summary
Chat Wave 1: put the approved composer and live answer into the real Chat pages, behind
CHAT_AGENTIC. The product owner saw the wired pages in a local preview and approved them.Stacked on #1832 (W1-05) and on #1834 (W1-13). The branch is a plain merge of both stack tips (no conflicts), plus one wiring commit. Its diff against main includes both stacks until they merge.
What it changes (ddbebf3)
components/chat/chat-thread-view.tsx(ChatThreadView): the old test view's run logic moves here: send, the SSE stream, reconnect from the last event, Approve / Skip and Stop.ChatComposerandRunAnswerdraw it, with D2's approval and refusal cards inRunAnswer'scards. The paused-at-cap card and error lines are there too./dashboard/chat:ChatHome+ the composer (variant="home", 2 rows)./dashboard/chat/[id]:variant="dock"(max 760px, sticky at the bottom)._chat-test-view.tsx, the "test page" heading and its unused strings are removed._chat-page-access.ts→chatComposerSetup()): the default mode comes fromchat_user_prefs.default_mode. Full auto is open perplanFactsFromOrgRow(org).fullAuto; a saved Full auto that isn't open any more starts as "Auto, ask before changes".POST …/stop, then the new message.searchChatReferenceson the chat's brand, else the active brand.uploadChatFile/dropChatUpload; sending passesattachmentIds.loadChatThreadreturnsmine. A teammate who opens someone's shared chat sees "A teammate shared this chat with you: you can read it, not add to it." and Start your own chat instead of the composer./dashboard/chat/{id}(replaceState).help/chat/chat.mdgains Ask Chat (with modes), Stop or steer, Shortcuts and your data, Attach files and Watch the work. Sharing describes the read-only view.Known limits:
startRunInputhas no fields for them). Page context is W1-08 and reading them is CHAT-04, so ghost and chips start empty.Related issue
Part of Chat (Wave 1).
Type of change
feat— New featureHow to test
CHAT_AGENTIC=trueand an AI key, ask a question on/dashboard/chat.chat-thread-view.test.tsxcovers a send from Home (mode and brand in the body, streaming answer, stamp, URL), a refused send giving the text back, steer stopping then posting, and a shared chat being read-only. Withcomponents/chat,lib/chat, the chat pages, Help validation and the conversations route: 43 files, 538 tests.Checklist
🤖 Generated with Claude Code