Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::path::PathBuf;
use thiserror::Error;

use crate::application::command_handlers::create::CreateCommandHandlerError;
use crate::presentation::progress::ProgressReporterError;
use crate::presentation::views::progress::ProgressReporterError;

/// Format of configuration file
#[derive(Debug, Clone, Copy)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::application::command_handlers::CreateCommandHandler;
use crate::domain::environment::state::Created;
use crate::domain::Environment;
use crate::infrastructure::persistence::repository_factory::RepositoryFactory;
use crate::presentation::progress::ProgressReporter;
use crate::presentation::views::progress::ProgressReporter;
use crate::presentation::views::UserOutput;
use crate::shared::clock::Clock;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use std::path::PathBuf;
use thiserror::Error;

use crate::presentation::progress::ProgressReporterError;
use crate::presentation::views::progress::ProgressReporterError;

/// Errors that can occur during template generation commands
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::sync::Arc;
use parking_lot::ReentrantMutex;

use crate::application::command_handlers::create::config::EnvironmentCreationConfig;
use crate::presentation::progress::ProgressReporter;
use crate::presentation::views::progress::ProgressReporter;
use crate::presentation::views::UserOutput;

use super::errors::CreateEnvironmentTemplateCommandError;
Expand Down
2 changes: 1 addition & 1 deletion src/presentation/controllers/destroy/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use thiserror::Error;

use crate::application::command_handlers::destroy::DestroyCommandHandlerError;
use crate::domain::environment::name::EnvironmentNameError;
use crate::presentation::progress::ProgressReporterError;
use crate::presentation::views::progress::ProgressReporterError;

/// Destroy command specific errors
///
Expand Down
2 changes: 1 addition & 1 deletion src/presentation/controllers/destroy/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::domain::environment::repository::EnvironmentRepository;
use crate::domain::environment::state::Destroyed;
use crate::domain::environment::Environment;
use crate::infrastructure::persistence::repository_factory::RepositoryFactory;
use crate::presentation::progress::ProgressReporter;
use crate::presentation::views::progress::ProgressReporter;
use crate::presentation::views::UserOutput;
use crate::shared::clock::Clock;

Expand Down
15 changes: 7 additions & 8 deletions src/presentation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
//! │ └── mod.rs # Controller layer exports
//! │
//! ├── views/ # ✅ Views Layer - Output formatting and presentation
//! │ ├── progress/ # ✅ Progress indicators (moved from root)
//! │ └── ... # User interface output and formatting
//! ├── progress.rs # ⏳ Will move to views/progress/
//! ├── errors.rs # Unified error types for all commands
//! └── mod.rs # This file - layer exports and documentation
//! ```
Expand Down Expand Up @@ -150,11 +150,11 @@
//!
//! With the Controllers layer complete, the next phase focuses on organizing the Views layer:
//!
//! 1. **Rename `user_output/` to `views/`**: Align with MVC terminology
//! 2. **Organize view submodules**: Group related presentation concerns
//! 3. **Move `progress.rs` to `views/progress/`**: Place progress indicators with other views
//! 4. **Implement theme system**: Structured output formatting and customization
//! 5. **Channel separation**: Proper stdout/stderr management for Unix conventions
//! 1. **Rename `user_output/` to `views/`**: Align with MVC terminology
//! 2. **Organize view submodules**: Group related presentation concerns
//! 3. **Move `progress.rs` to `views/progress/`**: Place progress indicators with other views
//! 4. **Implement theme system**: Structured output formatting and customization
//! 5. **Channel separation**: Proper stdout/stderr management for Unix conventions
//!
//! After Proposal #4, the final steps will be:
//! - **Proposal #5**: Enhanced error presentation and help system integration
Expand All @@ -173,7 +173,6 @@ pub mod dispatch;
pub mod error;
pub mod errors;
pub mod input;
pub mod progress;
pub mod views;

// Re-export commonly used presentation types for convenience
Expand All @@ -187,7 +186,7 @@ pub use error::handle_error;

pub use errors::CommandError;
pub use input::{Cli, Commands, GlobalArgs};
pub use progress::ProgressReporter;
pub use views::progress::ProgressReporter;
pub use views::{Theme, UserOutput, VerbosityLevel};

#[cfg(test)]
Expand Down
2 changes: 1 addition & 1 deletion src/presentation/tests/reentrancy_fix_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::sync::Arc;

use parking_lot::ReentrantMutex;

use crate::presentation::progress::ProgressReporter;
use crate::presentation::views::progress::ProgressReporter;
use crate::presentation::views::{UserOutput, VerbosityLevel};

/// Test to verify that `ReentrantMutex` fixes the reentrancy deadlock issue #164
Expand Down
7 changes: 7 additions & 0 deletions src/presentation/views/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
//! - **stdout**: Deployment results, configuration summaries, structured data (JSON)
//! - **stderr**: Step progress, status updates, warnings, error messages with actionable guidance
//!
//! ## Progress Indicators
//!
//! The [`progress`] module provides components for displaying real-time progress during long operations.
//!
//! See also: [`docs/research/UX/user-output-vs-logging-separation.md`](../../docs/research/UX/user-output-vs-logging-separation.md)

// Re-export core types and traits for backward compatibility
Expand All @@ -85,5 +89,8 @@ mod theme;
mod traits;
mod verbosity;

// Progress indicators module (moved from presentation root for clear ownership)
pub mod progress;

// Test support module (public for use in tests across the codebase)
pub mod test_support;
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! use std::sync::Arc;
//! use std::cell::RefCell;
//! use parking_lot::ReentrantMutex;
//! use torrust_tracker_deployer_lib::presentation::progress::ProgressReporter;
//! use torrust_tracker_deployer_lib::presentation::views::progress::ProgressReporter;
//! use torrust_tracker_deployer_lib::presentation::views::{UserOutput, VerbosityLevel};
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
Expand Down Expand Up @@ -99,7 +99,7 @@ Tip: This is a critical bug - please report it with full logs using --log-output
/// use std::sync::Arc;
/// use std::cell::RefCell;
/// use parking_lot::ReentrantMutex;
/// use torrust_tracker_deployer_lib::presentation::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::{UserOutput, VerbosityLevel};
///
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
Expand Down Expand Up @@ -137,7 +137,7 @@ impl ProgressReporter {
/// use std::sync::Arc;
/// use std::cell::RefCell;
/// use parking_lot::ReentrantMutex;
/// use torrust_tracker_deployer_lib::presentation::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::{UserOutput, VerbosityLevel};
///
/// let output = Arc::new(ReentrantMutex::new(RefCell::new(UserOutput::new(VerbosityLevel::Normal))));
Expand Down Expand Up @@ -187,7 +187,7 @@ impl ProgressReporter {
/// use std::sync::Arc;
/// use std::cell::RefCell;
/// use parking_lot::ReentrantMutex;
/// use torrust_tracker_deployer_lib::presentation::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::{UserOutput, VerbosityLevel};
///
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
Expand Down Expand Up @@ -232,7 +232,7 @@ impl ProgressReporter {
/// use std::sync::Arc;
/// use std::cell::RefCell;
/// use parking_lot::ReentrantMutex;
/// use torrust_tracker_deployer_lib::presentation::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::{UserOutput, VerbosityLevel};
///
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
Expand Down Expand Up @@ -284,7 +284,7 @@ impl ProgressReporter {
/// use std::sync::Arc;
/// use std::cell::RefCell;
/// use parking_lot::ReentrantMutex;
/// use torrust_tracker_deployer_lib::presentation::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::{UserOutput, VerbosityLevel};
///
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
Expand Down Expand Up @@ -325,7 +325,7 @@ impl ProgressReporter {
/// use std::sync::Arc;
/// use std::cell::RefCell;
/// use parking_lot::ReentrantMutex;
/// use torrust_tracker_deployer_lib::presentation::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::{UserOutput, VerbosityLevel};
///
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
Expand Down Expand Up @@ -355,7 +355,7 @@ impl ProgressReporter {
/// use std::sync::Arc;
/// use std::cell::RefCell;
/// use parking_lot::ReentrantMutex;
/// use torrust_tracker_deployer_lib::presentation::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::{UserOutput, VerbosityLevel};
///
/// let output = Arc::new(ReentrantMutex::new(RefCell::new(UserOutput::new(VerbosityLevel::Normal))));
Expand Down Expand Up @@ -386,7 +386,7 @@ impl ProgressReporter {
/// use std::sync::Arc;
/// use std::cell::RefCell;
/// use parking_lot::ReentrantMutex;
/// use torrust_tracker_deployer_lib::presentation::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::{UserOutput, VerbosityLevel};
///
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
Expand Down Expand Up @@ -423,7 +423,7 @@ impl ProgressReporter {
/// use std::sync::Arc;
/// use std::cell::RefCell;
/// use parking_lot::ReentrantMutex;
/// use torrust_tracker_deployer_lib::presentation::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::progress::ProgressReporter;
/// use torrust_tracker_deployer_lib::presentation::views::{UserOutput, VerbosityLevel};
///
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
Expand Down
Loading