nav-scrollable: don't show context if the nav is too small

[?]
Jul 30, 2025, 10:02 AM
WQYUCUNB7Z7IT6IU2EEOTQNBDMKASZMNHTRQTETNVU52TYYZ6IQAC

Dependencies

  • [2] XHWLKCLD auto-scroll past skip sections on load
  • [3] K5YUSV2W auto-scroll to last offset
  • [4] KWTBNTO3 diffs selection and scrolling
  • [5] 5MUEECMJ smooth scrolling nav
  • [6] RDRBP7AL auto-scroll status selection
  • [7] UR4J677R nav for log changes and refactors
  • [8] 3TLPJ57B alt scroll via context and couple fixes
  • [9] WW36JYLR add iced_nav_scrollable widget crate

Change contents

  • edit in iced_nav_scrollable/src/lib.rs at line 304
    [5.10952]
    [5.10952]
    let context_height = context_height(nav.height);
  • replacement in iced_nav_scrollable/src/lib.rs at line 315
    [7.51848][4.51723:51767](),[4.51723][4.51723:51767]()
    VISIBLE_CONTEXT_HEIGHT,
    [7.51848]
    [4.51767]
    context_height,
  • replacement in iced_nav_scrollable/src/lib.rs at line 332
    [5.11308][5.11308:11381]()
    saturating_sub(*offset, VISIBLE_CONTEXT_HEIGHT),
    [5.11308]
    [5.11381]
    saturating_sub(*offset, context_height),
  • edit in iced_nav_scrollable/src/lib.rs at line 383
    [5.12540]
    [5.12540]
    let context_height = context_height(nav.height);
  • replacement in iced_nav_scrollable/src/lib.rs at line 393
    [4.52953][7.52016:52132]()
    let top_frame = nav.stored_offset.unwrap_or_default()
    + VISIBLE_CONTEXT_HEIGHT;
    [4.52953]
    [4.53022]
    let top_frame =
    nav.stored_offset.unwrap_or_default() + context_height;
  • replacement in iced_nav_scrollable/src/lib.rs at line 413
    [5.13059][5.13059:13214]()
    > nav.height
    - VISIBLE_CONTEXT_HEIGHT
    - VISIBLE_CONTEXT_HEIGHT
    [5.13059]
    [5.13214]
    > nav.height - context_height - context_height
  • replacement in iced_nav_scrollable/src/lib.rs at line 418
    [5.13418][5.13418:13492]()
    offset + height + VISIBLE_CONTEXT_HEIGHT,
    [5.13418]
    [5.13492]
    offset + height + context_height,
  • replacement in iced_nav_scrollable/src/lib.rs at line 424
    [5.13723][5.13723:13799]()
    saturating_sub(*offset, VISIBLE_CONTEXT_HEIGHT)
    [5.13723]
    [5.13799]
    saturating_sub(*offset, context_height)
  • edit in iced_nav_scrollable/src/lib.rs at line 513
    [6.18777]
    [6.18777]
    let context_height = context_height(nav.height);
  • replacement in iced_nav_scrollable/src/lib.rs at line 526
    [7.52794][7.52794:52830]()
    VISIBLE_CONTEXT_HEIGHT,
    [7.52794]
    [7.52830]
    context_height,
  • replacement in iced_nav_scrollable/src/lib.rs at line 528
    [7.52841][7.52841:52941]()
    let top_frame =
    nav.stored_offset.unwrap_or_default() + VISIBLE_CONTEXT_HEIGHT;
    [7.52841]
    [6.19275]
    let top_frame = nav.stored_offset.unwrap_or_default() + context_height;
  • replacement in iced_nav_scrollable/src/lib.rs at line 530
    [6.19319][6.19319:19453]()
    Some(saturating_sub(
    offset + height + VISIBLE_CONTEXT_HEIGHT,
    nav.height,
    ))
    [6.19319]
    [6.19453]
    Some(saturating_sub(offset + height + context_height, nav.height))
  • replacement in iced_nav_scrollable/src/lib.rs at line 532
    [6.19493][6.19493:19559]()
    Some(saturating_sub(*offset, VISIBLE_CONTEXT_HEIGHT))
    [6.19493]
    [6.19559]
    Some(saturating_sub(*offset, context_height))
  • edit in iced_nav_scrollable/src/lib.rs at line 549
    [6.19859]
    [6.19859]
    let context_height = context_height(nav.height);
  • replacement in iced_nav_scrollable/src/lib.rs at line 562
    [7.53075][7.53075:53111]()
    VISIBLE_CONTEXT_HEIGHT,
    [7.53075]
    [7.53111]
    context_height,
  • replacement in iced_nav_scrollable/src/lib.rs at line 564
    [7.53122][7.53122:53222]()
    let top_frame =
    nav.stored_offset.unwrap_or_default() + VISIBLE_CONTEXT_HEIGHT;
    [7.53122]
    [6.20349]
    let top_frame = nav.stored_offset.unwrap_or_default() + context_height;
  • replacement in iced_nav_scrollable/src/lib.rs at line 566
    [6.20382][6.20382:20448]()
    Some(saturating_sub(*offset, VISIBLE_CONTEXT_HEIGHT))
    [6.20382]
    [6.20448]
    Some(saturating_sub(*offset, context_height))
  • replacement in iced_nav_scrollable/src/lib.rs at line 568
    [6.20499][6.20499:20633]()
    Some(saturating_sub(
    offset + height + VISIBLE_CONTEXT_HEIGHT,
    nav.height,
    ))
    [6.20499]
    [6.20633]
    Some(saturating_sub(offset + height + context_height, nav.height))
  • edit in iced_nav_scrollable/src/lib.rs at line 632
    [3.3710]
    [7.53223]
    let context_height = context_height(nav.height);
  • replacement in iced_nav_scrollable/src/lib.rs at line 642
    [2.1157][7.53442:53501]()
    let y = saturating_sub(y, VISIBLE_CONTEXT_HEIGHT);
    [2.1157]
    [2.1291]
    let y = saturating_sub(y, context_height);
  • edit in iced_nav_scrollable/src/lib.rs at line 740
    [4.54191]
    [4.54191]
    0.0
    }
    }
    // Don't show context when the nav is too small.
    fn context_height(nav_height: f32) -> f32 {
    if nav_height < VISIBLE_CONTEXT_HEIGHT + VISIBLE_CONTEXT_HEIGHT {
  • edit in iced_nav_scrollable/src/lib.rs at line 748
    [4.54203]
    [4.54203]
    } else {
    VISIBLE_CONTEXT_HEIGHT