AHWWRC73FXLSUDAJBU5UU76MZETHD3DSGJ7OLZPFEHXBDJ733QNAC WT3GA27PQ2AOAIGK65O3Q4DMX4AZDVNULBLRL6GF4QW6QCASUEAAC EC3TVL4X6VZZVLOKUN63LC73ADPHBHMZO7QMDXGX2ZPURVI4B4XQC KT5UYXGKEEXUHURNOYFVIG7WQ3Y3SJZMM2TP4OSW6NXSXQ5XXRHAC YBJRDOTCX3ZRDB5EVXJBR55FX3CADCSIGMYWNYVC2PD5W3GXR3DQC 4WO3ZJM2RNYZCBPS7FGYAEBELYD57OSS7LEUYCWGZBCAY272SNQQC W4LFX7IHQ7SDX67ATSGWDB5IN6472ZJDBKY2XZ54SBJEYD5GAT5QC V55EAIWQXWER2HWKZHPJBV7DDJMSPSPWSO3FSSAYODJHVDBHUN6QC NRCUG4R2NIM2ANIETSUZ7WZDXFOOCMJ73ROP5MDYJA4RUT4PYA4QC Y5ATDI2HRWTTYJAVUR7SVWQVB4ZKKDZF3UVE4JJQFZ7RX7H7VPJQC ZVI4AWERNOTDJ3765HJXRBZT57XPNKVONQ6TGOGNPOL2VN42KMJQC OQ6HSAWHIRTAIIWMDGCTIOK47JDY7QVVAHLRDA2R5TTJKNSBFCWQC SWWE2R6MVBX5CNM6X3WLXZTSRTU53PBJL7WJSFVF77XBPXDX4COAC 6YZAVBWU6E5FYOI5JGEIPXGZLIKAW6LS2AOFIQWEE5DMOPPCD5PQC 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)
};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() {
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)
} else {let ix = 0;Some(untracked_file_selection(repo,ix,&mut state.diffs_cache,&state.src_file_load_tx,))
};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
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(
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)
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() {
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,}}),
let is_selected = matches!(state.cursor.selection.as_ref() ,Some(cursor::Selection::ChangedFile{ix: selected_ix, path:_, diffs:_}) if &ix == selected_ix
let is_selected = matches!(state.cursor.selection.as_ref(),Some(cursor::Selection::ChangedFile{ ix: selected_ix, .. }) if &ix == selected_ix
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))),]))