watch repo once loaded
[?]
Feb 23, 2025, 7:07 PM
KM5PSZ4A2FJOPHJA6RC7LHZAUXLQDZDQC2DVSE5YUORLFIPZO74QCDependencies
- [2]
IQDCHWCPload a pijul repo - [3]
WT3GA27Padd cursor with selection - [4]
UB2ITZJSrefresh changed files on FS changes - [5]
EC3TVL4Xadd untracked files - [6]
YBJRDOTCmake all repo actions async - [7]
SWWE2R6Mdisplay basic repo stuff - [8]
S2NVIFXRallow to enter record msg - [*]
6YZAVBWUInitial commit
Change contents
- edit in crates/flowers_ui/src/main.rs at line 40[3.581]→[4.515:516](∅→∅),[4.516]→[6.5306:5344](∅→∅),[6.5344]→[4.516:1242](∅→∅),[4.516]→[4.516:1242](∅→∅),[4.1242]→[5.1797:1882](∅→∅),[5.1882]→[4.1308:1370](∅→∅),[4.1308]→[4.1308:1370](∅→∅),[4.1370]→[6.5345:5474](∅→∅),[6.5474]→[4.1437:1438](∅→∅),[4.1437]→[4.1437:1438](∅→∅)
// TODO: start watch once loaded?let (fs_watch_tx, fs_watch_rx) = watch::channel(());let mut fs_watch = new_debouncer(Duration::from_secs(1),None,move |result: DebounceEventResult| match result {Ok(events) => events.iter().for_each(|event| {// TODO: distinguish ".pijul" changes// dbg!(event);if event.kind.is_create()|| event.kind.is_modify()|| event.kind.is_remove(){let _ = fs_watch_tx.send(());}}),Err(errors) => {errors.iter().for_each(|error| eprintln!("{error:?}"))}},).unwrap();fs_watch.watch(&repo_path, RecursiveMode::Recursive).unwrap();let fs_watch_rx = WatchStream::from_changes(fs_watch_rx);let watch_task = Task::run(fs_watch_rx, |()| {Message::ToRepo(repo::MsgIn::RefreshChangedAndUntrackedFiles)}); - edit in crates/flowers_ui/src/main.rs at line 44
let repo_path_clone = repo_path.clone(); - replacement in crates/flowers_ui/src/main.rs at line 46
repo::manage(repo_path, repo_rx_in, repo_tx_out).await;repo::manage(repo_path_clone, repo_rx_in, repo_tx_out).await; - replacement in crates/flowers_ui/src/main.rs at line 52
let tasks = Task::batch([watch_task, repo_task, repo_msg_out_task]);let tasks = Task::batch([repo_task, repo_msg_out_task]); - replacement in crates/flowers_ui/src/main.rs at line 55
_fs_watch: fs_watch,repo_fs_watch: None,repo_path, - replacement in crates/flowers_ui/src/main.rs at line 68
_fs_watch: Debouncer<RecommendedWatcher, RecommendedCache>,repo_fs_watch: Option<Debouncer<RecommendedWatcher, RecommendedCache>>,repo_path: PathBuf, - replacement in crates/flowers_ui/src/main.rs at line 341
Task::none()// Start watching the repo's dir for changeslet (fs_watch_tx, fs_watch_rx) = watch::channel(());let mut fs_watch = new_debouncer(Duration::from_secs(1),None,move |result: DebounceEventResult| match result {Ok(events) => events.iter().for_each(|event| {// TODO: distinguish ".pijul" changes// dbg!(event);if event.kind.is_create()|| event.kind.is_modify()|| event.kind.is_remove(){let _ = fs_watch_tx.send(());}}),Err(errors) => {errors.iter().for_each(|error| eprintln!("{error:?}"))}},).unwrap();fs_watch.watch(&state.repo_path, RecursiveMode::Recursive).unwrap();let fs_watch_rx = WatchStream::from_changes(fs_watch_rx);let watch_task = Task::run(fs_watch_rx, |()| {Message::ToRepo(repo::MsgIn::RefreshChangedAndUntrackedFiles)});state.repo_fs_watch = Some(fs_watch);watch_task