Skip to content

Load complete reply threads and make keyboard dismissal reliable - #228

Open
Xare123 wants to merge 3 commits into
OpenBubbles:rustpushfrom
Xare123:split/reply-threads-keyboard
Open

Load complete reply threads and make keyboard dismissal reliable#228
Xare123 wants to merge 3 commits into
OpenBubbles:rustpushfrom
Xare123:split/reply-threads-keyboard

Conversation

@Xare123

@Xare123 Xare123 commented Jul 25, 2026

Copy link
Copy Markdown

Part 3 of 3. This replaces #225, which mixed too many unrelated themes to review. Split into focused PRs so each can be evaluated on its own.

Series: Part 1 - delivery integrity - Part 2 - lifecycle leaks - Part 3 - reply threads and keyboard

What this fixes

Reply threads opened without their originating message. Tapping a threaded reply built the thread view from the currently loaded 50-message window and omitted the message being replied to, so a reply appeared with no context. On iOS the equivalent view always shows the originator first. The thread now loads the complete locally stored chain including the originator, in chronological order, and keeps group sender names so you can tell who said what.

Long chains render lazily rather than building every bubble up front, and multi-digit reply part indexes are parsed correctly instead of truncating at the first digit.

The keyboard was hard to dismiss. Inside a conversation the only way to lower the keyboard was the Android Back button, and pressing it twice left the chat entirely. Tapping the transcript and swiping down now both dismiss it, while Back keeps its existing two-step behavior. A keyboard-visibility subscription that was never cancelled is now cancelled on dispose.

Reply navigation could race the widget lifecycle. Navigating to a replied-to message could run against a controller whose widget had already been torn down. The navigation path now checks lifecycle state before acting, and the reaction widget no longer holds a controller past its widget's life.

Validation

  • 5/5 tests pass, covering originator-loaded-before-replies, originator-loaded-after-replies, long chains, and multi-digit part indexes.
  • flutter analyze: no errors in any file this PR touches. The analyzer reports 31 pre-existing errors in lib/database/html/, vendored rust_builder/cargokit/, and the telephony_plus example; all are unchanged by this PR and present on the base branch.
  • Device evidence below was gathered on the combined branch (previously Improve Android responsiveness and message delivery reliability #225), which contained all of these changes together. The split branches have not been separately built into an APK and installed; they are verified here by tests and analysis.
  • Confirmed on a Pixel 10 Pro against a live relay: opening a threaded reply in a group chat shows the originating message with sender names intact, and all three keyboard dismissal paths work.

Notes for review

  • This PR does not change the rustpush submodule pointer.
  • It shares four files with Part 1 (chat_messages.dart, database/io/message.dart, messages_service.dart, and the chat_messages test) and three with Part 2 (conversation_view.dart, message_holder.dart, conversation_view_controller.dart), but edits different regions of each. Whichever merges first, I will rebase the others.
  • The recycled-controller fix in Part 2 is what keeps a long thread from rendering error blocks. This PR stands on its own, but the two are better together.

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