Repository navigation
Scroll-reactive bottom navigation — hybrid collapse with Reactive / E… - #354
Conversation
…xpanded / Compact setting (#86) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for this — it's a careful implementation and the cross-platform parity is genuinely well done. One blocker and one thing to verify before it can land. 🔴 Blocker: the Android side doesn't compile
Fix — use the pre-1.7 equivalent for user-drag gestures: // AppRoot.kt:335
if (delta > 0f && source == NestedScrollSource.Drag) {I applied that locally and the whole module then compiled clean ( 🟡 Please verify the Swift app-target compilesThe checklist covers I confirmed statically that the symbols resolve ( 🟢 What's already solid
Minor: the new preference isn't in the Once the |
UserInput was added in Compose 1.7 (BOM 2024.09+); Drag is the pre-1.7 equivalent for active user-gesture scrolls and compiles cleanly against the current BOM 2024.06.00. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Fixed: NestedScrollSource.UserInput → .Drag in AppRoot.kt:335 (commit 88e3a63). All 3 Platforms compile fine :) |
|
Heads up: #90 (by the maintainer) is an open prototype for the same scroll-reactive bottom bar on #86 — Android-only, simpler immediate-collapse. This PR is broader (both platforms + configurable behavior + design tokens), so it may supersede #90, but flagging so they get reconciled rather than landing independently. |
Extract the two pure decisions from AppRoot's inline collapse composition into testable top-level functions — isBarEffectivelyCollapsed() and resolveBarCollapse() — and add BottomBarBehaviorTest. Behavior-preserving: the composable now calls the extracted functions instead of the inline if/else chain. Covers storage-string resolution (unknown/null -> REACTIVE, round-trip), the COMPACT-always / EXPANDED-never / REACTIVE-follows-flag collapse decision, and the fraction composition (Reduce Motion snaps to 0/1, non-reactive rides the settle, reactive-collapsed takes max(precompression, settle), reactive-expanding follows precompression then settle). 9 tests, testFullDebugUnitTest green. Follows up #354: that PR left the Android-unit-tests box unchecked; this is the test gate before the feature promotes from prototype-scroll-navbar to main.
PR description — here's a filled-out version based on what we verified:
What this PR does
Implements the scroll-reactive bottom navigation on iOS and Android with a hybrid precompression + threshold-settle collapse (instead of the earlier immediate-collapse approach). Adds a user-configurable behavior setting — Reactive, Expanded, or Compact — in Settings. Also adds StrandMotion.navigationBarCollapse / navigationBarExpand animation tokens to the design system.
Type of change
How it was tested
UI-only change; no BLE path touched. Tested visually on device — scroll-down triggers precompression then settles to compact, scroll-up expands immediately. Behavior setting updates the bar live from Settings. Reduce Motion snaps rather than interpolates.
Checklist
Related issues
Part of #86