nwhitehouse makes attachment chips actually open the document

A small UX fix that turns a dead label into a working shortcut into the doc viewer.

chat-ui

When a user pastes a document into chat, the file's name shows up as a little chip next to their message. On nwhitehouse's fork, that chip used to be decorative - it told you what was attached, but clicking it did nothing. The fix makes the chip behave like the rest of the interface: tap it, and the document opens in the side-panel viewer, the same way the assistant's own document references already worked.

The more interesting wrinkle is the second commit. The same user-message component is rendered from two different chat routes, and only one got the fix initially. Half an hour later, nwhitehouse patched the project-scoped chat route too. A useful reminder that shared components don't automatically inherit every prop their parents pass.

So what Legal-tech product leads: dead-end chips are the kind of friction users stop reporting and start working around - worth checking every route renders the same affordances.

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