auto-scroll past skip sections on load

[?]
Jul 5, 2025, 10:28 AM
XHWLKCLDFUQFFHLFLFDC6WHK6RXRPQSXJG5AKGPER7R5AHVCRHUAC

Dependencies

  • [2] OQ6HSAWH show record log
  • [3] WW36JYLR add iced_nav_scrollable widget crate
  • [4] WIFVLV37 nav-scrollabe: detect size to determine if needs scrolling, msg when ready
  • [5] SASAN2XC use nav-scrollable
  • [6] WI2BVQ6J rm client lib crate
  • [7] AHWWRC73 navigate log entries
  • [*] SWWE2R6M display basic repo stuff

Change contents

  • replacement in libflorescence/src/repo.rs at line 885
    [2.3230][2.3230:3252]()
    Err(e) =>
    [2.3230]
    [2.3252]
    Err(_e) =>
  • edit in iced_nav_scrollable/src/lib.rs at line 11
    [3.333]
    [3.333]
    /// Number of pixels of context that is skipped on normal scrolling that should
    /// be made visible
    const VISIBLE_CONTEXT_HEIGHT: f32 = 60.0; // roughly 3 lines of text
  • replacement in iced_nav_scrollable/src/lib.rs at line 146
    [5.12329][5.12329:12383]()
    update_offsets_if_ready(nav);
    [5.12329]
    [4.3215]
    return update_offsets_if_ready(nav);
  • replacement in iced_nav_scrollable/src/lib.rs at line 169
    [5.12937][5.12937:12991]()
    update_offsets_if_ready(nav);
    [5.12937]
    [4.3785]
    return update_offsets_if_ready(nav);
  • replacement in iced_nav_scrollable/src/lib.rs at line 259
    [3.4636][4.4820:4874]()
    fn update_offsets_if_ready(nav: &mut NavScrollable) {
    [3.4636]
    [4.4874]
    fn update_offsets_if_ready(nav: &mut NavScrollable) -> Task<Msg> {
  • replacement in iced_nav_scrollable/src/lib.rs at line 272
    [4.5331][5.13555:13602](),[5.13602][4.5383:5415](),[4.5383][4.5383:5415]()
    nav.ready = Some(if acc > nav.height {
    NeedsScrolling::Yes
    [4.5331]
    [4.5415]
    let task;
    (task, nav.ready) = if acc > nav.height {
    // Scroll to first relevant section, but only if it's the first time
    // it's ready
    let task = if nav.ready.is_none() && !nav.skip_sections.is_empty() {
    scroll_to_fst_non_skip(nav)
    } else {
    Task::none()
    };
    (task, Some(NeedsScrolling::Yes))
  • replacement in iced_nav_scrollable/src/lib.rs at line 283
    [4.5432][4.5432:5463](),[4.5463][5.13603:13615]()
    NeedsScrolling::No
    });
    [4.5432]
    [4.5474]
    (Task::none(), Some(NeedsScrolling::No))
    };
  • edit in iced_nav_scrollable/src/lib.rs at line 286
    [4.5508]
    [4.5508]
    return task;
  • edit in iced_nav_scrollable/src/lib.rs at line 288
    [4.5514]
    [4.5514]
    Task::none()
  • edit in iced_nav_scrollable/src/lib.rs at line 291
    [4.5517]
    [5.13616]
    fn scroll_to_fst_non_skip(nav: &NavScrollable) -> Task<Msg> {
    if let Some(y) = nav
    .skip_sections
    .contains(&0)
    .then(|| nav.section_offsets.get(1))
    .flatten()
    {
    let y = if *y > -VISIBLE_CONTEXT_HEIGHT {
    *y - VISIBLE_CONTEXT_HEIGHT
    } else {
    0.0
    };
    task::scroll_to(
    nav.id.clone(),
    scrollable::AbsoluteOffset { x: 0.0, y },
    )
    } else {
    Task::none()
    }
    }
  • replacement in iced_nav_scrollable/src/lib.rs at line 326
    [4.5965][4.5965:6036]()
    _bounds: Rectangle,
    content_bounds: Rectangle,
    [4.5965]
    [4.6036]
    bounds: Rectangle,
    _content_bounds: Rectangle,
  • replacement in iced_nav_scrollable/src/lib.rs at line 332
    [4.6249][4.6249:6308]()
    self.height = Some(content_bounds.height);
    [4.6200]
    [4.6332]
    self.height = Some(bounds.height);