Commit 4ace592
committed
refactor: add user output architecture improvements plan
Add comprehensive refactoring plan for src/presentation/user_output.rs
with 10 proposals organized in 3 phases:
- Phase 0 (Quick Wins): Verbosity filtering, test infrastructure, theme support
- Phase 1 (Strategic): Trait-based message system, parameterized tests
- Phase 2 (Polish): Type-safe channels, buffering, builders, output sinks
Key architectural decision: Use trait-based OutputMessage design where each
message type (ProgressMessage, SuccessMessage, etc.) implements its own
formatting, verbosity requirements, and channel routing. This achieves true
Open/Closed Principle - new message types can be added without modifying
existing code.
Alternative considered: Enum-based messages with centralized formatter.
Discarded because pattern matching on enum variants requires modifying
the formatter for each new message type, violating Open/Closed Principle.1 parent 30d1eda commit 4ace592
File tree
2 files changed
+1750
-3
lines changed- docs/refactors
- plans
2 files changed
+1750
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments