refactor out the nav-scrollable children len arg

[?]
Jul 22, 2025, 3:19 PM
C5P3JIFC55TCXP53SWVYB5GHM4O7DBSBIEYSQEJ3NUX7762TUQAAC

Dependencies

  • [2] 23SFYK4Q big view refactor into a new crate
  • [3] WW36JYLR add iced_nav_scrollable widget crate
  • [4] WIFVLV37 nav-scrollabe: detect size to determine if needs scrolling, msg when ready
  • [5] XZ6D3UUE avoid alloc
  • [6] KWTBNTO3 diffs selection and scrolling
  • [7] PTWZYQFR use nav-scrollable for repo status
  • [8] UR4J677R nav for log changes and refactors
  • [9] 7SSBM4UQ view: refactor repo view
  • [10] KEPKF3WO unify diffs handling, simplify view
  • [11] I2AG42PA new cols layout
  • [12] 5MUEECMJ smooth scrolling nav
  • [13] MYGIBRRH wip custom theme
  • [14] SASAN2XC use nav-scrollable

Change contents

  • edit in inflorescence_view/src/diff.rs at line 92
    [2.5499][8.325:369]()
    let children_len = sections_view.len();
  • edit in inflorescence_view/src/diff.rs at line 95
    [8.454][8.454:476]()
    children_len,
  • edit in inflorescence_view/src/diff.rs at line 134
    [5.154][5.154:232]()
    let diffs_len = diffs_with_contents.len() + diffs_without_contents.len();
  • replacement in inflorescence_view/src/diff.rs at line 135
    [2.6315][8.667:923]()
    el(
    iced_nav_scrollable::view(nav, diffs, diffs_len, Msg::DiffNav).class(
    if diff_selected {
    theme::Scrollable::Selected
    } else {
    theme::Scrollable::Normal
    },
    ),
    )
    [2.6315]
    [2.6349]
    el(iced_nav_scrollable::view(nav, diffs, Msg::DiffNav).class(
    if diff_selected {
    theme::Scrollable::Selected
    } else {
    theme::Scrollable::Normal
    },
    ))
  • edit in inflorescence_view/src/app.rs at line 292
    [8.5089][8.5089:5149]()
    let files_len = entry.file_paths.len();
  • replacement in inflorescence_view/src/app.rs at line 299
    [8.5411][8.5411:5640]()
    el(iced_nav_scrollable::view(
    nav,
    files,
    files_len,
    move |msg| Msg::LogNav { hash, msg },
    )
    [8.5411]
    [8.5640]
    el(iced_nav_scrollable::view(nav, files, move |msg| {
    Msg::LogNav { hash, msg }
    })
  • edit in inflorescence_view/src/app.rs at line 356
    [8.6246][7.1997:1998](),[7.1997][7.1997:1998](),[7.1998][8.6247:6320]()
    let status_nav_children_len = repo::nav_contents_count(&repo.state);
  • edit in inflorescence_view/src/app.rs at line 374
    [7.2161][7.2161:2198]()
    status_nav_children_len,
  • edit in iced_nav_scrollable/src/lib.rs at line 228
    [5.388][5.388:413]()
    children_len: usize,
  • replacement in iced_nav_scrollable/src/lib.rs at line 236
    [3.3943][7.8238:8532]()
    debug_assert_eq!(nav.section_heights.len(), children_len, "The `NavScrollable` was most likely initialized with a count different from the number of actual children given to the the view function. Actual number is {}, but got {} children_len arg", nav.section_heights.len(), children_len);
    [3.3943]
    [3.4211]
    #[cfg(debug_assertions)]
    let mut unmatched_sections = nav.section_heights.len();
    let children = children.into_iter().zip(nav.section_heights.keys()).map(
    |(child, id)| {
    unmatched_sections -= 1;
    Element::from(container(child).id(id.clone()))
    },
    );
  • replacement in iced_nav_scrollable/src/lib.rs at line 246
    [3.4212][3.4212:4261](),[3.4261][4.4637:4678](),[4.4678][3.4295:4371](),[3.4295][3.4295:4371](),[3.4371][6.50767:50816]()
    let children = children
    .into_iter()
    .zip(nav.section_heights.keys())
    .map(|(child, id)| Element::from(container(child).id(id.clone())));
    widget::scrollable(widget::column(children))
    [3.4212]
    [6.50816]
    let view = widget::scrollable(widget::column(children))
  • replacement in iced_nav_scrollable/src/lib.rs at line 248
    [6.50844][6.50844:50913]()
    .on_scroll(move |viewport| map_msg(Msg::Scrolled(viewport)))
    [6.50844]
    [6.50913]
    .on_scroll(move |viewport| map_msg(Msg::Scrolled(viewport)));
    debug_assert_eq!(unmatched_sections, 0,"The `NavScrollable` was most likely initialized with a count different from the number of actual children given to the the view function. Actual number is {}, but got only {} children", nav.section_heights.len(), nav.section_heights.len() - unmatched_sections);
    view