Skip to content

feat(site/src): render fork search_chats and read_chat_transcript calls as cards - #97

Merged
ibetitsmike merged 3 commits into
mainfrom
mike/fork-tool-cards-2-transcript-search
Nov 10, 2026
Merged

ibetitsmike merged 3 commits into
mainfrom
mike/fork-tool-cards-2-transcript-search

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Xum opened this PR on behalf of @ibetitsmike.

Part of #74 (second of three PRs, after #87).

With fork-chat-todos on, search_chats and read_chat_transcript tool calls rendered as the generic JSON row. They now render as cards built on the #87 hooks:

  • search_chats: "Found 3 chats" (or "Found 1 chat", "No chats found"), expandable to the query and one link per chat with its title, status and whether it is shared with you. "More chats available" shows when the result has more pages. While the call runs, "Searching chats…" shows the streamed query.
  • read_chat_transcript: "Read 4 messages from ", expandable to a link to that chat and one line per message: its role plus a one-line preview of its first part (text, or the tool name of a tool call or result), with a count of parts the tool omitted. "More messages available" shows when the result has more pages.
  • A failed call reads "Failed to search chats" or "Failed to read chat transcript", with the tool's error as the expandable detail.
  • A result the card cannot parse falls back to the generic row.

Links keep the current query string, like the list_agents card. With the experiment off, rows look exactly like upstream.

This PR touches no upstream file: it adds the two cards, registers them in forkToolRenderers.tsx, adds their icons (SearchIcon, MessagesSquareIcon) to forkToolIcons.ts, and adds their rows to forkToolShowcaseItems. Both cards render chat links through a new ForkChatLink, and all three fork cards (the todo card included) read a failed call's error text through forkToolErrorMessage. The result shapes match coderd/x/chatd/fork_search_chats.go and fork_chat_transcript.go.

Tests

  • ForkSearchChatsTool.stories.tsx and ForkChatTranscriptTool.stories.tsx: Found or Read, Running or Reading, Empty, HasMore, Failed, ExperimentOff, UnparsableResult. Visual states only, for Pixel. The results they render are MockSearchChatsResult and MockChatTranscriptResult in testHelpers/forkChatTodos.ts, which the showcase rows reuse.
  • The existing collision and icon-coverage tests derive their expectations from createForkToolRenderers, so they cover the new names.

Local: pnpm lint, tsc, unit Vitest for ChatElements/tools (301 tests), Storybook Vitest for both new story files plus ForkTodoTool.stories and Tool.stories (180 tests).

UAT

Dev frontend at this head against a local fork server with fork-chat-todos, a member chat on a real model making real calls (no seeded rows). With the flag on, search_chats with title:W9 shows "Found 4 chats" expanding to the query and four chat links, and read_chat_transcript with limit 4 shows "Read 4 messages from W9 todo tool cards" expanding to the chat link, four message lines and "More messages available". Checked in dark and light themes. A second chat makes both calls fail: an unknown chat ID shows "Failed to read chat transcript" with the server's "does not exist or your user cannot read it" error, and status:bogus shows "Failed to search chats" with the invalid-query error. With the experiment list served without fork-chat-todos, the first chat shows upstream's generic rows.

@ibetitsmike ibetitsmike changed the title feat(site/src/pages/AgentsPage): render fork search_chats and read_chat_transcript calls as cards feat(site/src): render fork search_chats and read_chat_transcript calls as cards Nov 10, 2026
@ibetitsmike
ibetitsmike marked this pull request as ready for review November 10, 2026 04:10
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum acted for Mike.

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T04:26:00.040376Z c8f59f5 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4e684b03f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum acted for Mike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: c8f59f5dc8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) closed and reopened this on behalf of @ibetitsmike.

Closing and reopening only to make GitHub recompute the merge ref against current main (55651602b0) and run fork-ci on it. The head is unchanged.

@ibetitsmike ibetitsmike reopened this Nov 10, 2026
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) closed and reopened this again on behalf of @ibetitsmike.

The merge ref now points at current main (55651602b0), but the run started by the first reopen was queued against the old merge ref. This second reopen starts fork-ci on the recomputed merge. The head is unchanged.

@ibetitsmike ibetitsmike reopened this Nov 10, 2026
@ibetitsmike
ibetitsmike merged commit 642cab8 into main Nov 10, 2026
20 of 27 checks passed
@ibetitsmike
ibetitsmike deleted the mike/fork-tool-cards-2-transcript-search branch November 10, 2026 04:53
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) merged this on behalf of @ibetitsmike.

Merge evidence for head c8f59f5dc8cf4a270aeb8e016efad90b771195b5:

  • fork-ci pull_request run 42756953208 passed; its build job checked out Merge c8f59f5dc8 into 55651602b0 (current main). All checks green. Run 42755199113 had also passed on this head.
  • Codex round 2 on this exact head: no major issues (comment 6758958774). Round 1's single P2 (the more-messages hint was hidden on an empty filtered transcript page) is fixed in this head with an EmptyPageHasMore story; the thread is replied to and resolved. 0 unresolved review threads. Merge state CLEAN.
  • Frontend deep review fixes are in d4e684b: a shared ForkChatLink and forkToolErrorMessage (the todo card uses it too), Mock*Result fixtures, inlined gates, optional chatId/title, a flat preview chain and singular "1 part". Deliberately not changed: typing role and status as generated unions (an unknown value would break the card), the opacity-50 link look copied from upstream's ListAgentsTool, and the index key on a static list.
  • UAT PASS against a dev frontend proxying to the UAT server, as a member user with real model calls and no seeded rows. Flag on: "Found 4 chats" expands to the query and 4 chat links; "Read 4 messages from ..." expands to the chat link, 4 message lines and "More messages available". Dark and light themes both checked. Error cases show "Failed to read chat transcript" with the server's not-found error and "Failed to search chats" with the invalid status error. Flag off: upstream's generic tool rows. Re-shot at this head.
  • Local at this head: tsc, pnpm lint, tools unit tests (301), and stories for the new cards plus Tool and ForkTodoTool. The 11 changed files are all fork-owned files under site/; no upstream file is touched.

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