Skip to content

feat(web): add span-level citation UI — popovers, source highlight, inline markers (#450)#818

Merged
manavgup merged 3 commits into
mainfrom
worktree-agent-acf2f732
May 25, 2026
Merged

feat(web): add span-level citation UI — popovers, source highlight, inline markers (#450)#818
manavgup merged 3 commits into
mainfrom
worktree-agent-acf2f732

Conversation

@manavgup
Copy link
Copy Markdown
Owner

Summary

  • Layer 1: Citation markers [N] on each Key Claim in ClaimsPanel — click to show popover with verbatim source quote, locator info, and "View in source" link
  • Layer 2: SourceHighlightPanel replaces right sidebar on citation click — shows full source content with cited span highlighted in amber, auto-scrolls to match
  • Layer 3: Inline [src] markers in article markdown body next to confidence badges — connects reading experience directly to source verification

New components

  • CitationContext.tsx — React context for active citation state
  • CitationPopover.tsx — hover/click popover with source quote
  • InlineCitationMarker.tsx — inline superscript citation button
  • SourceHighlightPanel.tsx — right sidebar source preview with highlight

Test plan

  • Open an article with Key Claims → verify [N] markers appear on each claim
  • Click a citation marker → popover shows source quote and locator
  • Click "View in source" → right sidebar shows source content with highlighted span
  • Verify auto-scroll to highlighted text
  • Click "Back to article" → returns to article outline sidebar
  • Verify inline [src] markers appear next to (sourced) badges in article body
  • TypeScript and ESLint clean

🤖 Generated with Claude Code

@github-actions github-actions Bot force-pushed the worktree-agent-acf2f732 branch 3 times, most recently from d12b99d to fd12a2a Compare May 25, 2026 15:24
manavgup and others added 3 commits May 25, 2026 15:24
…nline markers (Phase 4) (#450)

Three-layer citation experience connecting article claims to source spans:
- Layer 1: Citation markers on claims with hover popovers showing verbatim quotes
- Layer 2: Source panel with highlighted span text and auto-scroll
- Layer 3: Inline citation markers in article markdown next to confidence badges

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The CONFIDENCE_TAG_REGEX only matched [sourced] but articles use (sourced).
Updated regex to accept both bracket and parenthesis delimiters so Layer 3
inline [src] markers render correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ocator, add error handling (#450)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot force-pushed the worktree-agent-acf2f732 branch from fd12a2a to 56c7cab Compare May 25, 2026 15:24
@manavgup manavgup merged commit bfe0b8f into main May 25, 2026
@github-actions github-actions Bot deleted the worktree-agent-acf2f732 branch May 25, 2026 15:25
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