Skip to content

fix(mobile): stabilize visual cards and thread interactions - #759

Merged
nixuuu merged 1 commit into
devfrom
fix/mobile-thread-stability
Nov 14, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/mobile-thread-stability

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 14, 2026

Copy link
Copy Markdown
Member

Android thread cards can lose their Run choice when virtualized, discard loaded thumbnail URIs when leaving the viewport, and move the feed as the composer folds. Thread details also share entrance progress with drag position and have no intermediate resting position.

This change keeps HTML consent and measured heights per visual/version for the pairing session, uses a compact 112 dp gate, preserves thumbnail Image instances and synchronously restores cached file URIs on remount, retains the composer scroll reserve, and separates sheet entrance from drag offset. Thread details snap fully open or 40% down; dragging beyond 65% closes them. The scroll viewport remains usable at both positions. Visual resize updates use the existing feed anchor, and Android clipping no longer detaches native WebViews inside retained inverted cells. Distant turns remain virtualized. Web behavior is unchanged.

Fixes: #719

The linked regression is specifically the per-mount HTML Run state introduced in #719; the other behavior is pre-existing. Related: #758, #419, #425. Rebased onto #758 and retained its notice removal and Custom HTML from the agent. gate label.

Original recording

Reviewed at 12 fps; timestamps are seconds from the start, with approximately 0.08 s precision.

Problem Evidence Change
Tall blank HTML card; Run does not reveal content 00.00–12.50 and 21.00–24.67; taps around 09.50/10.17 Compact gate; session consent across row/slot/fullscreen remounts; explicit non-flex WebView sizing; token-validated height updates and anchored resize. Failure/watchdog revokes consent, so failed code does not automatically run again.
Composer flips between compact/full 01.00–01.50, 06.17–06.50, 10.75–11.17, 22.75–23.17 Folding no longer releases the native list reserve; only active finger travel can change fold state, and expansion requires deliberate travel toward the end. Momentum interrupted by a tap cannot inherit drag intent.
Details sheet jumps/rebounds; content also shifts Opening 12.83–13.33; dragging 13.75–20.75; inner content 18.25–18.83 Explicit surface height and seeded modal safe areas; separate entrance/drag values; two resting positions; bottom-only scroll viewport resize and no native scroll bounce. Re-grabbing an opening/settling sheet retains its position.
Thumbnail disappears and reloads 22.00–24.17 Visibility cancels unfinished work without clearing a loaded URI. Cache peek restores the same immutable local URI before the first remount frame, allowing native decoded bitmap reuse. Existing memory/disk LRU budgets and pairing cleanup remain in force.
Feed displacement during interactions/card changes 06.17–06.50, 10.75–11.17 Stable composer reserve; no Android autoscroll-to-zero threshold; existing disclosure anchor also wraps Run and visible WebView height changes. The recording alone cannot separate every gesture movement from layout correction.

Validation

  • Passed with nice: bun install, bun run gen:check, workspace bun run typecheck, mobile typecheck, repository bun run lint, bun run format, bun run format:check, and integration-test workspace typecheck.
  • Passed 10 unit tests: existing private image cache and pure sheet gesture tests, plus session consent isolation/revocation coverage. These are local unit tests under the existing tests directory; no UI suite or E2E tests were added or run.
  • Additional Expo lint remains failing on existing repository findings: clean dev has 116 errors / 25 warnings, this change has 112 errors / 25 warnings. Changed image/watchdog code removes some existing findings; the remaining Expo failures are not claimed as passed.
  • Native fingerprints match clean dev before/after, including explicit CANOPY_CHANNEL=nightly, using bunx expo-updates fingerprint:generate --platform .... Nightly Android: 141ef4e8c825ee4fc5d22c499402b284741b0970; Nightly iOS: 83794f069934a7374461427d89b8d008cec19d97. Default-channel Android: 906dc944f94eb8333fa384ed9f198834fdd30d13; iOS: 138e0c6b171c82b4933e86808cdfef56da73b8c6. No dependencies, native modules, plugins, or native config changed.
  • Device acceptance is unverified. T3 device discovery found no local Android SDK. MacStudio device hub timed out twice (no device returned). EAS device_open failed: “frameAncestors and corsOrigins are supported on Production and Enterprise plans,” while this account has Starter. No emulator or physical device could be opened, so first-tap rendering, Android WebView height/gesture handling, decoded bitmap retention, snap motion, keyboard transitions, light/dark, and TalkBack still need device review. No after-shots are claimed. Draft PR preserves this outstanding gate.

No web files changed; web build was not run. Full check:tmp/integration runs, native prebuilds/exports, EAS builds/updates, tags, and releases were not run. Original frame strips are retained outside the repository; raw extracted frames were removed. No servers, device processes, or reserved ports were used.

Copy audit (§8)

No new UI wording. Run, Retry, and Custom HTML from the agent. remain unchanged from #758; no secrets notice was reintroduced. Changes are session behavior, geometry, cache lifetime, and motion. Device layout/accessibility checks remain unverified.

Keep explicit HTML Run consent per visual/version for the pairing session, preserve cached thumbnail URIs, retain the composer scroll reserve, and separate sheet entrance from drag snapping.

Fixes: #719

The linked regression is the per-mount HTML Run state introduced in #719. Other interactions predate that change.

Related: #758, #419, #425

Native fingerprints are unchanged for Android and iOS, including nightly. Local generation, typechecks, repository lint/format and 10 unit tests pass. Android device acceptance remains unverified; device tools could not open an emulator. Expo lint has existing failures on dev (116 errors); this change reports 112.
@nixuuu
nixuuu marked this pull request as ready for review November 14, 2026 21:47
@nixuuu
nixuuu merged commit b99ac10 into dev Nov 14, 2026
11 checks passed
@nixuuu
nixuuu deleted the fix/mobile-thread-stability branch November 14, 2026 21:47
nixuuu added a commit that referenced this pull request Nov 15, 2026
Android can open the IME over the floating composer without moving the
latest content. Wide Markdown blocks also need to share gesture
ownership with the vertical thread list. This adds JS-only recovery for
settled keyboard bounds and moves Android gesture roots to each native
window.

- Keep native keyboard frames for animation. Reconcile show, hide, and
height changes through React Native's independent Keyboard events,
including a keyboard already open at mount. Defer reconciliation during
a native animation and normalize the navigation-bar inset.
- Add only the difference between reconciled bounds and the keyboard
inset already supplied by KeyboardChatScrollView. Retain #759's stable
composer reserve and anchoring, without restoring Android
autoscroll-to-zero.
- Put the Android GestureHandlerRootView above both vertical and
horizontal scroll views, including modal windows. Keep native
directional arbitration and nestedScrollEnabled for tables, code, and
diffs. The iOS root hierarchy and scroll adapter remain unchanged.

Related: #759
Related: #359
Related: #571

### Recording and history

Inspected the supplied 16.05-second recording using a full 4 fps frame
strip and separate keyboard/table strips. Around 0.75–1.75 s and again
after 2.5 s, the keyboard covers a stationary composer and message
content. The later table gestures move the feed vertically without
exposing more columns. The recording cannot establish native callback
delivery or exact gesture direction.

Compared git log -p and the parent of b99ac10. #759 changed the
reserve, fold intent, clipping, and Android autoscroll threshold; it did
not change KeyboardWindow, FloatingComposer, ChatKeyboard, or
HorizontalScroll. The frame-only keyboard path dates to 49db26e (#359);
the block-local gesture roots date to b6dca61 (#571). These are the
code paths addressed here, but the native trigger and introducing commit
for the reported failures are not confirmed. There is no evidence
sufficient to label #759 as the introducing regression, so this uses
Related rather than Fixes.

### Verification

- Passed with nice and TMPDIR=/var/tmp: bun install, repository
typecheck, mobile typecheck, repository lint, format, and format:check.
Changed-file Expo ESLint also passes. No UI tests added.
- Full mobile Expo lint reports 112 errors and 25 warnings outside the
changed files. This additional check is not claimed as passed.
- Nightly fingerprints generated before/after with expo-updates
fingerprint:generate are byte-for-byte identical: Android
141ef4e8c825ee4fc5d22c499402b284741b0970; iOS
83794f069934a7374461427d89b8d008cec19d97. No native module, dependency,
config, plugin, or native setting changed.
- Device acceptance remains unverified. Local discovery reports no
Android SDK. MacStudio discovery timed out twice with no devices
returned. EAS device_open failed because frameAncestors/corsOrigins
require Production or Enterprise and the account has Starter. No
emulator was driven, no existing AVD was modified, and no after-shots
are claimed.
- No EAS update/build, tags, releases, production services, reserved
ports, web build, native generation, or full integration/E2E suite was
run. Source and documentation are the only committed artifacts.

### Outstanding acceptance

Keep this PR draft until the same installed Android Nightly native build
can run this JS: check IME open/close, suggestions/emoji and IME height
changes, writing visibility and latest content, fold/expand without feed
displacement, horizontal/vertical drags from table text and padding,
long code/diffs, and modal viewers. Repeat the existing iOS flow for
parity. The fallback repairs missing animation updates; it does not
change a native soft-input setting. A demonstrated need to change that
setting must be reported separately.

### Copy audit (§8)

No UI text changed. The change affects keyboard bounds and gesture
ownership; device layout and accessibility acceptance remain open.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant