style: format seluruh workspace dengan cargo fmt
Menyeragamkan format kode sesuai rustfmt (126 file). Sebelumnya lefthook pre-commit 'cargo fmt --check' akan gagal pada commit apa pun.
This commit is contained in:
@@ -8,9 +8,13 @@
|
||||
//! restore terminal → save settings → release lock.
|
||||
|
||||
use anyhow::Result;
|
||||
use crossterm::event::{
|
||||
DisableBracketedPaste, DisableMouseCapture, Event, KeyEventKind, MouseEventKind,
|
||||
};
|
||||
use crossterm::execute;
|
||||
use crossterm::event::{DisableBracketedPaste, DisableMouseCapture, Event, KeyEventKind, MouseEventKind};
|
||||
use crossterm::terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen};
|
||||
use crossterm::terminal::{
|
||||
disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen,
|
||||
};
|
||||
use ratatui::backend::CrosstermBackend;
|
||||
use ratatui::Terminal;
|
||||
use std::io::{self, Write};
|
||||
@@ -126,9 +130,9 @@ fn run_loop_inner(
|
||||
|
||||
// Adaptive poll: fast when animating, slow when idle.
|
||||
let poll_timeout = if state.turn_in_flight() {
|
||||
Duration::from_millis(50) // smooth spinner @ ~20fps
|
||||
Duration::from_millis(50) // smooth spinner @ ~20fps
|
||||
} else {
|
||||
Duration::from_millis(200) // idle: 5fps, saves CPU
|
||||
Duration::from_millis(200) // idle: 5fps, saves CPU
|
||||
};
|
||||
|
||||
if crossterm::event::poll(poll_timeout)? {
|
||||
@@ -140,7 +144,8 @@ fn run_loop_inner(
|
||||
apply_action(state, action);
|
||||
}
|
||||
if let Some(text) = state.misc.pending_clipboard_copy.take() {
|
||||
let _ = zesdex_infrastructure::utils::write_osc52(&mut io::stdout(), &text);
|
||||
let _ =
|
||||
zesdex_infrastructure::utils::write_osc52(&mut io::stdout(), &text);
|
||||
state.push_toast(zesdex_infrastructure::Toast::new(
|
||||
zesdex_infrastructure::ToastKind::Success,
|
||||
"Copied to clipboard".to_string(),
|
||||
@@ -195,13 +200,15 @@ fn create_local_session() -> Result<(zesdex_domain::core::Store, AppStateRest)>
|
||||
|
||||
// Load real settings from disk
|
||||
use zesdex_domain::cms::{AppConfigRepository, SettingsRepository};
|
||||
let settings = zesdex_infrastructure::persistence::cms::settings_repo::JsonSettingsRepository::new()
|
||||
.load(&store.base_dir)
|
||||
.unwrap_or_default();
|
||||
let settings =
|
||||
zesdex_infrastructure::persistence::cms::settings_repo::JsonSettingsRepository::new()
|
||||
.load(&store.base_dir)
|
||||
.unwrap_or_default();
|
||||
|
||||
let app_config = zesdex_infrastructure::persistence::cms::app_config_repo::JsonAppConfigRepository::new()
|
||||
.load(&store.base_dir)
|
||||
.unwrap_or_default();
|
||||
let app_config =
|
||||
zesdex_infrastructure::persistence::cms::app_config_repo::JsonAppConfigRepository::new()
|
||||
.load(&store.base_dir)
|
||||
.unwrap_or_default();
|
||||
|
||||
let workspace_roots = vec![std::env::current_dir()?];
|
||||
let mut state = AppStateRest::new(workspace_roots, &session_dir, store.memory_dir.clone());
|
||||
|
||||
Reference in New Issue
Block a user