1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! # Application Module
//!
//! Core application logic and state management for the Quetty TUI application.
//! This module contains the main application model, lifecycle management, and
//! coordination between different UI components and business logic.
//!
//! ## Architecture
//!
//! The application follows a model-view-update architecture:
//! - **Model** - Application state and data
//! - **View** - UI rendering and layout
//! - **Updates** - Message handling and state transitions
//!
//! ## Core Components
//!
//! - [`application_lifecycle`] - Application startup, shutdown, and lifecycle management
//! - [`model`] - Core application state and data structures
//! - [`view`] - UI rendering and layout logic
//! - [`updates`] - Message processing and state updates
//! - [`task_manager`] - Background task coordination
//! - [`queue_state`] - Queue-specific state management
//! - [`bulk_operation_processor`] - Bulk message operation handling
//!
//! ## Features
//!
//! - **State Management** - Centralized application state with type-safe updates
//! - **Component Coordination** - Message-based communication between UI components
//! - **Background Tasks** - Async task management for Service Bus operations
//! - **Queue Operations** - Message browsing, editing, and bulk operations
//! - **Authentication** - Integrated authentication flow management
//! - **Error Handling** - Comprehensive error reporting and user feedback
//!
//! ## Usage
//!
//! ```no_run
//! use quetty::app::application_lifecycle::ApplicationLifecycle;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let mut model = ApplicationLifecycle::initialize().await?;
//! ApplicationLifecycle::setup_terminal(&mut model)?;
//! ApplicationLifecycle::run_application_loop(&mut model)?;
//! ApplicationLifecycle::shutdown_application(model)?;
//! Ok(())
//! }
//! ```
/// Application lifecycle management - startup, shutdown, and main loop
/// Bulk message operation processing and coordination
/// Component managers for different UI areas
/// Core application model and state structures
/// Queue-specific state management and operations
/// Component remounting and view management
/// Background task management and coordination
/// Message processing and state update logic
/// UI rendering and view composition