partition the change files diffs on whether they have content
[?]
Apr 23, 2025, 7:22 AM
UMO6U2ZTJ6LTWJXAKQMEJO2MCMFSJZJZ6UZ2SPY2FPU4OPVKPIMACDependencies
- [2]
YBJRDOTCmake all repo actions async - [3]
4WO3ZJM2show untracked files' contents - [4]
W4LFX7IHgroup diffs by file name - [5]
AMPZ2BXKshow changed files diffs (only Edit atm) - [6]
V55EAIWQadd src file LRU cache - [7]
NRCUG4R2load changed files src when selected - [8]
Y5ATDI2Hconvert changed file diffs and load src only if any needs it - [9]
YBLPPHZNshow contents for move, del and undel - [10]
RPCIGCNSadd replacement diff details - [11]
IQDCHWCPload a pijul repo - [12]
KT5UYXGKfix selection after adding file, add changed file diffs - [*]
SWWE2R6Mdisplay basic repo stuff - [*]
6YZAVBWUInitial commit
Change contents
- edit in crates/libflowers_client/src/repo.rs at line 24
pub const ROOT_FILE: &str = ".";pub const MAX_LEN_BASE64_DISPLAY: usize = 4096; - edit in crates/libflowers_client/src/repo.rs at line 47
pub const ROOT_FILE: &str = ".";pub const MAX_LEN_BASE64_DISPLAY: usize = 4096; - edit in crates/libflowers_client/src/repo.rs at line 58
/// Is the content deleted - edit in crates/flowers_ui/src/main.rs at line 167
/// The order of the vec matches `repo::ChangedFile`type ChangedFileContents = Vec<ChangedFileDiff>; - replacement in crates/flowers_ui/src/main.rs at line 168
enum ChangedFileDiff {WithContents(ChangedFileDiffWithContents),WithoutContents(ChangedFileDiffWithoutContents),struct ChangedFileContents {with_contents: Vec<ChangedFileDiffWithContents>,without_contents: Vec<ChangedFileDiffWithoutContents>, - replacement in crates/flowers_ui/src/main.rs at line 871[5.3059]→[5.3059:3090](∅→∅),[5.3090]→[8.3018:3118](∅→∅),[8.3118]→[5.4229:4266](∅→∅),[5.4229]→[5.4229:4266](∅→∅)
.map(|(file, diffs)| {let contents =diffs.iter().map(changed_file_diff_from_repo).collect();(file.clone(), contents).map(|(path, diffs)| {let contents = changed_file_contents(diffs);(path.clone(), contents) - replacement in crates/flowers_ui/src/main.rs at line 878[5.4299]→[8.3119:3227](∅→∅),[8.3227]→[9.53:437](∅→∅),[9.437]→[8.3629:4772](∅→∅),[8.3629]→[8.3629:4772](∅→∅)
fn changed_file_diff_from_repo(value: &repo::ChangedFileDiff,) -> ChangedFileDiff {match value {repo::ChangedFileDiff::Move => {ChangedFileDiff::WithContents(ChangedFileDiffWithContents::Move)}repo::ChangedFileDiff::Del => {ChangedFileDiff::WithContents(ChangedFileDiffWithContents::Del)}repo::ChangedFileDiff::Undel => {ChangedFileDiff::WithContents(ChangedFileDiffWithContents::Undel)}repo::ChangedFileDiff::Add => {ChangedFileDiff::WithContents(ChangedFileDiffWithContents::Add)}repo::ChangedFileDiff::SolveNameConflict => {ChangedFileDiff::WithoutContents(ChangedFileDiffWithoutContents::SolveNameConflict,)}repo::ChangedFileDiff::UnsolveNameConflict => {ChangedFileDiff::WithoutContents(ChangedFileDiffWithoutContents::UnsolveNameConflict,)}repo::ChangedFileDiff::Edit {line,deleted,contents,} => ChangedFileDiff::WithContents(ChangedFileDiffWithContents::Edit {line: *line,deleted: *deleted,contents: contents_to_file_editor_content(contents),}),repo::ChangedFileDiff::Replacement {line,change_contents,replacement_contents,} => ChangedFileDiff::WithContents(ChangedFileDiffWithContents::Replacement {line: *line,change_contents: contents_to_file_editor_content(fn changed_file_contents(diffs: &repo::ChangedFile) -> ChangedFileContents {let (with_contents, without_contents) = diffs.iter().fold((vec![], vec![]),|(mut acc_with, mut acc_without), diff| {match diff {repo::ChangedFileDiff::Move => {acc_with.push(ChangedFileDiffWithContents::Move)}repo::ChangedFileDiff::Del => {acc_with.push(ChangedFileDiffWithContents::Del)}repo::ChangedFileDiff::Undel => {acc_with.push(ChangedFileDiffWithContents::Undel)}repo::ChangedFileDiff::Add => {acc_with.push(ChangedFileDiffWithContents::Add)}repo::ChangedFileDiff::SolveNameConflict => acc_without.push(ChangedFileDiffWithoutContents::SolveNameConflict),repo::ChangedFileDiff::UnsolveNameConflict => acc_without.push(ChangedFileDiffWithoutContents::UnsolveNameConflict),repo::ChangedFileDiff::Edit {line,deleted,contents,} => acc_with.push(ChangedFileDiffWithContents::Edit {line: *line,deleted: *deleted,contents: contents_to_file_editor_content(contents),}),repo::ChangedFileDiff::Replacement {line, - edit in crates/flowers_ui/src/main.rs at line 911
),replacement_contents: contents_to_file_editor_content( - replacement in crates/flowers_ui/src/main.rs at line 912
),},),repo::ChangedFileDiff::SolveOrderConflict => {ChangedFileDiff::WithoutContents(ChangedFileDiffWithoutContents::SolveOrderConflict,)}repo::ChangedFileDiff::UnsolveOrderConflict => {ChangedFileDiff::WithoutContents(ChangedFileDiffWithoutContents::UnsolveOrderConflict,)}repo::ChangedFileDiff::ResurrectZombines => {ChangedFileDiff::WithoutContents(ChangedFileDiffWithoutContents::ResurrectZombines,)}repo::ChangedFileDiff::AddRoot => ChangedFileDiff::WithoutContents(ChangedFileDiffWithoutContents::AddRoot,),repo::ChangedFileDiff::DelRoot => ChangedFileDiff::WithoutContents(ChangedFileDiffWithoutContents::DelRoot,),} => acc_with.push(ChangedFileDiffWithContents::Replacement {line: *line,change_contents: contents_to_file_editor_content(change_contents,),replacement_contents: contents_to_file_editor_content(replacement_contents,),}),repo::ChangedFileDiff::SolveOrderConflict => acc_without.push(ChangedFileDiffWithoutContents::SolveOrderConflict),repo::ChangedFileDiff::UnsolveOrderConflict => acc_without.push(ChangedFileDiffWithoutContents::UnsolveOrderConflict),repo::ChangedFileDiff::ResurrectZombines => acc_without.push(ChangedFileDiffWithoutContents::ResurrectZombines),repo::ChangedFileDiff::AddRoot => {acc_without.push(ChangedFileDiffWithoutContents::AddRoot)}repo::ChangedFileDiff::DelRoot => {acc_without.push(ChangedFileDiffWithoutContents::DelRoot)}};(acc_with, acc_without)},);ChangedFileContents {with_contents,without_contents, - replacement in crates/flowers_ui/src/main.rs at line 1037
changed_file.iter().any(|diff| matches!(diff, ChangedFileDiff::WithContents(_)))!changed_file.with_contents.is_empty()