Skip to content

feat(nav): per-entry inset for the v2 tab bar (no push jump) - #1246

Merged
bmc08gt merged 1 commit into
code/cashfrom
feat/tab-bar-decorator
Aug 15, 2026
Merged

feat(nav): per-entry inset for the v2 tab bar (no push jump)#1246
bmc08gt merged 1 commit into
code/cashfrom
feat/tab-bar-decorator

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix the "content jumps on push" behaviour of the v2 tab bar without giving up the seamless, hoisted bar.

The bar stays a single persistent overlay at the app root, so tab switches are seamless — one instance, the selection pill slides, one haze source, no crossfade/remount. Only the reserved inset is made per-entry:

  • New NavTabBarInsetEntryDecorator provides LocalTabBarPadding per NavEntry — the bar height on tab-home entries, zero on pushed/detail entries.
  • The entry's route is resolved once, keyed by its stable contentKey (not the live backstack — a replaceAll removes the outgoing entry mid-animation, which would flip the value and, because it also moved entry.Content() between branches, remount the screen).
  • So the inset is fixed for the entry's lifetime: the outgoing tab keeps its inset through a push while the incoming detail has none → no mid-transition collapse, no jump.
  • NewAppContent wires the decorator in and feeds it the hoisted bar's measured height via a shared State<Dp>.

Background: an earlier attempt moved the whole bar into the decorator (per-entry rendering). That fixed the jump but made tab switches crossfade two bars and remount the screen (bar disappeared / wallet locked up). This keeps the bar hoisted and moves only the inset.

Verified on device (emulator)

  • Tab switching across all four tabs incl. Scanner — bar persists, pill slides, no glitch.
  • Dive-in (token info) — bar slides away, wallet keeps its inset (no jump).
  • Predictive back — wallet slides in from the left, bar slides back up.
  • Add Money modal — bar hidden for the modal.

./gradlew :apps:flipcash:app:compileDebugKotlin passes.

The v2 nav bar stays a single persistent overlay at the app root (seamless tab
switches: one instance, sliding selection pill, one haze source). Only the
reserved inset moves per entry.

NavTabBarInsetEntryDecorator provides LocalTabBarPadding per NavEntry — the bar
height on tab-home entries, zero on pushed/detail entries — resolved once by the
entry's stable contentKey (not the live backstack, which would flip mid-animation
on a replaceAll). This keeps the inset fixed for the entry's lifetime, so the
outgoing tab keeps its inset through a push while the incoming detail has none —
no mid-transition collapse, no jump.

NewAppContent wires the decorator in and feeds it the hoisted bar's measured
height via a shared State<Dp>.
@github-actions github-actions Bot added the type: feature New functionality label Aug 15, 2026
@bmc08gt
bmc08gt merged commit 359614a into code/cash Aug 15, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the feat/tab-bar-decorator branch August 15, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant