new cols layout

[?]
Jun 10, 2025, 8:21 AM
I2AG42PAVOII4V4TWDJV5ZVNDIHKBRDT254BFQLFUIY723TW6CCQC

Dependencies

  • [2] 6YZAVBWU Initial commit
  • [3] KLR5FRIB add fs state read/write of repos
  • [4] IQDCHWCP load a pijul repo
  • [5] WT3GA27P add cursor with selection
  • [6] YBJRDOTC make all repo actions async
  • [7] KM5PSZ4A watch repo once loaded
  • [8] 2VUX5BTD load identity
  • [9] A5YBC77V record!
  • [10] 4WO3ZJM2 show untracked files' contents
  • [11] 3SYSJKYL add app icon
  • [12] 23SFYK4Q big view refactor into a new crate
  • [13] OPXFZKEB view tests setup
  • [14] 3QVNMRNM test non-empty repo app view
  • [15] MYGIBRRH wip custom theme
  • [16] XSZZB47U refactor stuff into lib
  • [17] 3BK22XE5 add a test for hover btn and more refactors
  • [18] WGID4LS4 absolutely slayed testing with iced task
  • [19] VCNKFNUF app init test
  • [20] FVA36HBV restart repo manager task if it crashes
  • [21] X6AK4QPX finish recording test
  • [22] UF5NJKAS test load repo
  • [23] 7SSBM4UQ view: refactor repo view
  • [24] 2LWMGRUM test diff
  • [25] QYDWH7KB test add and rm
  • [26] 5FVZF7XX test changed files
  • [27] S2T7RUKW add nav back placeholder
  • [28] I56UGW7U make record test, fix log update
  • [29] S2NVIFXR allow to enter record msg
  • [30] SWDPAGF6 test channel name
  • [31] NRCUG4R2 load changed files src when selected
  • [32] VOFP2YNQ prettify
  • [33] KMB6FND3 test view update fn rather than direct fn calls
  • [34] UB2ITZJS refresh changed files on FS changes
  • [35] ELG3UDT6 allow to rm added files
  • [36] D7A7MSIH allow to defer or abandon record, add buttons
  • [37] AMPZ2BXK show changed files diffs (only Edit atm)
  • [38] FDDPOH5R add arrow controls
  • [39] ZVI4AWER woot contents_diff
  • [40] L6KSEFQI move cursor related stuff into its module
  • [41] BFN2VHZS refactor file stuff into sub-mod
  • [42] ACDXXAX2 refactor main's updates into smaller fns

Change contents

  • replacement in libflorescence/src/testing.rs at line 34
    [19.361][19.361:440]()
    unsafe { std::env::set_var("PIJUL_CONFIG_DIR", &dir.path().as_os_str()) };
    [19.361]
    [19.440]
    unsafe { std::env::set_var("PIJUL_CONFIG_DIR", dir.path().as_os_str()) };
  • replacement in libflorescence/src/repo/test.rs at line 67
    [22.3720][22.3720:3740]()
    .last()
    [22.3720]
    [22.3740]
    .next_back()
  • replacement in libflorescence/src/repo/test.rs at line 128
    [24.848][26.209:247]()
    diff.changes.get(0).unwrap(),
    [24.848]
    [24.887]
    diff.changes.first().unwrap(),
  • replacement in libflorescence/src/repo/test.rs at line 178
    [25.557][26.774:812]()
    diff.changes.get(0).unwrap(),
    [25.557]
    [25.596]
    diff.changes.first().unwrap(),
  • replacement in justfile at line 31
    [2.363][3.2338:2368]()
    cargo +{{nightly}} clippy
    [2.363]
    [2.380]
    cargo +{{nightly}} clippy --all-targets
  • edit in inflorescence_view/src/testing.rs at line 19
    [13.908]
    [13.908]
    pub const WINDOW_SIZE: iced::Size = iced::Size {
    width: 1024.0,
    height: 768.0,
    };
  • replacement in inflorescence_view/src/testing.rs at line 76
    [13.1945][13.1945:2002]()
    Size::Fullscreen => iced::Size::new(512., 384.),
    [13.1945]
    [13.2002]
    Size::Fullscreen => WINDOW_SIZE,
  • edit in inflorescence_view/src/app.rs at line 15
    [12.12674]
    [12.12674]
    use std::cmp;
  • edit in inflorescence_view/src/app.rs at line 21
    [12.12753]
    [12.12753]
    /// Default min. width of a main view column
    const DEFAULT_MIN_COL_WIDTH: usize = 512;
  • edit in inflorescence_view/src/app.rs at line 26
    [12.12793]
    [12.12793]
    pub window_size: iced::Size,
  • replacement in inflorescence_view/src/app.rs at line 243
    [23.4017][23.4017:4064]()
    el(scrollable(column(files))),
    [23.4017]
    [12.23465]
    el(scrollable(column(files).width(Length::Fill))),
  • edit in inflorescence_view/src/app.rs at line 245
    [12.23480]
    [23.4065]
    .width(Length::Fill)
    .height(Length::Fill)
  • replacement in inflorescence_view/src/app.rs at line 252
    [23.4143][23.4143:4203]()
    let left_view = match state.cursor.selection.as_ref() {
    [23.4143]
    [23.4203]
    // The number of visible columns depends on the screen width. Any cols on
    // left that don't fit will be hidden
    let max_visible_cols = cmp::max(
    2,
    state.window_size.width.floor() as usize / DEFAULT_MIN_COL_WIDTH,
    );
    let depth = if let Some(RecordMsg::Typing(_)) = state.record_msg.as_ref() {
    1
    } else if let Some(selection) = state.cursor.selection.as_ref() {
    match selection {
    cursor::Selection::UntrackedFile { .. }
    | cursor::Selection::ChangedFile { .. }
    | cursor::Selection::LogChange { file: None, .. } => 1,
    cursor::Selection::LogChange { file: Some(_), .. } => 2,
    }
    } else {
    0
    };
    let hidden_cols = (depth + 1_usize).saturating_sub(max_visible_cols);
    // dbg!(
    // state.window_size.width,
    // max_visible_cols,
    // depth,
    // hidden_cols
    // );
    let col_0 = el(column([
    repo_info,
    el(column([el(text("Untracked files:")), untracked_files()])),
    el(column([el(text("Changed files:")), changed_files()])),
    el(column([el(text("Recent changes:")), log()])),
    ])
    .width(Length::Fill)
    .height(Length::Fill));
    let col_1 = el(column([
    el(column([record_msg_editor, selection_details])
    .width(Length::Fill)
    .height(Length::Fill)),
    if hidden_cols == 1 {
    el(button(row([
    el(text("← ").font(Font::MONOSPACE)),
    el(text("Status")),
    ]))
    .on_press(Msg::Cursor(cursor::Msg::Left)))
    } else {
    el(row([]))
    },
    ])
    .width(Length::Fill)
    .height(Length::Fill));
    let col_2 = match state.cursor.selection.as_ref() {
  • replacement in inflorescence_view/src/app.rs at line 313
    [23.4399][23.4399:5333]()
    }) => el(column([
    view_diff_header(format!(
    "{path} changes in {}:",
    display_short_hash(hash)
    )),
    match diffs {
    Some(diffs) => {
    let (file, state) = diffs.get(path).unwrap();
    diff::view(Some(state), file).map(|action| {
    Msg::LogChangeFileDiffAction {
    hash: *hash,
    file: path.clone(),
    action,
    }
    })
    }
    None => el(text("Loading diff..")),
    },
    ])
    .width(Length::FillPortion(1))
    .spacing(SPACING)),
    Some(cursor::Selection::UntrackedFile { .. })
    | Some(cursor::Selection::ChangedFile { .. })
    | Some(cursor::Selection::LogChange { .. })
    | None => el(column([
    [23.4399]
    [27.28]
    }) => Some(el(column([
  • replacement in inflorescence_view/src/app.rs at line 315
    [27.52][27.52:299]()
    repo_info,
    el(column([el(text("Untracked files:")), untracked_files()])),
    el(column([el(text("Changed files:")), changed_files()])),
    el(column([el(text("Recent changes:")), log()])),
    [27.52]
    [27.299]
    view_diff_header(format!(
    "{path} changes in {}:",
    display_short_hash(hash)
    )),
    match diffs {
    Some(diffs) => {
    let (file, state) = diffs.get(path).unwrap();
    diff::view(Some(state), file).map(|action| {
    Msg::LogChangeFileDiffAction {
    hash: *hash,
    file: path.clone(),
    action,
    }
    })
    }
    None => el(text("Loading diff..")),
    },
  • replacement in inflorescence_view/src/app.rs at line 334
    [27.347][27.347:574]()
    .height(Length::Fill)),
    el(button(row([
    el(text("←").font(Font::MONOSPACE)),
    el(text(" Nav back placeholder")),
    ]))
    .on_press(Msg::SaveRecord)),
    [27.347]
    [23.5564]
    .height(Length::Fill)
    .spacing(SPACING)),
    // NOTE: This is currently never true - there are only up to 3 cols
    if hidden_cols == 2 {
    el(button(row([
    el(text("← ").font(Font::MONOSPACE)),
    el(text("Log")),
    ]))
    .on_press(Msg::Cursor(cursor::Msg::Left)))
    } else {
    el(row([]))
    },
  • replacement in inflorescence_view/src/app.rs at line 349
    [27.634][23.5614:5649](),[23.5614][23.5614:5649]()
    .spacing(SPACING)),
    };
    [27.634]
    [12.24109]
    .spacing(SPACING))),
  • replacement in inflorescence_view/src/app.rs at line 351
    [12.24110][27.635:736]()
    let right_view =
    el(column([record_msg_editor, selection_details]).width(Length::Fill));
    [12.24110]
    [12.24230]
    Some(cursor::Selection::UntrackedFile { .. })
    | Some(cursor::Selection::ChangedFile { .. })
    | Some(cursor::Selection::LogChange { .. })
    | None => None,
    };
  • replacement in inflorescence_view/src/app.rs at line 357
    [12.24231][23.5763:5817]()
    el(row([left_view, right_view]).spacing(SPACING))
    [12.24231]
    [12.24344]
    if let Some(col_2) = col_2 {
    let cols = [col_0, col_1, col_2].into_iter().skip(hidden_cols);
    el(row(cols).spacing(SPACING))
    } else {
    let cols = [col_0, col_1];
    el(row(cols).spacing(SPACING))
    }
  • edit in inflorescence_view/src/app/test.rs at line 13
    [16.5949]
    [13.4465]
    const WINDOW_SIZE: iced::Size = iced::Size {
    width: 1024.0,
    height: 768.0,
    };
  • edit in inflorescence_view/src/app/test.rs at line 38
    [13.4978]
    [13.4978]
    window_size: WINDOW_SIZE,
  • edit in inflorescence_view/src/app/test.rs at line 64
    [14.128]
    [14.128]
    window_size: WINDOW_SIZE,
  • edit in inflorescence_view/src/app/test.rs at line 103
    [15.8299]
    [15.8299]
    window_size: WINDOW_SIZE,
  • edit in inflorescence_view/src/app/test.rs at line 122
    [17.1307]
    [17.1307]
    window_size: WINDOW_SIZE,
  • edit in inflorescence_view/src/app/test.rs at line 151
    [13.5661]
    [13.5661]
    window_size: WINDOW_SIZE,
  • replacement in inflorescence/src/test.rs at line 35
    [19.2925][19.2925:2952]()
    // - Msg::WindowOpened
    [19.2925]
    [19.2952]
    // - Msg::NoOp from opening a window
  • replacement in inflorescence/src/test.rs at line 47
    [19.3353][19.3353:3420]()
    if !window_opened && matches!(msg, Msg::WindowOpened(_)) {
    [19.3353]
    [19.3420]
    if !window_opened && matches!(msg, Msg::NoOp) {
  • replacement in inflorescence/src/test.rs at line 263
    [21.3256][21.3256:3321]()
    app::RecordMsg::Typing(msg) if &msg.text() == record_msg
    [21.3256]
    [21.3321]
    app::RecordMsg::Typing(msg) if msg.text() == record_msg
  • replacement in inflorescence/src/main.rs at line 68
    [19.4278][11.163:203](),[12.25551][11.163:203](),[4.1124][11.163:203](),[11.203][18.5498:5554]()
    let (window_id, open_window_task) =
    task::open_window(window::Settings::default());
    [19.4278]
    [19.4279]
    let window_settings = window::Settings::default();
    let window_size = window_settings.size;
    let (window_id, open_window_task) = task::open_window(window_settings);
  • replacement in inflorescence/src/main.rs at line 87
    [10.2157][12.25686:25735]()
    open_window_task.map(Msg::WindowOpened),
    [10.2157]
    [11.708]
    open_window_task.map(|_id| Msg::NoOp),
  • edit in inflorescence/src/main.rs at line 97
    [8.776]
    [7.201]
    window_size,
  • edit in inflorescence/src/main.rs at line 114
    [8.797]
    [7.258]
    window_size: iced::Size,
  • replacement in inflorescence/src/main.rs at line 128
    [12.25803][11.784:814](),[5.668][11.784:814]()
    WindowOpened(window::Id),
    [12.25803]
    [9.4573]
    NoOp,
    Window(window::Event),
  • edit in inflorescence/src/main.rs at line 141
    [6.6718]
    [12.25859]
    Msg::NoOp => Task::none(),
  • replacement in inflorescence/src/main.rs at line 143
    [12.25919][12.25919:25967]()
    Msg::WindowOpened(_id) => Task::none(),
    [12.25919]
    [12.25967]
    Msg::Window(event) => update_from_window_event(state, event),
  • edit in inflorescence/src/main.rs at line 173
    [20.455]
    [20.455]
    fn update_from_window_event(
    state: &mut State,
    event: window::Event,
    ) -> Task<Msg> {
    match event {
    window::Event::Opened { position: _, size }
    | window::Event::Resized(size) => {
    state.window_size = size;
    }
    window::Event::Closed
    | window::Event::Moved(_)
    | window::Event::RedrawRequested(_)
    | window::Event::CloseRequested
    | window::Event::Focused
    | window::Event::Unfocused
    | window::Event::FileHovered(_)
    | window::Event::FileDropped(_)
    | window::Event::FilesHoveredLeft => {}
    }
    Task::none()
    }
  • replacement in inflorescence/src/main.rs at line 673
    [5.2763][5.2763:2794]()
    on_key_press(|key, mods| {
    [5.2763]
    [5.2794]
    let key_subs = on_key_press(|key, mods| {
  • replacement in inflorescence/src/main.rs at line 719
    [5.3176][5.3176:3183]()
    })
    [5.3176]
    [5.4172]
    });
    let window_subs = window::events().map(|(_id, event)| Msg::Window(event));
    Subscription::batch([key_subs, window_subs])
  • edit in inflorescence/src/main.rs at line 729
    [12.28563]
    [12.28563]
    window_size,
  • edit in inflorescence/src/main.rs at line 741
    [12.28768]
    [12.28768]
    window_size: *window_size,