Attachment chips in user messages now open the doc viewer

nwhitehouse fixes a silent UX gap: the filename chips shown next to a user prompt were display-only. Two commits make them clickable when a `document_id` is present, with the second commit catching a missed render path.

chat-ui

The first commit (e67b072f) adds an onOpenDocument prop to UserMessage and conditionally renders each chip as a <button> when both document_id and the handler are present. Clicking opens the side-panel doc viewer via the same openDocument call the assistant's "Read " blocks use. versionId is left null at the chip level; DocView resolves to the document's current version at view time.

The second commit (4f480f20) came 30 minutes later. UserMessage is rendered from two routes - /assistant via ChatView and /projects/[id]/assistant/chat/[chatId] directly - and only ChatView got the handler in the first pass. The project chat page needed the same wire-up.

That missed-route pattern is the thing to remember when porting. Any component rendered from multiple top-level routes needs the handler passed from each one. It's easy to test one and assume coverage.

So what Worth pulling if your fork shows attachment chips in user bubbles. The change is small. Check how many routes render `UserMessage` before applying - this fork hit exactly that problem.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

2 commits from nwhitehouse/mike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
e67b072f [bug] Make user-message attachment chips clickable to open the doc Nick Whitehouse 2026-05-06 ↗ GitHub
commit body
The chip in the user bubble (e.g. "sek-1300000000-eur-..." next to a
prompt) showed the filename but had no affordance - clicking did
nothing. Now renders as a button when document_id is present and an
onOpenDocument handler is wired, opening the doc in the side-panel
viewer (same path as the assistant's "Read <filename>" block uses).
versionId is left null at the chip level - DocView resolves to the
document's current version.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4f480f20 [bug] Wire chip-click on the project chat page too Nick Whitehouse 2026-05-06 ↗ GitHub
commit body
UserMessage is rendered from two routes - /assistant via ChatView
and /projects/[id]/assistant/chat/[chatId] directly. The previous
chip-click commit only wired ChatView; in-project chats were the
common case and showed no effect. Both surfaces now pass
onOpenDocument so the attachment chip opens the doc viewer
regardless of route.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-109.md from inside the repo you want the changes in.

⬇ Download capture-thread-109.md