Skip to content

Refactor assistant source formatting out of Swing UI - #79

Merged
drafael merged 1 commit into
mainfrom
refactor/extract-assistant-source-formatter
Aug 29, 2026
Merged

drafael merged 1 commit into
mainfrom
refactor/extract-assistant-source-formatter

Conversation

@drafael

@drafael drafael commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • move citation/source Markdown transformation from ChatPanel into a package-private, Swing-independent AssistantSourceFormatter
  • keep streaming state, locking, persistence, and EDT/UI updates owned by ChatPanel
  • replace reflective ChatPanelTest coverage with direct deterministic unit tests, including disabled-search and answer-URL fallback cases

Design

This is intentionally a narrow extraction: one concrete stateless class, no interface, dependency injection, coordinator chain, or new lifecycle. The formatter accepts only the values it needs (String, List<CitationRef>, and the Web Search enabled flag) and remains unaware of ChatPanel, SendJob, StreamingSession, Swing, or persistence.

ChatPanel is reduced by 177 production lines while retaining orchestration and UI responsibilities.

Testing

  • mvn -B -ntp -Dtest=AssistantSourceFormatterTest,ChatPanelTest test
  • mvn -B -ntp verify — 2,889 tests, 0 failures/errors, 5 skipped; isolated shaded runtime verification passed

@drafael
drafael merged commit 1766268 into main Aug 29, 2026
3 checks passed
@drafael
drafael deleted the refactor/extract-assistant-source-formatter branch August 29, 2026 20:54
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