Home

mweinbach / agent-coworker

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

refactor(desktop): split message primitive from desktop markdown layer

3 months ago

240af42
Authored
Max Weinbach6/17/2026, 5:57:18 PM
Make components/ai-elements/message.tsx a pure presentational primitive
(Message, MessageContent, and a Streamdown-wrapping MessageResponse with prose
styling only — upstream-aligned, no app imports).

Move all desktop markdown behavior to a new app-layer module
src/ui/markdown/ (DesktopMarkdown): the wired response that composes the pure
MessageResponse and injects DesktopMessageLink, DesktopCitationChip, the
bare-path remark plugin, sanitize pipeline, and citation normalization. It
owns useAppStore/desktopCommands/getFilePreviewKind. File relocated via git mv
so the ~1200 lines move verbatim; only the Button import path and the exported
component name changed.

Repoint all 7 consumers (FeedRow, ActivityGroupCard, ContextSidebar,
ResearchReportRenderer, UpdatesPage, CodeFilePreview, FilePreviewModal) and the
message-links test to the new modules, and move the file's biome lint override
to the new path. Pinned message-links + sources-carousel tests stay green.

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

Parent5b90cfc

12 files changed
  • apps/desktop/src/components/ai-elements/message.tsx+11−1171
  • apps/desktop/src/ui/CodeFilePreview.tsx+1−1
  • apps/desktop/src/ui/ContextSidebar.tsx+3−3
  • apps/desktop/src/ui/FilePreviewModal.tsx+1−1
  • apps/desktop/src/ui/chat/ActivityGroupCard.tsx+5−5
  • apps/desktop/src/ui/chat/FeedRow.tsx+4−3
  • apps/desktop/src/ui/markdown/DesktopMarkdown.tsx+1185−0
apps/desktop/src/ui/markdown/index.ts
+1
−0
  • apps/desktop/src/ui/research/ResearchReportRenderer.tsx+3−3
  • apps/desktop/src/ui/settings/pages/UpdatesPage.tsx+3−3
  • apps/desktop/test/message-links.test.ts+17−17
  • biome.json+1−1