Skip to content

[EPIC] User Output Architecture Improvements #102

Closed
12 of 12 issues completed
Closed

Description

@josecelano

User Output Architecture Improvements

Issue: #102
Parent Epic: N/A (Standalone refactoring epic)
Roadmap: N/A (Code quality improvement)
Related: Refactoring Plan

Overview

This Epic refactors the UserOutput module (src/presentation/user_output.rs) to improve clarity, testability, maintainability, and sustainability. The current implementation mixes concerns (formatting, routing, verbosity control) and lacks extensibility for different output styles and destinations.

Refactoring Plan

See comprehensive refactoring plan: docs/refactors/plans/user-output-architecture-improvements.md

See detailed epic specification: docs/issues/102-epic-user-output-architecture-improvements.md

Goals

  • Separate Concerns: Extract verbosity filtering, theme configuration, and formatting logic
  • Simplify Testing: Improve test infrastructure and reduce duplication
  • Enable Extensibility: Support different output styles (emoji, plain text, JSON) and destinations
  • Improve Maintainability: Reduce code duplication and establish clear abstractions
  • Maintain Quality: All refactorings must pass pre-commit checks and maintain test coverage

Proposals Summary

Phase 0: Quick Wins (High Impact, Low Effort)

  • Proposal 0: Extract Verbosity Filtering Logic ✅
  • Proposal 1: Simplify Test Infrastructure ✅
  • Proposal 2: Add Theme/Configuration Support ✅

Phase 1: Strategic Improvements (High Impact, Medium Effort)

  • Proposal 3: Use Message Trait for Extensibility ✅
  • Proposal 5: Parameterized Test Cases ✅

Phase 2: Polish & Extensions (Medium Impact, Low-Medium Effort)

  • Proposal 4: Add Alternative Formatters (optional enhancement) ✅
  • Proposal 6: Type-Safe Channel Routing ⏳
  • Proposal 7: Add Buffering Control
  • Proposal 8: Builder Pattern for Complex Messages
  • Proposal 9: Output Sink Abstraction

Key Architectural Decision

Trait-Based Message System: Each message type (ProgressMessage, SuccessMessage, etc.) implements the OutputMessage trait with 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 the Open/Closed Principle.

Implementation Strategy

Incremental Approach: Create subissues for each proposal as work progresses. This allows adapting the implementation to the current codebase state and adjusting for any discoveries made during implementation.

Sub-Tasks

Phase 0: Quick Wins

Phase 1: Strategic Improvements

Phase 2: Polish & Extensions

Other Related Work

Future Subissues

Additional subissues for Phase 2 proposals (7, 8, 9) will be created as work progresses.

Progress

Completed: 6 out of 8 subissues (75%)
Remaining: 2 subissues (#135 - Type-Safe Channel Routing, #149 - Module Folder Structure)

Timeline

  • Estimated Duration: 3-4 weeks (with parallel development possible)
  • Target Completion: End of November 2025

Related Documentation

Sub-issues

Sub-issues

12 of 12 Issues completed
Loading 12 sub-issues

Activity

  1. changed the title [-]User Output Architecture Improvements[/-] [+][EPIC] User Output Architecture Improvements[/+] on Oct 30, 2025
  2. added 2 commits that reference this issue on Nov 3, 2025
  3. added 3 commits that reference this issue on Nov 3, 2025
  4. 12 remaining items

  5. josecelano commented on Nov 4, 2025

    @josecelano
    MemberAuthor

    Phase 2 Sub-Issues Created

    Created three new sub-issues for the remaining Phase 2 proposals:

    All proposals from the refactoring plan are now tracked as GitHub issues. Phase 0 and Phase 1 have been completed. Phase 2 work can now begin.

    Status Update:

    • ✅ Phase 0 - Quick Wins: Complete (3/3 proposals)
    • ✅ Phase 1 - Strategic Improvements: Complete (2/2 proposals)
    • ⏳ Phase 2 - Polish & Extensions: In Progress (1/5 proposals complete, 4 remaining)

    See updated tracking in docs/issues/102-epic-user-output-architecture-improvements.md

  6. added 4 commits that reference this issue on Nov 4, 2025
  7. added 2 commits that reference this issue on Nov 5, 2025
  8. josecelano commented on Nov 6, 2025

    @josecelano
    MemberAuthor

    All subissues are complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions