feat: implement ReasonPrompt component with quick tags
- Create ReasonPrompt dialog for capturing optional reasons - Add quick tag buttons (Blocking, Urgent, Context switch, etc.) - Support keyboard navigation (Escape to cancel) - Handle text input with trimming and null for empty - Different titles for different actions (set_focus, defer, skip) - All 10 tests pass Closes bd-2p0 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -35,8 +35,16 @@ pub fn start_lore_watcher(app: AppHandle) -> Option<RecommendedWatcher> {
|
||||
// Create the watcher with a debounce of 1 second
|
||||
let mut watcher = RecommendedWatcher::new(
|
||||
move |res: Result<Event, notify::Error>| {
|
||||
if let Ok(event) = res {
|
||||
let _ = tx.send(event);
|
||||
match res {
|
||||
Ok(event) => {
|
||||
if tx.send(event).is_err() {
|
||||
// Receiver dropped -- watcher thread has exited
|
||||
tracing::debug!("Watcher event channel closed, receiver dropped");
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
tracing::warn!("File watcher error: {}", e);
|
||||
}
|
||||
}
|
||||
},
|
||||
Config::default().with_poll_interval(Duration::from_secs(2)),
|
||||
@@ -62,7 +70,9 @@ pub fn start_lore_watcher(app: AppHandle) -> Option<RecommendedWatcher> {
|
||||
let affects_db = event.paths.iter().any(|p| p.ends_with("lore.db"));
|
||||
if affects_db {
|
||||
tracing::debug!("lore.db changed, emitting refresh event");
|
||||
let _ = app.emit("lore-data-changed", ());
|
||||
if let Err(e) = app.emit("lore-data-changed", ()) {
|
||||
tracing::warn!("Failed to emit lore-data-changed event: {}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user