feat: move new item notification before input processing
Co-authored-by: aider (openai/andrew/openrouter/anthropic/claude-sonnet-4) <aider@aider.chat>
This commit is contained in:
@@ -173,6 +173,30 @@ impl ItemService {
|
|||||||
db::add_meta(&tx, item_id, k, v)?;
|
db::add_meta(&tx, item_id, k, v)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Print the "KEEP: New item" message before starting to read input
|
||||||
|
if !settings.quiet {
|
||||||
|
if std::io::stderr().is_terminal() {
|
||||||
|
let mut t = term::stderr().unwrap();
|
||||||
|
let _ = t.reset();
|
||||||
|
let _ = t.attr(term::Attr::Bold);
|
||||||
|
let _ = write!(t, "KEEP:");
|
||||||
|
let _ = t.reset();
|
||||||
|
let _ = write!(t, " New item ");
|
||||||
|
let _ = t.attr(term::Attr::Bold);
|
||||||
|
let _ = write!(t, "{item_id}");
|
||||||
|
let _ = t.reset();
|
||||||
|
let _ = write!(t, " tags: ");
|
||||||
|
let _ = t.attr(term::Attr::Bold);
|
||||||
|
let _ = write!(t, "{}", tags.join(" "));
|
||||||
|
let _ = t.reset();
|
||||||
|
let _ = writeln!(t);
|
||||||
|
let _ = std::io::stderr().flush();
|
||||||
|
} else {
|
||||||
|
let mut t = std::io::stderr();
|
||||||
|
let _ = writeln!(t, "KEEP: New item: {} tags: {:?}", item_id, tags);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let mut plugins = self.meta_service.get_plugins(cmd, settings);
|
let mut plugins = self.meta_service.get_plugins(cmd, settings);
|
||||||
debug!("ITEM_SERVICE: Got {} meta plugins", plugins.len());
|
debug!("ITEM_SERVICE: Got {} meta plugins", plugins.len());
|
||||||
@@ -209,29 +233,6 @@ impl ItemService {
|
|||||||
|
|
||||||
tx.commit()?;
|
tx.commit()?;
|
||||||
debug!("ITEM_SERVICE: Transaction committed successfully");
|
debug!("ITEM_SERVICE: Transaction committed successfully");
|
||||||
|
|
||||||
if !settings.quiet {
|
|
||||||
if std::io::stderr().is_terminal() {
|
|
||||||
let mut t = term::stderr().unwrap();
|
|
||||||
let _ = t.reset();
|
|
||||||
let _ = t.attr(term::Attr::Bold);
|
|
||||||
let _ = write!(t, "KEEP:");
|
|
||||||
let _ = t.reset();
|
|
||||||
let _ = write!(t, " New item ");
|
|
||||||
let _ = t.attr(term::Attr::Bold);
|
|
||||||
let _ = write!(t, "{item_id}");
|
|
||||||
let _ = t.reset();
|
|
||||||
let _ = write!(t, " tags: ");
|
|
||||||
let _ = t.attr(term::Attr::Bold);
|
|
||||||
let _ = write!(t, "{}", tags.join(" "));
|
|
||||||
let _ = t.reset();
|
|
||||||
let _ = writeln!(t);
|
|
||||||
let _ = std::io::stderr().flush();
|
|
||||||
} else {
|
|
||||||
let mut t = std::io::stderr();
|
|
||||||
let _ = writeln!(t, "KEEP: New item: {} tags: {:?}", item_id, tags);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
debug!("ITEM_SERVICE: Getting final item with metadata");
|
debug!("ITEM_SERVICE: Getting final item with metadata");
|
||||||
self.get_item(conn, item_id)
|
self.get_item(conn, item_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user