Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

refactor(desktop): make SourcesCarousel a pure presentational primitive

3 months ago

5b90cfc
Authored
Max Weinbach6/17/2026, 5:44:34 PM
Extract desktop app logic out of the sources-carousel AI Elements primitive:
- Drop confirmAction (desktopCommands) and the app CitationSource type; the
  primitive now takes a local SourceItem[] and an onOpenSource(url) callback
- Add src/lib/openExternalSource.ts (confirm -> window.open) as the call-site
  behavior, wired in FeedRow via onOpenSource
- Split the test: pure component asserts onOpenSource is called; helper test
  asserts confirm -> window.open (and the cancel path)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Parent80865aa

4 files changed
  • apps/desktop/src/components/ai-elements/sources-carousel.tsx+19−22
  • apps/desktop/src/lib/openExternalSource.ts+23−0
  • apps/desktop/src/ui/chat/FeedRow.tsx+6−1
  • apps/desktop/test/sources-carousel.test.tsx+49−8