-
Notifications
You must be signed in to change notification settings - Fork 5
Draft
Conversation
Part of #1466. Citation badges (<cite type="s|r">N</cite> pills) now carry a short excerpt of the passage/document they point to, shown as a custom tooltip on hover or keyboard focus and exposed via aria-label for screen readers. The corresponding entry in the source panel gets a non-scrolling highlight while a badge is hovered/focused, and badges now show a visible focus ring. Scoped to the citation-UI half of #1466 only — the opt-in answer-verification pass from that issue has several open design questions (model selection, persistence, scope) and is left for separate follow-up.
10 tasks
@github-actions
github-actions
Bot
added
documentation
Improvements or additions to documentation
frontend
chat
labels
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of #1466. Extends the existing citation UI (
<cite type="s|r">N</cite>pills rendered byclient/src/utils/citationTransformer.js) with a real hover/focus preview and better accessibility,matching two of the issue's acceptance criteria:
citations.references[].content) or the document's title (fromcitations.resultItems[].titlefor whole-document citations), shown in a small custom tooltip on mouse hover and keyboard
focus (native
titletooltips don't fire on focus, so this is also an a11y improvement, notjust cosmetic).
aria-labelnow includes that excerpt (e.g."Source 1: The sky is blue because of...") instead of a bare"Source 1", so screen reader users hear what acitation actually refers to.
corresponding entry in
CitationPanel.jsx(same ring style already used for click-to-scroll) —but without auto-scrolling or auto-expanding a collapsed passage, so it can't yank the viewport
around. Clicking a badge keeps its existing scroll-and-expand behavior unchanged.
.citation-badge:focus-visiblenow has a visible outline (previouslyonly present in an unused, never-imported CSS string export — the real, wired-up
StreamingMarkdown.csshad no focus-visible affordance at all).Excerpt text is HTML-attribute-escaped and truncated to 160 characters before being embedded.
Scope note
This issue also proposes an opt-in answer-verification pass (a second LLM call flagging
claims not supported by the cited sources) and a citation-format change. Per the implementation
plan already posted on the issue, that half has several open, genuinely blocking design questions
(model selection/cost accounting, persistence across reloads, whether it should also cover
web-search-derived claims) that need a product decision before implementation. This PR intentionally
covers only the citation-UI polish, which needed no such decision — the verification pass is left
as a follow-up.
Test plan
client/src/utils/citationTransformer.test.js(plain-node test, matches this repo'sexisting client-side test convention) covering: excerpt lookup for both citation types,
truncation at 160 chars, HTML-attribute escaping, and the no-citations-data fallback. All 9
assertions pass (
node client/src/utils/citationTransformer.test.js).npx eslinton all changed files — 0 errors (pre-existing warnings only, unrelated to thischange).
npx prettier --writeon all changed files.npx vite buildsucceeds.in this sandboxed session.
Changelog entry added under
docs/releases/5.5.0/features.mdper this repo's convention.🤖 Generated with Claude Code
Generated by Claude Code