fix moved tracked file view
[?]
Nov 16, 2025, 8:36 PM
HPSOAD4RXHXU7TSVX2AD5ZDGHMS7HLYNRARWHJCXGGH5RWW7LH6QCDependencies
- [2]
SWWE2R6Mdisplay basic repo stuff - [3]
KT5UYXGKfix selection after adding file, add changed file diffs - [4]
A5YBC77Vrecord! - [5]
4WO3ZJM2show untracked files' contents - [6]
W4LFX7IHgroup diffs by file name - [7]
MJDGPSHGWIP contents diff - [8]
ZVI4AWERwoot contents_diff - [9]
QMAUTRB6refactor diff - [10]
WI2BVQ6Jrm client lib crate - [11]
L6KSEFQImove cursor related stuff into its module - [12]
BFN2VHZSrefactor file stuff into sub-mod - [13]
23SFYK4Qbig view refactor into a new crate - [14]
XSZZB47Urefactor stuff into lib - [15]
ACDXXAX2refactor main's updates into smaller fns - [16]
I56UGW7Umake record test, fix log update - [17]
ESMM3FELtest selection reindexing - [18]
TSFQFCB2test got repo change - [19]
SASAN2XCuse nav-scrollable - [20]
GOLHUD6Rnav-scrollable: set skip-able sections - [21]
WXQBBQ2Aupdate nightly - [22]
UR4J677Rnav for log changes and refactors - [23]
JZXYSIYDchannel selection! - [24]
3XRG4BB6rewritten nav-scrollable! - [25]
WAOGSCOJvery nice refactor, wip adding channels logs - [26]
WH57EHNMupdate tests - [27]
YK3MOJJLchonky refactor, wip other channels logs & diffs - [28]
5O4FWCFPadd tests to_record selection and improve it - [29]
VCNKFNUFapp init test - [30]
SWDPAGF6test channel name - [31]
KWTBNTO3diffs selection and scrolling - [32]
MYGIBRRHwip custom theme - [33]
UF5NJKAStest load repo - [34]
3BK22XE5add a test for hover btn and more refactors - [35]
RDRBP7ALauto-scroll status selection - [36]
2LWMGRUMtest diff - [37]
A6Z4O6RCactions menu - [38]
OJPGHVC3entire log! - [39]
EJPSD5XOshared allowed actions conditions between update and view - [40]
ZIUHKVJKupdate tests - [41]
UUB7SHLRmore re-use in diffs - [42]
AMPZ2BXKshow changed files diffs (only Edit atm) - [43]
LFEMJYYDstart of to_record selection - [44]
OC6DLIZ3test record when nothing to record - [*]
WT3GA27Padd cursor with selection - [*]
6YZAVBWUInitial commit
Change contents
- replacement in libflorescence/src/repo.rs at line 15
use pijul::changestore::ChangeStore;use pijul::changestore::{ChangeStore, FileMetadata}; - replacement in libflorescence/src/repo.rs at line 113
Move,Del,Move {old_path: String,},Del {contents: Option<Contents>,}, - replacement in libflorescence/src/repo.rs at line 161
ChangedFileDiff::Move => None,ChangedFileDiff::Del => None,ChangedFileDiff::Move { .. } => None,ChangedFileDiff::Del { .. } => None, - replacement in libflorescence/src/repo.rs at line 809
add: _,path,} => {changes.entry(path.clone()).or_default().insert(ChangedFileDiff::Move);}add,path: old_path,} => match add {change::Atom::NewVertex(add) => {let FileMetadata {basename: new_path,metadata: _,..} = FileMetadata::read(&diff.contents[add.start.0.into()..add.end.0.into()],);changes.entry(new_path.to_string()).or_default().insert(ChangedFileDiff::Move {old_path: old_path.clone(),},);}change::Atom::EdgeMap(_edge_map) => todo!(),}, - replacement in libflorescence/src/repo.rs at line 830
contents: _,contents, - replacement in libflorescence/src/repo.rs at line 832
encoding: _,encoding, - edit in libflorescence/src/repo.rs at line 834
let contents = if let Some(contents) = contents.as_ref() {let raw_contents = get_change_contents(repo_changes,contents,&diff.contents,)?;Some(try_decode_contents(raw_contents, encoding))} else {None}; - replacement in libflorescence/src/repo.rs at line 848
.insert(ChangedFileDiff::Del);.insert(ChangedFileDiff::Del { contents }); - replacement in libflorescence/src/diff.rs at line 49
Del,// Also present in `DiffWithoutContents` to show that the whole file is// deletedDel {contents: Option<String>,}, - edit in libflorescence/src/diff.rs at line 55
/// Also present in `DiffWithoutContents` to show the old pathMove, - replacement in libflorescence/src/diff.rs at line 63
Move,Move {old_path: String,},Del, - replacement in inflorescence_view/src/diff.rs at line 226
DiffWithContents::Del => el(text("Deleted")),DiffWithContents::Del { contents } => {if let Some(contents) = contents {let line_num = 1;let lines = contents_to_lines(contents);let max_line_num = line_num + lines.len();let line_num_digits = max_line_num.to_string().len();let lines_view =lines.into_iter().enumerate().map(|(ix, line)| {line_view(LineKind::Deleted,line_num + ix,line_num_digits,line,)});el(column(lines_view))} else {el(text("Deleted"))}} - edit in inflorescence_view/src/diff.rs at line 248
DiffWithContents::Move => el(text(format!("Moved"))), - edit in inflorescence_view/src/diff.rs at line 260
DiffWithoutContents::Move => el(text("Move")), - edit in inflorescence_view/src/diff.rs at line 309
DiffWithoutContents::Move { old_path } => {el(text(format!("Moved from {old_path}")))}DiffWithoutContents::Del => el(text("Deleted file")), - replacement in inflorescence_model/src/to_record/test.rs at line 146
let change_a_1 = repo::ChangedFileDiff::Move;let change_a_1 = repo::ChangedFileDiff::SolveNameConflict; - replacement in inflorescence_model/src/to_record/test.rs at line 148
let change_b_1 = repo::ChangedFileDiff::Del;let change_b_1 = repo::ChangedFileDiff::SolveNameConflict; - replacement in inflorescence/src/test.rs at line 2
init, reindex_selection, repo_got_change_diffs, selection, update, Msg,State,diff, file, init, reindex_selection, repo, repo_got_change_diffs,selection, update, Msg, State, - edit in inflorescence/src/test.rs at line 12
use libflorescence::{file, repo}; - replacement in inflorescence/src/test.rs at line 776
let task = reindex_selection(// // Add a diff that would make `reindex_selection` expect that the file// doesn't exist{let changed_file = BTreeSet::from_iter([repo::ChangedFileDiff::Del {contents: None,}]);assert!(!diff::should_file_exist(&changed_file));ready_state.repo.changed_files.insert("changed_1.rs".to_string(), changed_file);}let mut task = reindex_selection( - replacement in inflorescence/src/test.rs at line 802
assert!(task.is_none());assert!(state.files.diffs_cache.inner.is_empty());assert!(task.is_some());let msg = await_next_msg(&mut task).await;assert_matches!(&msg,crate::Msg::File(file::Msg::SrcFileDoesntExist { .. }));// The file will be assembled from the diffassert_matches!(state.files.diffs_cache.inner.peek(&file::id_parts_hash("changed_1.rs", file::Kind::Changed)),Some(file::Diff::Loaded(_)));// Clear the cache for next test casestate.files.diffs_cache.inner.clear(); - replacement in inflorescence/src/selection.rs at line 1648
if let Some(diffs) = ctx.repo.changed_files.get(&path)&& diff::any_diff_has_contents(diffs)let file_task = if let Some(diffs) =ctx.repo.changed_files.get(&path) - replacement in inflorescence/src/selection.rs at line 1651
file::load_src_file_if_not_cached(ctx.files, id);}if diff::should_file_exist(diffs) {file::load_src_file_if_not_cached(ctx.files, id);Task::none()} else {file::src_file_doesnt_exist(ctx.files, id, diffs).map(crate::Msg::File)}} else {Task::none()}; - replacement in inflorescence/src/selection.rs at line 1663
(Some(selection), selection_task)(Some(selection), Task::batch([selection_task, file_task])) - replacement in inflorescence/src/selection.rs at line 1971
match file::try_get_src_file(files, file_id) {let task = match file::try_get_src_file(files, file_id) { - edit in inflorescence/src/selection.rs at line 1981
Task::none() - replacement in inflorescence/src/selection.rs at line 1990
if diff::any_diff_has_contents(diffs) {if diff::should_file_exist(diffs) { - edit in inflorescence/src/selection.rs at line 1992
Task::none()} else {file::src_file_doesnt_exist(files, id, diffs).map(crate::Msg::File) - replacement in inflorescence/src/selection.rs at line 1998
}}; - replacement in inflorescence/src/selection.rs at line 2017
(selection, Task::none())(selection, task) - replacement in inflorescence/src/main.rs at line 1168
if selection.is_some()let task = if selection.is_some() - edit in inflorescence/src/main.rs at line 1170
&& diff::any_diff_has_contents(diffs) - replacement in inflorescence/src/main.rs at line 1171
file::load_src_file_if_not_cached(files,file::Id {path: path.clone(),file_kind: file::Kind::Changed,},);}let id = file::Id {path: path.clone(),file_kind: file::Kind::Changed,};if diff::should_file_exist(diffs) {file::load_src_file_if_not_cached(files, id);Task::none()} else {file::src_file_doesnt_exist(files, id, diffs).map(Msg::File)}} else {Task::none()}; - replacement in inflorescence/src/main.rs at line 1186
(selection, Task::none())(selection, task) - edit in inflorescence/src/file.rs at line 13
use std::borrow::Cow; - edit in inflorescence/src/file.rs at line 29
// TODO watch bad, it has to queue things! - edit in inflorescence/src/file.rs at line 42
/// File cannot be loaded because it's either been moved or deletedSrcFileDoesntExist {id: Id,}, - edit in inflorescence/src/file.rs at line 167
Msg::SrcFileDoesntExist { id } => {let id_hash = id_hash(&id);return Some(Loaded {file_id: id_hash,unchanged_sections: HashSet::new(),});} - edit in inflorescence/src/file.rs at line 217
}}pub fn src_file_doesnt_exist(state: &mut State,id: Id,changed_file: &repo::ChangedFile,) -> Task<Msg> {let id_hash = id_hash(&id);if !state.diffs_cache.inner.contains(&id_hash) {let content = diff::FileContent::Decoded(Cow::from(""));let file = diff::init_file(content, Some(changed_file));diffs_cache_put(&mut state.diffs_cache, id_hash, Diff::Loaded(file));return Task::done(Msg::SrcFileDoesntExist { id }); - edit in inflorescence/src/file.rs at line 232
Task::none() - replacement in inflorescence/src/diff.rs at line 45
repo::ChangedFileDiff::Move => {without.push(DiffWithoutContents::Move);repo::ChangedFileDiff::Move{ old_path } => {without.push(DiffWithoutContents::Move { old_path: old_path.clone() });with.push(DiffWithContents::Move); - replacement in inflorescence/src/diff.rs at line 49
repo::ChangedFileDiff::Del => {with.push(DiffWithContents::Del);repo::ChangedFileDiff::Del { contents } => {let contents = match contents {Some(repo::Contents::Decoded(lines) | repo::Contents::ShortBase64(lines)) => Some(lines.clone()),Some(repo::Contents::UnknownEncoding(_)) | None => None};without.push(DiffWithoutContents::Del);with.push(DiffWithContents::Del{ contents }); - replacement in inflorescence/src/diff.rs at line 138
/// Returns true if any of the changed file's diffs has contentspub fn any_diff_has_contents(changed_file: &repo::ChangedFile) -> bool {let (with_contents, _without_contents) =from_repo_changed_file(changed_file);!with_contents.is_empty()/// Returns true if from the diffs imply that the file should exist.pub fn should_file_exist(changed_file: &repo::ChangedFile) -> bool {for change in changed_file {match change {repo::ChangedFileDiff::Del { .. }| repo::ChangedFileDiff::AddRoot| repo::ChangedFileDiff::DelRoot => return false,repo::ChangedFileDiff::Move { .. }| repo::ChangedFileDiff::Undel| repo::ChangedFileDiff::Add| repo::ChangedFileDiff::SolveNameConflict| repo::ChangedFileDiff::UnsolveNameConflict| repo::ChangedFileDiff::Edit { .. }| repo::ChangedFileDiff::Replacement { .. }| repo::ChangedFileDiff::SolveOrderConflict| repo::ChangedFileDiff::UnsolveOrderConflict| repo::ChangedFileDiff::ResurrectZombines => {}}}true - replacement in inflorescence/src/diff.rs at line 207
DiffWithContents::Del => {DiffWithContents::Move => { - replacement in inflorescence/src/diff.rs at line 209
let deleted: Vec<_> = file_lines.map(str::to_string).collect();let lines: Vec<_> = file_lines.map(str::to_string).collect();let max_line_num = lines.len();sections.push(Section::Unchanged(lines));return Combined {sections,max_line_num,};}DiffWithContents::Del { contents } => {let deleted = contents.as_deref().map(contents_to_lines).unwrap_or_default(); - replacement in iced_expl_widget/src/nav_scrollable.rs at line 651
Element::from(if ix == selected_section_ix {Element::from(if Some(ix) == selected_section_ix { - replacement in iced_expl_widget/src/nav_scrollable.rs at line 710
pub fn select_fst_section(&self) -> usize {pub fn select_fst_section(&self) -> Option<usize> { - replacement in iced_expl_widget/src/nav_scrollable.rs at line 713
if let Some(ix) = inner.selected_section {ixif inner.skip_sections.len() == inner.section_heights.len() {None} else if let Some(ix) = inner.selected_section {Some(ix) - edit in iced_expl_widget/src/nav_scrollable.rs at line 718
debug_assert!(inner.skip_sections.len() < inner.section_heights.len(),"There has to be at least one non-skip section"); - replacement in iced_expl_widget/src/nav_scrollable.rs at line 723
selected_sectionSome(selected_section)