mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-10 03:13:29 +08:00
feat: persist ecc2 auto-dispatch policy
This commit is contained in:
@@ -43,6 +43,7 @@ pub async fn run(db: StateStore, cfg: Config) -> Result<()> {
|
||||
(_, KeyCode::Char('b')) => dashboard.rebalance_selected_team().await,
|
||||
(_, KeyCode::Char('i')) => dashboard.drain_inbox_selected().await,
|
||||
(_, KeyCode::Char('g')) => dashboard.auto_dispatch_backlog().await,
|
||||
(_, KeyCode::Char('p')) => dashboard.toggle_auto_dispatch_policy(),
|
||||
(_, KeyCode::Char('s')) => dashboard.stop_selected().await,
|
||||
(_, KeyCode::Char('u')) => dashboard.resume_selected().await,
|
||||
(_, KeyCode::Char('x')) => dashboard.cleanup_selected_worktree().await,
|
||||
|
||||
@@ -400,7 +400,7 @@ impl Dashboard {
|
||||
|
||||
fn render_status_bar(&self, frame: &mut Frame, area: Rect) {
|
||||
let text = format!(
|
||||
" [n]ew session [a]ssign re[b]alance dra[i]n inbox [g]lobal dispatch [s]top [u]resume [x]cleanup [d]elete [r]efresh [Tab] switch pane [j/k] scroll [+/-] resize [{}] layout [?] help [q]uit ",
|
||||
" [n]ew session [a]ssign re[b]alance dra[i]n inbox [g]lobal dispatch toggle [p]olicy [s]top [u]resume [x]cleanup [d]elete [r]efresh [Tab] switch pane [j/k] scroll [+/-] resize [{}] layout [?] help [q]uit ",
|
||||
self.layout_label()
|
||||
);
|
||||
let text = if let Some(note) = self.operator_note.as_ref() {
|
||||
@@ -449,6 +449,7 @@ impl Dashboard {
|
||||
" b Rebalance backed-up delegate inboxes for selected lead",
|
||||
" i Drain unread task handoffs from selected session inbox",
|
||||
" g Auto-dispatch unread handoffs across lead sessions",
|
||||
" p Toggle daemon auto-dispatch policy and persist config",
|
||||
" s Stop selected session",
|
||||
" u Resume selected session",
|
||||
" x Cleanup selected worktree",
|
||||
@@ -910,6 +911,27 @@ impl Dashboard {
|
||||
self.show_help = !self.show_help;
|
||||
}
|
||||
|
||||
pub fn toggle_auto_dispatch_policy(&mut self) {
|
||||
self.cfg.auto_dispatch_unread_handoffs = !self.cfg.auto_dispatch_unread_handoffs;
|
||||
match self.cfg.save() {
|
||||
Ok(()) => {
|
||||
let state = if self.cfg.auto_dispatch_unread_handoffs {
|
||||
"enabled"
|
||||
} else {
|
||||
"disabled"
|
||||
};
|
||||
self.set_operator_note(format!(
|
||||
"daemon auto-dispatch {state} | saved to {}",
|
||||
crate::config::Config::config_path().display()
|
||||
));
|
||||
}
|
||||
Err(error) => {
|
||||
self.cfg.auto_dispatch_unread_handoffs = !self.cfg.auto_dispatch_unread_handoffs;
|
||||
self.set_operator_note(format!("failed to persist auto-dispatch policy: {error}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn tick(&mut self) {
|
||||
loop {
|
||||
match self.output_rx.try_recv() {
|
||||
|
||||
Reference in New Issue
Block a user