navigate log entries
[?]
May 5, 2025, 4:38 PM
AHWWRC73FXLSUDAJBU5UU76MZETHD3DSGJ7OLZPFEHXBDJ733QNACDependencies
- [2]
WT3GA27Padd cursor with selection - [3]
EC3TVL4Xadd untracked files - [4]
KT5UYXGKfix selection after adding file, add changed file diffs - [5]
YBJRDOTCmake all repo actions async - [6]
4WO3ZJM2show untracked files' contents - [7]
W4LFX7IHgroup diffs by file name - [8]
V55EAIWQadd src file LRU cache - [9]
NRCUG4R2load changed files src when selected - [10]
Y5ATDI2Hconvert changed file diffs and load src only if any needs it - [11]
ZVI4AWERwoot contents_diff - [12]
OQ6HSAWHshow record log - [13]
KM5PSZ4Awatch repo once loaded - [14]
A5YBC77Vrecord! - [15]
DVKSPF7Rtrack selected file path together with an index - [16]
SWWE2R6Mdisplay basic repo stuff - [17]
QMAUTRB6refactor diff - [18]
D7A7MSIHallow to defer or abandon record, add buttons - [19]
AMPZ2BXKshow changed files diffs (only Edit atm) - [*]
6YZAVBWUInitial commit
Change contents
- replacement in crates/libflorescence/src/repo.rs at line 144
RefreshedChangedAndUntrackedFiles {RefreshedState { - edit in crates/libflorescence/src/repo.rs at line 147
log: Log, - edit in crates/libflorescence/src/repo.rs at line 159
pub file_paths: Vec<String>, - replacement in crates/libflorescence/src/repo.rs at line 207
let _ =msg_out_tx.send(MsgOut::RefreshedChangedAndUntrackedFiles {untracked_files,changed_files,});let log = state.log.clone();let _ = msg_out_tx.send(MsgOut::RefreshedState {untracked_files,changed_files,log,}); - edit in crates/libflorescence/src/repo.rs at line 760
let files = repo.changes.get_changes(&h).unwrap();let file_paths: HashSet<String> = files.into_iter().map(|hunk| hunk.path().to_string()).collect();let file_paths: Vec<String> = file_paths.into_iter().collect(); - edit in crates/libflorescence/src/repo.rs at line 769
file_paths, - edit in crates/inflorescence/src/main.rs at line 224
// TODO 2nd level cursor, should work much the sameLogEntryFileSelect {path: String,}, - edit in crates/inflorescence/src/main.rs at line 292
let log_selection = |repo: &repo::State, ix: usize| -> cursor::Selection {let entry = repo.log.iter().nth(ix).unwrap(); - edit in crates/inflorescence/src/main.rs at line 296
cursor::Selection::LogChange {ix,hash: entry.hash,file: None,}}; - replacement in crates/inflorescence/src/main.rs at line 323
state.cursor.selection =match state.cursor.selection.as_ref() {Some(cursor::Selection::UntrackedFile {ix,path: _,diffs: _,}) => {let new_selection =if repo.untracked_files.len().saturating_sub(1)== *ix{if repo.changed_files.is_empty() {let ix = 0;untracked_file_selection(repo,ix,&mut state.diffs_cache,&state.src_file_load_tx,)} else {let ix = 0;changed_file_selection(repo,ix,&mut state.diffs_cache,&state.src_file_load_tx,)}state.cursor.selection = match state.cursor.selection.as_ref() {Some(cursor::Selection::UntrackedFile {ix,path: _,diffs: _,}) => {let new_selection =if repo.untracked_files.len().saturating_sub(1)== *ix{if !repo.changed_files.is_empty() {let ix = 0;changed_file_selection(repo,ix,&mut state.diffs_cache,&state.src_file_load_tx,)} else if !repo.log.is_empty() {let ix = 0;log_selection(repo, ix) - replacement in crates/inflorescence/src/main.rs at line 345
let ix = ix + 1;let ix = 0; - replacement in crates/inflorescence/src/main.rs at line 352
};Some(new_selection)}Some(cursor::Selection::ChangedFile {ix,path: _,diffs: _,}) => {let new_selection =if repo.changed_files.len().saturating_sub(1)== *ix{if repo.untracked_files.is_empty() {}} else {let ix = ix + 1;untracked_file_selection(repo,ix,&mut state.diffs_cache,&state.src_file_load_tx,)};Some(new_selection)}Some(cursor::Selection::ChangedFile {ix,path: _,diffs: _,}) => {let new_selection = if repo.changed_files.len().saturating_sub(1)== *ix{if !repo.log.is_empty() {let ix = 0;log_selection(repo, ix)} else if !repo.untracked_files.is_empty() {let ix = 0;untracked_file_selection(repo,ix,&mut state.diffs_cache,&state.src_file_load_tx,)} else {let ix = 0;changed_file_selection(repo,ix,&mut state.diffs_cache,&state.src_file_load_tx,)}} else {let ix = ix + 1;changed_file_selection(repo,ix,&mut state.diffs_cache,&state.src_file_load_tx,)};Some(new_selection)}Some(cursor::Selection::LogChange {ix,hash: _,file,}) => {let new_selection = match file {Some(_) => todo!(),None => {if repo.log.len().saturating_sub(1) == *ix {if !repo.untracked_files.is_empty() { - replacement in crates/inflorescence/src/main.rs at line 417
changed_file_selection(untracked_file_selection( - replacement in crates/inflorescence/src/main.rs at line 423
} else {} else if !repo.changed_files.is_empty() { - replacement in crates/inflorescence/src/main.rs at line 425
untracked_file_selection(changed_file_selection( - edit in crates/inflorescence/src/main.rs at line 431
} else {let ix = 0;log_selection(repo, ix) - replacement in crates/inflorescence/src/main.rs at line 437[11.7401]→[9.757:817](∅→∅),[5.7721]→[9.757:817](∅→∅),[9.817]→[11.7402:7448](∅→∅),[10.1183]→[9.863:907](∅→∅),[11.7448]→[9.863:907](∅→∅),[9.863]→[9.863:907](∅→∅),[9.907]→[11.7449:7513](∅→∅),[11.7513]→[9.975:1078](∅→∅),[9.975]→[9.975:1078](∅→∅),[9.1078]→[11.7514:7623](∅→∅),[11.7623]→[12.4597:4729](∅→∅),[12.4729]→[11.7623:8242](∅→∅),[11.7623]→[11.7623:8242](∅→∅)
changed_file_selection(repo,ix,&mut state.diffs_cache,&state.src_file_load_tx,)};Some(new_selection)}Some(cursor::Selection::Change { hash }) => {todo!()}None => {if repo.untracked_files.is_empty() {if repo.changed_files.is_empty() {None} else {let ix = 0;Some(changed_file_selection(repo,ix,&mut state.diffs_cache,&state.src_file_load_tx,))log_selection(repo, ix) - edit in crates/inflorescence/src/main.rs at line 439[5.7824]→[5.7824:7861](∅→∅),[5.8395]→[3.4167:4211](∅→∅),[3.4167]→[3.4167:4211](∅→∅),[3.4211]→[11.8243:8306](∅→∅),[11.8306]→[6.3964:4006](∅→∅),[6.3964]→[6.3964:4006](∅→∅),[10.1383]→[9.1754:1794](∅→∅),[9.1754]→[9.1754:1794](∅→∅),[9.1794]→[11.8307:8367](∅→∅),[11.8367]→[9.1858:1954](∅→∅),[9.1858]→[9.1858:1954](∅→∅)
} else {let ix = 0;Some(untracked_file_selection(repo,ix,&mut state.diffs_cache,&state.src_file_load_tx,)) - edit in crates/inflorescence/src/main.rs at line 440
};Some(new_selection)}None => {if !repo.untracked_files.is_empty() {let ix = 0;Some(untracked_file_selection(repo,ix,&mut state.diffs_cache,&state.src_file_load_tx,))} else if !repo.changed_files.is_empty() {let ix = 0;Some(changed_file_selection(repo,ix,&mut state.diffs_cache,&state.src_file_load_tx,))} else {None - replacement in crates/inflorescence/src/main.rs at line 463
};}}; - replacement in crates/inflorescence/src/main.rs at line 477
if repo.changed_files.is_empty() {let ix = repo.untracked_files.len() - 1;untracked_file_selection(if !repo.log.is_empty() {let ix = repo.log.len() - 1;log_selection(repo, ix)} else if !repo.changed_files.is_empty() {let ix = repo.changed_files.len() - 1;changed_file_selection( - replacement in crates/inflorescence/src/main.rs at line 489
let ix = repo.changed_files.len() - 1;changed_file_selection(let ix = repo.untracked_files.len() - 1;untracked_file_selection( - replacement in crates/inflorescence/src/main.rs at line 514
if repo.untracked_files.is_empty() {let ix = repo.changed_files.len() - 1;changed_file_selection(if !repo.untracked_files.is_empty() {let ix = repo.untracked_files.len() - 1;untracked_file_selection( - edit in crates/inflorescence/src/main.rs at line 522
} else if !repo.log.is_empty() {let ix = repo.log.len() - 1;log_selection(repo, ix) - replacement in crates/inflorescence/src/main.rs at line 526
let ix = repo.untracked_files.len() - 1;untracked_file_selection(let ix = repo.changed_files.len() - 1;changed_file_selection( - replacement in crates/inflorescence/src/main.rs at line 545
Some(cursor::Selection::Change { hash }) => {todo!()Some(cursor::Selection::LogChange { ix, hash, file }) => {let new_selection = match file {Some(_) => todo!(),None => {if 0 == *ix {if !repo.changed_files.is_empty() {let ix = repo.changed_files.len() - 1;changed_file_selection(repo,ix,&mut state.diffs_cache,&state.src_file_load_tx,)} else if !repo.untracked_files.is_empty() {let ix = repo.untracked_files.len() - 1;untracked_file_selection(repo,ix,&mut state.diffs_cache,&state.src_file_load_tx,)} else {let ix = repo.log.len() - 1;log_selection(repo, ix)}} else {let ix = ix - 1;log_selection(repo, ix)}}};Some(new_selection) - replacement in crates/inflorescence/src/main.rs at line 579[5.10681]→[5.10681:10952](∅→∅),[5.10952]→[6.5434:5579](∅→∅),[6.5579]→[11.9241:9301](∅→∅),[11.9301]→[8.3979:4040](∅→∅),[8.3979]→[8.3979:4040](∅→∅),[8.4040]→[6.5718:5753](∅→∅),[6.5718]→[6.5718:5753](∅→∅),[6.5753]→[5.11025:11055](∅→∅),[5.11025]→[5.11025:11055](∅→∅),[5.11055]→[3.7184:7217](∅→∅),[3.7184]→[3.7184:7217](∅→∅)
if repo.changed_files.is_empty() {if repo.untracked_files.is_empty() {None} else {let ix = repo.untracked_files.len() - 1;Some(untracked_file_selection(repo,ix,&mut state.diffs_cache,&state.src_file_load_tx,))}} else {if !repo.changed_files.is_empty() { - edit in crates/inflorescence/src/main.rs at line 587
} else if !repo.untracked_files.is_empty() {let ix = repo.untracked_files.len() - 1;Some(untracked_file_selection(repo,ix,&mut state.diffs_cache,&state.src_file_load_tx,))} else {None - edit in crates/inflorescence/src/main.rs at line 648
Message::LogEntryFileSelect { path } => todo!(), - replacement in crates/inflorescence/src/main.rs at line 929
repo::MsgOut::RefreshedChangedAndUntrackedFiles {repo::MsgOut::RefreshedState { - edit in crates/inflorescence/src/main.rs at line 932
log, - edit in crates/inflorescence/src/main.rs at line 937
repo.log = log; - replacement in crates/inflorescence/src/main.rs at line 1003
cursor::Selection::Change { hash } => todo!(),cursor::Selection::LogChange { ix: _, hash, file } => repo.log.iter().enumerate().find(|(_ix, entry)| &entry.hash == hash).map(|(ix, entry)| {let file = file.as_ref().and_then(|file| {entry.file_paths.iter().enumerate().find(|(_ix, path)| *path == &file.path).map(|(ix, path)| {cursor::LogChangeFileSelection {ix,path: path.clone(),}})});cursor::Selection::LogChange {ix,hash: entry.hash,file,}}), - replacement in crates/inflorescence/src/main.rs at line 1140
Some(cursor::Selection::UntrackedFile{ix: selected_ix, path:_, diffs: _}) if &ix == selected_ixSome(cursor::Selection::UntrackedFile{ ix: selected_ix, .. }) if &ix == selected_ix - replacement in crates/inflorescence/src/main.rs at line 1155[7.4563]→[2.3660:3737](∅→∅),[4.7626]→[2.3660:3737](∅→∅),[2.3660]→[2.3660:3737](∅→∅),[2.3737]→[11.16737:16850](∅→∅)
let is_selected = matches!(state.cursor.selection.as_ref() ,Some(cursor::Selection::ChangedFile{ix: selected_ix, path:_, diffs:_}) if &ix == selected_ixlet is_selected = matches!(state.cursor.selection.as_ref(),Some(cursor::Selection::ChangedFile{ ix: selected_ix, .. }) if &ix == selected_ix - replacement in crates/inflorescence/src/main.rs at line 1169
let log = el(column(repo.log.iter().map(|repo::LogEntry { hash, message }| {let log = el(column(repo.log.iter().enumerate().map(|(ix, repo::LogEntry {hash,message,file_paths: _,})| { - replacement in crates/inflorescence/src/main.rs at line 1177
// TODOlet is_selected = false;let is_selected = matches!(state.cursor.selection.as_ref(),Some(cursor::Selection::LogChange { ix: selected_ix, .. }) if &ix == selected_ix); - replacement in crates/inflorescence/src/main.rs at line 1261
Some(cursor::Selection::Change { hash }) => {todo!()Some(cursor::Selection::LogChange { ix, hash, file }) => {let entry =state.repo.as_ref().unwrap().log.iter().nth(*ix).unwrap();let mut short_hash = hash.to_base32();short_hash.truncate(8);let files = entry.file_paths.iter().map(|path| {let is_selected = matches!(file, Some(cursor::LogChangeFileSelection{ix: _, path: selected_path}) if selected_path == path);el(button(text(path)).on_press_with(|| {Message::LogEntryFileSelect { path: path.clone() }}).style(selectable_button_style(is_selected)))});el(column([view_diff_header(format!("{} changed files:", short_hash)),el(scrollable(column(files))),])) - replacement in crates/inflorescence/src/cursor.rs at line 22
Change {LogChange {ix: usize, - edit in crates/inflorescence/src/cursor.rs at line 25
file: Option<LogChangeFileSelection>, - edit in crates/inflorescence/src/cursor.rs at line 27
}#[derive(Debug)]pub struct LogChangeFileSelection {pub ix: usize,pub path: String,