Repository navigation
Closed
Description
Overview
Extract emoji symbols from UserOutput methods into a configurable Theme struct. This enables support for different output styles (emoji, plain text, ASCII) based on environment or user preferences, making the application more accessible and CI/CD-friendly.
Specification
See detailed specification: docs/issues/124-add-theme-configuration-support.md
🏗️ Architecture Requirements
DDD Layer: Presentation
Module Path: src/presentation/user_output.rs
Pattern: Configuration/Theme Pattern
Module Structure Requirements
- Create
Themestruct withinuser_output.rsmodule - Implement predefined theme constructors (
emoji(),plain(),ascii()) - Implement
Defaulttrait forTheme(emoji theme) - Update
UserOutputto useThemefor all symbol formatting - Follow module organization conventions (see docs/contributing/module-organization.md)
Architectural Constraints
- No breaking changes: Existing code using default constructor continues to work
- Backward compatibility: Default theme uses emoji (current behavior)
- Extensibility: Easy to add new themes without modifying output methods
- Type safety: Theme fields are strongly typed
- Immutability: Theme is set at construction, not modified during runtime
Anti-Patterns to Avoid
- ❌ Global mutable theme - Don't use static mutable for theme configuration
- ❌ Runtime theme switching - Theme is set at construction, not changed afterward
- ❌ Hardcoded symbols in methods - All symbols must come from
Theme
Implementation Plan
Phase 1: Create Theme Struct (1-2 hours)
- Create
Themestruct with symbol fields - Implement
Theme::emoji(),Theme::plain(),Theme::ascii() - Implement accessor methods and
Defaulttrait - Add comprehensive documentation
Phase 2: Add Unit Tests for Theme (1 hour)
- Test all predefined themes
- Test accessor methods
- Test theme cloning and equality
Phase 3: Integrate Theme into UserOutput (2-3 hours)
- Add
theme: Themefield toUserOutput - Create
UserOutput::with_theme()constructor - Update all output methods to use
self.theme.X_symbol() - Remove hardcoded symbols
Phase 4: Update Tests (2-3 hours)
- Update test infrastructure to support themes
- Add tests for each theme variant
- Verify all existing tests pass
Phase 5: Documentation and Verification (1 hour)
- Add module documentation
- Add usage examples
- Run pre-commit checks:
./scripts/pre-commit.sh
Acceptance Criteria
Note for Contributors: These criteria define what the PR reviewer will check. Use this as your pre-review checklist before submitting the PR to minimize back-and-forth iterations.
Quality Checks:
- Pre-commit checks pass:
./scripts/pre-commit.sh
Theme Implementation Checks:
-
Themestruct exists with all symbol fields - All predefined themes implemented:
emoji(),plain(),ascii() -
Defaulttrait returns emoji theme - All accessor methods implemented
Integration Checks:
-
UserOutputhastheme: Themefield -
UserOutput::with_theme()constructor exists - All output methods use theme symbols (no hardcoded symbols)
Testing Checks:
- Theme unit tests cover all variants
- Test infrastructure supports theme injection
- All existing tests pass
Backward Compatibility Checks:
- Default
UserOutput::new()uses emoji theme - No breaking changes to public API
Documentation Checks:
- Theme system fully documented
- Usage examples for each theme
- Each theme variant documented with use case
Related
- Parent: [EPIC] User Output Architecture Improvements #102 (Epic: User Output Architecture Improvements)
- Roadmap: N/A (Code quality improvement)
- Specification: docs/issues/124-add-theme-configuration-support.md
Reacted by Copilot
Activity
docs: add Phase 0 issue specifications for user output refactoring
feat: [#124] add Theme struct with emoji, plain, and ASCII variants
fix: [#124] address clippy warnings and apply rustfmt
feat: [#124] export Theme in presentation module public API
Merge #126: Add Theme/Configuration Support for UserOutput
Merge #129: Implement trait-based message system for UserOutput exten…
chore: remove closed issue documentation files