onionwire/android/app
Repository files (latest commit first)
Filename Latest commit message Latest commit date
agent 04c993862c
android: one chat poller owned by the ViewModel, gated auto-scroll, Enter-to-send
The chat screen owned a LaunchedEffect(Unit) that fetched maxAttempts once and
then called loadMessages/loadOutbox every 2s forever, fed by three suspend
lambdas from MainActivity — one SDK poller per composition. The cadence now
lives in WireViewModel: openChat(peer) starts one 2s loop in viewModelScope
(closeChat stops it, re-entering the same peer is a no-op), exposed as
ChatState(messages, outbox, maxAttempts, error) and collected with
collectAsStateWithLifecycle. Same 2s cadence, maxAttempts read once, messages
and outbox refreshed together, load failures sticky on ChatState.error, and
the QUEUED notice unchanged; a send clears the load error.

Auto-scroll no longer steals the reader's place: the tail is followed only when
the last visible index is >= count - 2 (or the list has not filled yet), while
the user's own send still scrolls their message into view. The first fill keeps
its one jump to the bottom. A delivery-only change (same size) still does not
re-run the effect — documented in a comment rather than changed.

The composer keeps ImeAction.Send with maxLines = 4, documented as a deliberate
wrap limit rather than a newline affordance: the action key sends (hardware
Enter still inserts a newline inside the field).

No polling LaunchedEffect remains in ChatScreen.kt.
2026-09-14 02:54:33 -04:00
..
src android: one chat poller owned by the ViewModel, gated auto-scroll, Enter-to-send 2026-09-14 02:54:33 -04:00
build.gradle.kts feat(android): wallet screen and SDK payment surface 2026-09-13 15:27:57 -04:00