#1806

WIP: Port the Android bubble chat layout to iOS

Opencallebtcwants to merge intofrom

Ports the Android client's bubble chat layout (bitchat-android #846, #860) to iOS. WIP: text bubbles are verified on screen; media bubbles and DM delivery status are not yet (see below).

Before / after

Same seeded #mesh conversation, iPhone 17 Pro simulator. "Before" is the irc chat style, which keeps the existing transcript unchanged.

Before (irc)After (bubbles)

The screenshots live on the pr-assets/bubble-ui-ios branch, which only holds these four images. Delete it once this PR is merged.

What changes

  • Bubbles. Each bubble is only as wide as its text, up to 80% of the row. Mine are on the right in orange; everyone else's are on the left, washed with their peer color (18% fill, 38% hairline, as on Android). The bottom corner on the speaker's side is tightened into a tail.
  • Runs. A sender is named only on the first bubble of their run, never on my own. A pause of more than five minutes brings the name back.
  • Spacing depends only on the author: 2 pt within a run and 8 pt when the author changes. The outline is drawn inside the bubble, so these are the gaps you see. An earlier version also widened the gap after a pause, which left my own (nameless) bubbles unevenly spaced.
  • Time and delivery status sit flush right on the body's last line and drop to a line of their own only when there's no room. A clear placeholder at the end of the text reserves their width, so they never push the text into an earlier wrap. Bubble times drop the seconds.
  • Images and voice notes get the same shell: the name above, the media, then the time. Voice notes drop their own card inside a bubble.
  • Long-pressing a bubble lifts just the bubble into the context menu, not the whole row.
  • Setting. A new "chat style" row under Settings → appearance offers bubbles (default, as on Android) and irc. It's independent of the matrix / liquid glass theme. Android calls the flat layout "Matrix", which on iOS is already a theme name. The three new strings are translated into all 30 locales.

Implementation notes

  • ChatMessageFormatter's content styling (mentions, hashtags, links, payment tokens) moved into one helper shared by the IRC text and the new bubble body. The IRC output is unchanged, and the existing formatter tests still pass.
  • The bubble body and sender label are cached under their own bub: namespace, so switching styles never serves one layout's cached text to the other.
  • New pieces:
    • MessageBubbleShape: written out by hand, since UnevenRoundedRectangle needs iOS 17.
    • MessageBubbleRowLayout: a Layout that caps the width and pins the bubble to its edge without a GeometryReader.
    • MessageBubbleGrouping: the pure run and spacing rules.

Testing

  • swift test: all 2174 tests pass, including the new MessageBubbleGroupingTests and the bubble formatter and cache tests.
  • SwiftLint is clean on the changed files; the iOS simulator build succeeds.
  • Measured on the simulator screenshot: every gap within a run is 2.0 pt, across pauses of up to an hour, and every author change is 8.0 pt.

Not yet verified

  • Image and voice-note bubbles on screen
  • DM bubbles: delivery checks, the tap-to-reveal caption, failed sends
  • The liquid glass theme
  • macOS
  • Toggling the setting from the Settings sheet (only switched via defaults so far)

Activity

7
chatgpt-codex-connector[bot]6d ago

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code Review✅ Completed 2026-10-25T00:13:30.908687Z6173ba7Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

chatgpt-codex-connector[bot]reviewed6d ago
chatgpt-codex-connector[bot]6d ago

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf19a1a3be

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

callebtcreviewed6d ago
callebtc6d ago

@codex review

chatgpt-codex-connector[bot]6d ago

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 6173ba7484

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".