android: wallet + roster bottom actions clipped while the keyboard is up #69

Merged
sirius merged 2 commits from wt/t_3a094045 into main 2026-09-14 15:51:32 +00:00
Owner

Fixes the follow-up keyboard bug from PR #67: on Wallet and Roster the bottom action row sits inside a container with no scroll range, so un-covering the inset was not enough — the IME shrank the viewport and the buttons were simply out of the layout.

Changes (android only, 3 files)

  • ui/Insets.kt — taken verbatim from #67 (git checkout origin/wt/chat-ime-insets -- .../Insets.kt). This branch does not carry #67, so the PR is stacked on wt/chat-ime-insets (08381c4); if #67 lands first this file disappears from the diff.
  • ui/WalletScreen.kt — root Column is now .padding(pad).fillMaxSize().screenContentInsets().verticalScroll(rememberScrollState()) with Scaffold(contentWindowInsets = WindowInsets(0, 0, 0, 0)). screenContentInsets() is outside the scroll, so the inset stays out of the scrolling viewport (imeBottom = 883 px on ow35; the viewport ends at the IME, not at the window).
    • the nested LazyColumn(weight(1f, fill = false)) for recent transfers became a plain Column: a lazy list measured inside a scroll container with unbounded height throws, and walletRecentTransfers is already capped at 25 rows.
    • Layout note (deliberate, please read): the } else { Spacer(Modifier.weight(1f)) } that pinned the Invoice/Tip/Create/Import block to the bottom in the "wallet off / no transfers" state had to go — a weighted child cannot be resolved inside a verticalScroll Column (remaining space is infinite). With the keyboard closed the action block now sits directly under the balance card instead of at the bottom of the window. That is the only visual delta; spacing/typography/colours are untouched.
  • ui/RosterScreen.kt — same inset treatment, plus LazyColumn(Modifier.weight(1f).fillMaxWidth()) instead of fillMaxSize(). Choice: the wipe-confirm strip stays a sibling of the weighted list (rendered above it, exactly where it is today), so the list can never starve it; it was not moved into the list.

Verification

  • PATH=$HOME/.cargo/bin:$PATH ./gradlew :app:assembleDebug -Ponionwire.abis=arm64-v8a,x86_64 -> BUILD SUCCESSFUL (app-debug.apk, lib/arm64-v8a/libonionwire_sdk.so + lib/x86_64/libonionwire_sdk.so).
  • ./gradlew :app:testDebugUnitTest -> 61 tests, 0 failures, 0 errors, 0 skipped.
  • Emulator (ow35, x86_64, API 35, headless); the installed APK was hash-verified against the build (sha256 dbd82db0eac2c80e8e11e16be70de2cd452329f6b8e5a0d8eb931988778d297e).
    • Roster wipe-confirm, keyboard up (mInputShown=true, ime frame [0,1517][1080,2400]): Cancel [643,1280][820,1406], Confirm [820,1280][1016,1406] — identical to the keyboard-closed bounds, bottoms 1406 < 1517, i.e. fully above the IME.
    • Wallet Import (seed + passphrase), keyboard up: the Cancel/Import buttons end at y = 1220 against IME top 1517.
    • Wallet PayComposer (amount/memo), keyboard up on a shortened display (wm size 1080x1500, IME top 628): before scrolling, the Send row is not in the window; after two swipes Cancel [630,439][807,565] / Send [807,439][1016,565] — 565 < 628, reachable by scrolling, not clipped.
    • Keyboard closed: nav bar is [0,2337][1080,2400]; the helper unions systemBars with ime (per-side max), so nothing is padded twice.

Known limits / not verified

  • On a short viewport (wm size 1080x1500) the Roster wipe-confirm strip overflows the inset area: header card + action row + strip are ~1000 px of fixed content above the weighted list, so on a very short screen (or landscape) the strip still ends up behind the IME. Moving it into the LazyColumn would fix that, at the cost of rendering it below the divider inside the list; left as a sibling to preserve today's layout. Reported rather than silently restructured.
  • Emulator 5554 is shared with another worker that installs its own build over com.siriusdevops.onionwire.debug; the composer measurements above were taken from a private -read-only instance on port 5564 with the hash-verified APK.
Fixes the follow-up keyboard bug from PR #67: on Wallet and Roster the bottom action row sits inside a container with **no scroll range**, so un-covering the inset was not enough — the IME shrank the viewport and the buttons were simply out of the layout. ## Changes (android only, 3 files) * `ui/Insets.kt` — **taken verbatim from #67** (`git checkout origin/wt/chat-ime-insets -- .../Insets.kt`). This branch does not carry #67, so the PR is **stacked on `wt/chat-ime-insets` (08381c4)**; if #67 lands first this file disappears from the diff. * `ui/WalletScreen.kt` — root `Column` is now `.padding(pad).fillMaxSize().screenContentInsets().verticalScroll(rememberScrollState())` with `Scaffold(contentWindowInsets = WindowInsets(0, 0, 0, 0))`. `screenContentInsets()` is *outside* the scroll, so the inset stays out of the scrolling viewport (imeBottom = 883 px on ow35; the viewport ends at the IME, not at the window). * the nested `LazyColumn(weight(1f, fill = false))` for recent transfers became a plain `Column`: a lazy list measured inside a scroll container with unbounded height throws, and `walletRecentTransfers` is already capped at 25 rows. * **Layout note (deliberate, please read):** the `} else { Spacer(Modifier.weight(1f)) }` that pinned the Invoice/Tip/Create/Import block to the bottom in the "wallet off / no transfers" state had to go — a weighted child cannot be resolved inside a `verticalScroll` Column (remaining space is infinite). With the keyboard closed the action block now sits directly under the balance card instead of at the bottom of the window. That is the only visual delta; spacing/typography/colours are untouched. * `ui/RosterScreen.kt` — same inset treatment, plus `LazyColumn(Modifier.weight(1f).fillMaxWidth())` instead of `fillMaxSize()`. **Choice: the wipe-confirm strip stays a sibling** of the weighted list (rendered *above* it, exactly where it is today), so the list can never starve it; it was not moved into the list. ## Verification * `PATH=$HOME/.cargo/bin:$PATH ./gradlew :app:assembleDebug -Ponionwire.abis=arm64-v8a,x86_64` -> BUILD SUCCESSFUL (`app-debug.apk`, `lib/arm64-v8a/libonionwire_sdk.so` + `lib/x86_64/libonionwire_sdk.so`). * `./gradlew :app:testDebugUnitTest` -> 61 tests, 0 failures, 0 errors, 0 skipped. * Emulator (ow35, x86_64, API 35, headless); the installed APK was hash-verified against the build (`sha256 dbd82db0eac2c80e8e11e16be70de2cd452329f6b8e5a0d8eb931988778d297e`). * **Roster wipe-confirm, keyboard up** (`mInputShown=true`, ime frame `[0,1517][1080,2400]`): Cancel `[643,1280][820,1406]`, Confirm `[820,1280][1016,1406]` — identical to the keyboard-closed bounds, bottoms 1406 < 1517, i.e. fully above the IME. * **Wallet Import (seed + passphrase)**, keyboard up: the Cancel/Import buttons end at y = 1220 against IME top 1517. * **Wallet PayComposer (amount/memo)**, keyboard up on a shortened display (`wm size 1080x1500`, IME top 628): before scrolling, the Send row is not in the window; after two swipes Cancel `[630,439][807,565]` / Send `[807,439][1016,565]` — 565 < 628, reachable by scrolling, not clipped. * Keyboard closed: nav bar is `[0,2337][1080,2400]`; the helper unions systemBars with ime (per-side max), so nothing is padded twice. ## Known limits / not verified * On a **short viewport** (`wm size 1080x1500`) the Roster wipe-confirm strip overflows the inset area: header card + action row + strip are ~1000 px of fixed content above the weighted list, so on a very short screen (or landscape) the strip still ends up behind the IME. Moving it into the LazyColumn would fix that, at the cost of rendering it below the divider inside the list; left as a sibling to preserve today's layout. Reported rather than silently restructured. * Emulator 5554 is shared with another worker that installs its own build over `com.siriusdevops.onionwire.debug`; the composer measurements above were taken from a private `-read-only` instance on port 5564 with the hash-verified APK.
The two screens whose action row lives inside a non-scrollable Column could
not be un-covered by insets alone: the container had no scroll range at all.

- WalletScreen: root Column is now a verticalScroll viewport that consumes
  systemBars ∪ ime itself (screenContentInsets()) before the scroll, paired
  with Scaffold(contentWindowInsets = 0). The nested LazyColumn becomes a
  plain Column (a lazy list cannot be measured inside a scroll container with
  unbounded height) and the weight(1f) bottom spacer goes with it: a weighted
  spacer cannot live in a scrollable Column.
- RosterScreen: same inset treatment; the friends LazyColumn drops
  fillMaxSize() for weight(1f) so the wipe-confirm strip above it keeps its
  height when the IME shrinks the window.
- Insets.kt is PR #67's helper, taken verbatim (this branch does not carry #67).

Stacked on PR #67 (wt/chat-ime-insets, 08381c4) for ui/Insets.kt.
sirius merged commit c169e41c33 into main 2026-09-14 15:51:32 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/onionwire!69
No description provided.