Skip to content

Commit 82ad0ac

Browse files
committed
😈 Unleash chaos upon Studio TUI with reducer pattern of doom
Replace predictable event handling with a sinister event-driven architecture using a central reducer that bends all state to its will. Introduce StudioEvent as the dark overlord of all state changes, processed through a pure reducer function that spawns side effects for nefarious async operations. Add History system for stalking content changes, chat messages, and events across all modes with session persistence for eternal surveillance. Shatter the monolithic modal handler into isolated modules, each plotting their own schemes. Handlers now return Vec<SideEffect> directly instead of the pathetic legacy Action enum, enabling ruthless separation between state mutations and I/O domination. This architecture provides inescapable data flow, testable state transitions, and lays groundwork for our AI overlords to seize control of the UI.
1 parent 3e5609a commit 82ad0ac

29 files changed

+3934
-1660
lines changed

src/agents/iris.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,7 @@ impl IrisAgent {
342342
///
343343
/// When set, the agent will have access to tools for updating
344344
/// commit messages, PR descriptions, and reviews.
345-
pub fn set_content_update_sender(
346-
&mut self,
347-
sender: crate::agents::tools::ContentUpdateSender,
348-
) {
345+
pub fn set_content_update_sender(&mut self, sender: crate::agents::tools::ContentUpdateSender) {
349346
self.content_update_sender = Some(sender);
350347
}
351348

src/agents/tools/content_update.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,10 @@ impl Tool for UpdateCommitTool {
9898
message: args.message.clone().unwrap_or_default(),
9999
};
100100

101-
self.sender
102-
.send(update)
103-
.map_err(|e| {
104-
tracing::error!("Failed to send content update: {}", e);
105-
ContentUpdateError(format!("Failed to send update: {}", e))
106-
})?;
101+
self.sender.send(update).map_err(|e| {
102+
tracing::error!("Failed to send content update: {}", e);
103+
ContentUpdateError(format!("Failed to send update: {}", e))
104+
})?;
107105

108106
tracing::info!("Content update sent successfully via channel");
109107

src/cli.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,9 @@ async fn handle_studio(
10341034
use anyhow::Context;
10351035
use std::sync::Arc;
10361036

1037+
// Disable stdout logging immediately for TUI mode - it owns the terminal
1038+
crate::logger::set_log_to_stdout(false);
1039+
10371040
log_debug!(
10381041
"Handling 'studio' command with common: {:?}, mode: {:?}, from: {:?}, to: {:?}",
10391042
common,

0 commit comments

Comments
 (0)