move main diffs state out of cursor

[?]
May 8, 2025, 6:07 PM
HC7ROIBC66IBYFED4ZZM7RXGSNC2CCBWBI36RKM2G5FD5DKVEYMQC

Dependencies

  • [2] UB2ITZJS refresh changed files on FS changes
  • [3] YBJRDOTC make all repo actions async
  • [4] D7A7MSIH allow to defer or abandon record, add buttons
  • [5] 4WO3ZJM2 show untracked files' contents
  • [6] V55EAIWQ add src file LRU cache
  • [7] NRCUG4R2 load changed files src when selected
  • [8] Y5ATDI2H convert changed file diffs and load src only if any needs it
  • [9] B4RMW5AE add syntax highlighter to untracked files contents
  • [10] ZVI4AWER woot contents_diff
  • [11] QMAUTRB6 refactor diff
  • [12] AHWWRC73 navigate log entries
  • [13] TEI5NQ3S add log files selection
  • [14] JE44NYHM display log files diffs
  • [15] ONRCENKT rm unnecessary state from repo's internal state
  • [16] 4ELJZGRJ load and store all change diffs at once
  • [17] AXSXZQDG fix updating changed file contents, styling
  • [18] BJXUYQ2Y show untracked file contents in read-only text editor
  • [19] VUIRSTKH fmt
  • [20] OQ6HSAWH show record log
  • [21] CFYW3HGZ wip: display changed files
  • [22] MJDGPSHG WIP contents diff
  • [23] ELG3UDT6 allow to rm added files
  • [24] WT3GA27P add cursor with selection
  • [25] KT5UYXGK fix selection after adding file, add changed file diffs
  • [26] AMPZ2BXK show changed files diffs (only Edit atm)
  • [27] EC3TVL4X add untracked files
  • [28] DCSUCH6R add undecoded diff view, improve decoded view style
  • [*] 6YZAVBWU Initial commit

Change contents

  • edit in crates/inflorescence/src/main.rs at line 5
    [9.41]
    [9.73]
    use std::collections::HashMap;
  • edit in crates/inflorescence/src/main.rs at line 125
    [10.991]
    [2.1520]
    diffs_state: HashMap::new(),
  • edit in crates/inflorescence/src/main.rs at line 142
    [10.1075]
    [4.58]
    diffs_state: HashMap<FileId, diff::State>,
  • replacement in crates/inflorescence/src/main.rs at line 260
    [5.3213][10.3620:3709](),[10.3709][11.362:409](),[11.409][10.3765:3779](),[10.3765][10.3765:3779]()
    cursor::Selection::UntrackedFile {
    ix,
    path,
    diffs: diff::State::default(),
    }
    [5.3213]
    [10.3779]
    cursor::Selection::UntrackedFile { ix, path }
  • edit in crates/inflorescence/src/main.rs at line 282
    [8.1086][11.410:457]()
    diffs: diff::State::default(),
  • replacement in crates/inflorescence/src/main.rs at line 308
    [16.1015][16.1015:1110]()
    file_ix: usize,
    hash: pijul::Hash|
    [16.1015]
    [16.1110]
    file_ix: usize|
  • edit in crates/inflorescence/src/main.rs at line 311
    [16.1222][13.356:357](),[14.1940][13.356:357](),[13.356][13.356:357]()
  • replacement in crates/inflorescence/src/main.rs at line 335
    [14.2240][12.1027:1210](),[12.1027][12.1027:1210]()
    Some(cursor::Selection::UntrackedFile {
    ix,
    path: _,
    diffs: _,
    }) => {
    [14.2240]
    [16.1292]
    Some(cursor::Selection::UntrackedFile { ix, path: _ }) => {
  • replacement in crates/inflorescence/src/main.rs at line 374
    [12.2567][12.2567:2748]()
    Some(cursor::Selection::ChangedFile {
    ix,
    path: _,
    diffs: _,
    }) => {
    [12.2567]
    [16.1919]
    Some(cursor::Selection::ChangedFile { ix, path: _ }) => {
  • replacement in crates/inflorescence/src/main.rs at line 437
    [14.3984][16.2576:2639](),[16.2639][14.4055:4152](),[14.4055][14.4055:4152]()
    let file = log_file_selection(
    log_entry, file_ix, hash,
    );
    [14.3984]
    [13.1363]
    let file =
    log_file_selection(log_entry, file_ix);
  • replacement in crates/inflorescence/src/main.rs at line 529
    [14.6578][10.8392:8575](),[3.9161][10.8392:8575]()
    Some(cursor::Selection::UntrackedFile {
    ix,
    path: _,
    diffs: _,
    }) => {
    [14.6578]
    [16.5655]
    Some(cursor::Selection::UntrackedFile { ix, path: _ }) => {
  • replacement in crates/inflorescence/src/main.rs at line 565
    [3.9907][10.8798:8979]()
    Some(cursor::Selection::ChangedFile {
    ix,
    path: _,
    diffs: _,
    }) => {
    [3.9907]
    [16.6259]
    Some(cursor::Selection::ChangedFile { ix, path: _ }) => {
  • replacement in crates/inflorescence/src/main.rs at line 621
    [13.2443][16.6893:6956](),[16.6956][14.7155:7252](),[14.7155][14.7155:7252]()
    let file = log_file_selection(
    log_entry, file_ix, hash,
    );
    [13.2443]
    [14.7252]
    let file =
    log_file_selection(log_entry, file_ix);
  • replacement in crates/inflorescence/src/main.rs at line 781
    [14.10828][14.10828:11045]()
    Some(cursor::Selection::UntrackedFile {
    ix,
    path,
    diffs: diff::State::default(),
    }),
    [14.10828]
    [14.11045]
    Some(cursor::Selection::UntrackedFile { ix, path }),
  • replacement in crates/inflorescence/src/main.rs at line 803
    [14.11128][14.11128:11343]()
    Some(cursor::Selection::ChangedFile {
    ix,
    path,
    diffs: diff::State::default(),
    }),
    [14.11128]
    [14.11343]
    Some(cursor::Selection::ChangedFile { ix, path }),
  • replacement in crates/inflorescence/src/main.rs at line 820
    [16.9212][16.9212:9250]()
    Task::none(),
    [16.9212]
    [16.9250]
    task,
  • replacement in crates/inflorescence/src/main.rs at line 856
    [3.11279][10.10931:11127]()
    if let Some(cursor::Selection::UntrackedFile {
    ix,
    path,
    diffs: _,
    }) = state.cursor.selection.as_ref()
    [3.11279]
    [3.11408]
    if let Some(cursor::Selection::UntrackedFile { ix, path }) =
    state.cursor.selection.as_ref()
  • replacement in crates/inflorescence/src/main.rs at line 895
    [3.12473][10.11181:11375]()
    if let Some(cursor::Selection::ChangedFile {
    ix,
    path,
    diffs: _,
    }) = state.cursor.selection.as_ref()
    [3.12473]
    [3.12600]
    if let Some(cursor::Selection::ChangedFile { ix, path }) =
    state.cursor.selection.as_ref()
  • replacement in crates/inflorescence/src/main.rs at line 1068
    [10.13281][10.13281:13362]()
    cursor::Selection::UntrackedFile { ix: _, path, diffs },
    [10.13281]
    [10.13362]
    cursor::Selection::UntrackedFile { ix: _, path },
  • edit in crates/inflorescence/src/main.rs at line 1071
    [10.13454]
    [11.948]
    let diffs = state.diffs_state.entry(id).or_default();
  • replacement in crates/inflorescence/src/main.rs at line 1075
    [10.13560][10.13560:13639]()
    cursor::Selection::ChangedFile { ix: _, path, diffs },
    [10.13560]
    [10.13639]
    cursor::Selection::ChangedFile { ix: _, path },
  • edit in crates/inflorescence/src/main.rs at line 1078
    [10.13729]
    [11.1002]
    let diffs = state.diffs_state.entry(id).or_default();
  • replacement in crates/inflorescence/src/main.rs at line 1145
    [14.13140][10.14024:14201](),[3.15531][10.14024:14201]()
    cursor::Selection::UntrackedFile {
    ix: _,
    path,
    diffs: _,
    } => {
    [14.13140]
    [6.5310]
    cursor::Selection::UntrackedFile { ix: _, path } => {
  • replacement in crates/inflorescence/src/main.rs at line 1160
    [14.13355][5.7892:7999](),[5.7892][5.7892:7999](),[5.7999][14.13356:13398](),[14.13398][11.1056:1123](),[5.8055][11.1056:1123](),[11.1123][5.8055:8089](),[10.14516][5.8055:8089](),[5.8055][5.8055:8089]()
    cursor::Selection::UntrackedFile {
    ix,
    path,
    diffs: diff::State::default(),
    }
    [14.13355]
    [14.13399]
    cursor::Selection::UntrackedFile { ix, path }
  • replacement in crates/inflorescence/src/main.rs at line 1164
    [5.8142][10.14517:14692]()
    cursor::Selection::ChangedFile {
    ix: _,
    path,
    diffs: _,
    } => {
    [5.8142]
    [15.2384]
    cursor::Selection::ChangedFile { ix: _, path } => {
  • edit in crates/inflorescence/src/main.rs at line 1188
    [7.4489][11.1124:1191]()
    diffs: diff::State::default(),
  • replacement in crates/inflorescence/src/main.rs at line 1464
    [5.8559][10.16938:17095]()
    Some(cursor::Selection::UntrackedFile {
    ix: _,
    path,
    diffs: selection_state,
    }) => {
    [5.8559]
    [10.17095]
    Some(cursor::Selection::UntrackedFile { ix: _, path }) => {
  • edit in crates/inflorescence/src/main.rs at line 1471
    [10.17364]
    [11.1245]
    let selection_state = state.diffs_state.get(&id);
  • replacement in crates/inflorescence/src/main.rs at line 1491
    [5.9353][10.17916:18071]()
    Some(cursor::Selection::ChangedFile {
    path,
    ix: _,
    diffs: selection_state,
    }) => {
    [5.9353]
    [10.18071]
    Some(cursor::Selection::ChangedFile { path, ix: _ }) => {
  • edit in crates/inflorescence/src/main.rs at line 1498
    [10.18338]
    [11.1442]
    let selection_state = state.diffs_state.get(&id);
  • replacement in crates/inflorescence/src/main.rs at line 1559
    [16.11924][14.19277:19347](),[14.19277][14.19277:19347]()
    diff::view(state, file).map(|action| todo!())
    [16.11924]
    [14.19347]
    diff::view(Some(state), file).map(|action| todo!())
  • replacement in crates/inflorescence/src/diff.rs at line 28
    [11.2027][11.2027:2102]()
    pub fn view<'a>(state: &'a State, file: &'a File) -> Element<'a, Action> {
    [11.2027]
    [11.2102]
    pub fn view<'a>(
    state: Option<&'a State>,
    file: &'a File,
    ) -> Element<'a, Action> {
  • replacement in crates/inflorescence/src/diff.rs at line 397
    [11.8724][10.28170:28193](),[10.28170][10.28170:28193]()
    _state: &'a State,
    [11.8724]
    [10.28193]
    _state: Option<&'a State>,
  • replacement in crates/inflorescence/src/diff.rs at line 465
    [11.8778][10.28471:28494](),[10.28471][10.28471:28494]()
    _state: &'a State,
    [11.8778]
    [10.28494]
    _state: Option<&'a State>,
  • edit in crates/inflorescence/src/cursor.rs at line 17
    [10.18965][11.8826:8854]()
    diffs: diff::State,
  • edit in crates/inflorescence/src/cursor.rs at line 21
    [10.19068][11.8855:8883]()
    diffs: diff::State,