add log files selection
[?]
May 6, 2025, 6:44 PM
TEI5NQ3SCTU6JQIPU62B2AUXWRFSEU6DZYJG5T526G666VV5XXPACDependencies
- [2]
WT3GA27Padd cursor with selection - [3]
W7IUT3ZVstart recording impl - [4]
YBJRDOTCmake all repo actions async - [5]
D7A7MSIHallow to defer or abandon record, add buttons - [6]
4WO3ZJM2show untracked files' contents - [7]
FDDPOH5Radd arrow controls - [8]
NRCUG4R2load changed files src when selected - [9]
Y5ATDI2Hconvert changed file diffs and load src only if any needs it - [10]
ZVI4AWERwoot contents_diff - [11]
QMAUTRB6refactor diff - [12]
OQ6HSAWHshow record log - [13]
AHWWRC73navigate log entries - [14]
UJPRF6DAfix log changes selection - [15]
KT5UYXGKfix selection after adding file, add changed file diffs - [*]
6YZAVBWUInitial commit
Change contents
- edit in crates/inflorescence/src/main.rs at line 223
CursorRight,CursorLeft, - edit in crates/inflorescence/src/main.rs at line 226
// TODO 2nd level cursor, should work much the sameLogEntryFileSelect {path: String,}, - edit in crates/inflorescence/src/main.rs at line 301
let log_file_selection = |log_entry: &repo::LogEntry,file_ix: usize,log_ix: usize,hash: pijul::Hash|-> cursor::Selection {let path = log_entry.file_paths.iter().nth(file_ix).unwrap().clone();cursor::Selection::LogChange {ix: log_ix,hash,file: Some(cursor::LogChangeFileSelection { ix: file_ix, path }),}}; - replacement in crates/inflorescence/src/main.rs at line 419
ix,hash: _,ix: log_ix,hash, - replacement in crates/inflorescence/src/main.rs at line 424
Some(_) => todo!(),Some(cursor::LogChangeFileSelection {ix: file_ix,path: _,}) => {let log_entry =repo.log.iter().nth(*log_ix).unwrap();let file_ix = if log_entry.file_paths.len().saturating_sub(1)== *file_ix{0} else {file_ix + 1};log_file_selection(log_entry, file_ix, *log_ix, *hash,)} - replacement in crates/inflorescence/src/main.rs at line 447
if repo.log.len().saturating_sub(1) == *ix {if repo.log.len().saturating_sub(1) == *log_ix { - replacement in crates/inflorescence/src/main.rs at line 469
let ix = ix + 1;let ix = log_ix + 1; - replacement in crates/inflorescence/src/main.rs at line 581
Some(cursor::Selection::LogChange { ix, hash, file }) => {Some(cursor::Selection::LogChange {ix: log_ix,hash,file,}) => { - replacement in crates/inflorescence/src/main.rs at line 587
Some(_) => todo!(),Some(cursor::LogChangeFileSelection {ix: file_ix,path: _,}) => {let log_entry =repo.log.iter().nth(*log_ix).unwrap();let file_ix = if 0 == *file_ix {log_entry.file_paths.len() - 1} else {file_ix - 1};log_file_selection(log_entry, file_ix, *log_ix, *hash,)} - replacement in crates/inflorescence/src/main.rs at line 605
if 0 == *ix {if 0 == *log_ix { - replacement in crates/inflorescence/src/main.rs at line 627
let ix = ix - 1;let ix = log_ix - 1; - edit in crates/inflorescence/src/main.rs at line 659
}Task::none()}Message::CursorLeft | Message::CursorRight => {if let Some(repo) = state.repo.as_ref() {// The outter `Option` is for whether the selection should change, the inner is what it should change to if solet new_selection: Option<Option<cursor::Selection>> =match state.cursor.selection.as_ref() {Some(cursor::Selection::LogChange {ix,hash,file,}) => Some(Some(if file.is_none() {let log_entry = repo.log.iter().nth(*ix).unwrap();let file = if let Some(path) =log_entry.file_paths.first(){Some(cursor::LogChangeFileSelection {ix: 0,path: path.clone(),})} else {None};cursor::Selection::LogChange {ix: *ix,hash: *hash,file,}} else {cursor::Selection::LogChange {ix: *ix,hash: *hash,file: None,}})),Some(cursor::Selection::UntrackedFile { .. })| Some(cursor::Selection::ChangedFile { .. })| None => None,};if let Some(selection) = new_selection {state.cursor.selection = selection;} - replacement in crates/inflorescence/src/main.rs at line 716
cursor::Selection::UntrackedFile {Some(cursor::Selection::UntrackedFile { - replacement in crates/inflorescence/src/main.rs at line 720
}}) - replacement in crates/inflorescence/src/main.rs at line 739
cursor::Selection::ChangedFile {Some(cursor::Selection::ChangedFile { - replacement in crates/inflorescence/src/main.rs at line 743
}}) - replacement in crates/inflorescence/src/main.rs at line 746
cursor::Selection::LogChange {Some(cursor::Selection::LogChange { - edit in crates/inflorescence/src/main.rs at line 750
})}cursor::Select::LogChangeFile { ix, path } => {let file = cursor::LogChangeFileSelection { ix, path };if let Some(cursor::Selection::LogChange {ix,hash,file: _,}) = state.cursor.selection{Some(cursor::Selection::LogChange {ix,hash,file: Some(file),})} else {None - replacement in crates/inflorescence/src/main.rs at line 770
state.cursor.selection = Some(selection);state.cursor.selection = selection; - edit in crates/inflorescence/src/main.rs at line 773
Message::LogEntryFileSelect { path } => todo!(), - edit in crates/inflorescence/src/main.rs at line 1170
"h" => Some(Message::CursorLeft),"l" => Some(Message::CursorRight), - edit in crates/inflorescence/src/main.rs at line 1178
Key::Named(key::Named::ArrowLeft) => Some(Message::CursorLeft),Key::Named(key::Named::ArrowRight) => {Some(Message::CursorRight)} - replacement in crates/inflorescence/src/main.rs at line 1398
let files = entry.file_paths.iter().map(|path| {let files = entry.file_paths.iter().enumerate().map(|(ix, path)| { - replacement in crates/inflorescence/src/main.rs at line 1400
el(button(text(path)).on_press_with(|| {Message::LogEntryFileSelect { path: path.clone() }el(button(text(path)).on_press_with(move || {Message::CursorSelect(cursor::Select::LogChangeFile { ix, path: path.clone() }) - edit in crates/inflorescence/src/cursor.rs at line 40
LogChangeFile { ix: usize, path: String },