You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3590d47
Browse filesBrowse the repository at this point in the historyBrowse files
feat(chat): open @handle mentions in message bubbles (#1609)
* feat(chat): open @handle mentions in message bubbles
Ports code-ios-app#882. A `@handle` in a text or reply bubble is drawn
as a rounded pill and opens whoever it names.
Detection runs once per message in the mapper, beside the links, with
iOS's pattern. A handle inside a link (`x.com/@jeff`) stays the link's.
Mentions live on `ContentBubble.mentions`, outside card classification,
and `splitAroundLinkCard` rebases each into its own row.
A tap looks the handle up through `LinkCardResolver.lookUpUser`, which
shares the person card's lookup and memory, so a handle already
resolved opens without a round trip. Where it lands:
- the viewer's own handle: the You tab, as a person card to yourself does
- the open DM's counterpart: their profile as the title opens it, with
Mute and without Message
- anyone else: their profile with Message and Send Cash and no Mute
(`ProfileOrigin.Mention`)
- unclaimed: "No Such Account"; any other failure: "Couldn't Open
Profile"
The pill uses iOS's values: white at 14%, 6dp radius, 6dp padding and
a 3dp gap, drawn per line when the handle wraps. The room either side
comes from inline placeholders, since Compose has no per-character
kerning.
* fix(chat): size text bubbles to their widest line and unstyle mentions
A Compose Text that wraps reports the full width it was offered, so a
wrapped message stretched its bubble to the maximum width. A mention
pill wrapping onto its own line left most of the bubble empty. The body
now measures itself once at the offered width and takes the width of
its widest line, as SwiftUI text does on iOS.
A clickable span with no style is drawn as a web link, so mentions came
out purple and underlined over their pills. They now take the body's
colour with no underline.
Copy file name to clipboardExpand all lines: apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/link/LinkCardResolver.kt
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -111,6 +111,22 @@ internal class LinkCardResolver(
Copy file name to clipboardExpand all lines: apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/screens/MessengerScreen.kt
Copy file name to clipboardExpand all lines: apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/screens/profile/ChatProfileScreen.kt
0 commit comments