Skip to content

feat: ChatSources sidebar with grouped source links#25

Merged
PAMulligan merged 7 commits intomainfrom
4-source-and-search-results-display-component
Mar 24, 2026
Merged

feat: ChatSources sidebar with grouped source links#25
PAMulligan merged 7 commits intomainfrom
4-source-and-search-results-display-component

Conversation

@PAMulligan
Copy link
Copy Markdown
Contributor

Summary

  • Added Source type (blog | page | external) to API types with optional sources field on ChatMessage and ChatResponse
  • Built ChatSources slide-out sidebar component that groups sources by type (blogs first, then pages, then external) with count header and close button
  • Built SourceIcon button with badge count that appears on assistant messages with sources
  • Integrated sidebar into ChatWindow with open/close/toggle state management
  • Wired useChat hook to pass sources from API responses through to messages

Test Plan

  • 75 tests passing (22 new tests added across 4 test files)
  • Source type tests verify all type variants and optional field behavior
  • SourceIcon tests cover badge, tooltip, click handler, active/inactive states
  • ChatSources tests cover grouping, ordering, count header, links, close button
  • MessageBubble tests verify icon renders only for assistant messages with sources
  • ChatWindow integration tests verify sidebar open/close/toggle behavior
  • Visual verification with mock data in dev server

Closes #4

🤖 Generated with Claude Code

Paul Mulligan and others added 7 commits March 24, 2026 17:28
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@PAMulligan PAMulligan linked an issue Mar 24, 2026 that may be closed by this pull request
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying chat-widget with  Cloudflare Pages  Cloudflare Pages

Latest commit: 631ba9f
Status: ✅  Deploy successful!
Preview URL: https://23d46634.chat-widget-ejc.pages.dev
Branch Preview URL: https://4-source-and-search-results.chat-widget-ejc.pages.dev

View logs

@PAMulligan PAMulligan self-assigned this Mar 24, 2026
@PAMulligan PAMulligan added enhancement New feature or request widget Chat widget UI and embed functionality labels Mar 24, 2026
@PAMulligan PAMulligan moved this from Todo to Done in PMDS Open Source Roadmap Mar 24, 2026
@PAMulligan PAMulligan added this to the v1.0.0 milestone Mar 24, 2026
@PAMulligan PAMulligan merged commit 7e7bbf8 into main Mar 24, 2026
2 checks passed
@PAMulligan PAMulligan deleted the 4-source-and-search-results-display-component branch March 30, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request widget Chat widget UI and embed functionality

Projects

Development

Successfully merging this pull request may close these issues.

Source and search results display component

1 participant