Skip to content

refactor(chat-ui): make shared/chat-ui a KMP module - #1934

Merged
bmc08gt merged 3 commits into
code/cashfrom
refactor/chat-ui-kmp
Nov 3, 2026
Merged

bmc08gt merged 3 commits into
code/cashfrom
refactor/chat-ui-kmp

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

shared/chat-ui is now a Kotlin Multiplatform module (android + jvm), so the chat list can render on desktop (step A3 of the desktop chat plan).

Moved to commonMain: chat list row and its content (ChatListRow, ChatRowContent, ChatSummaryMapping), message times, muted indicator, quick reaction strip, reaction pills and alert pill, redacted text, undecryptable bubble, quote panel, composer reply strip, composer photo chips, chat media viewer, photo progress overlay, payment request UI, system message text, and the bubble geometry (Bubble.kt: positions, corners, Bubble, JumboEmoji). Strings now read through com.flipcash.core.resources.Res. TokenDisplayName (core) and ChatInputDefaults (ui:components) moved to commonMain too, since the above needed them.

New seams:

  • LocalIs24Hour / is24HourClock(): Android reads DateFormat.is24HourFormat, desktop reads the locale's short time pattern.
  • expect rememberReducedMotion() (Settings on Android, false on desktop), canBlurRedactedText (API 31+ on Android), Paint.blurEdges (BlurMaskFilter / Skia mask filter) and noFontPaddingStyle().

Stays in androidMain:

  • ChatCameraPanel (CameraX, TextureView), ChatPhotoPicker (MediaStore, SdkExtensions), ComposerImageDrop (Context, Uri), ChatPhotoSave (MediaStore), ChatShareIntake (Intent), AttachSurface (Dialog, ViewCompat), ChatPhotoOverlay (BackHandler), ReactionAlertHost (HapticFeedbackConstants, ValueAnimator).
  • MessageBubble, LinkCardView, UserLinkCard, WebLinkCard, GroupInviteLinkCard, MessageLinkCard, ShareProfileWidgetBubble, GroupReadyCardBubble, ChatPhotoBubble, MediaMessageBubble and the two conversation preview files. The root cause is one file: CodeButton/ButtonState live in :ui:components androidMain (RuntimeShader frosted glass), and the cards render it. Converting CodeButton unlocks all of these for desktop; each file carries a kmp-audit line saying so.

Cross-module fix (separate commit): androidResAsComposeResources copied \', \", \@, \? into Compose resources with the backslash, so any string with an apostrophe read through Res showed "can't". The copy now unescapes them. This applies to every module that uses the helper (ui:resources, ui:components, core, userflags, common-ui).

Tests: the 406 host tests all still run on testAndroidHostTest; 12 test files with no Android dependency moved to commonTest and now also run on jvmTest (64 tests). ChatSummaryPreviewTest, ChatSummaryInvitePreviewTest and SystemMessageTextTest mock ResourceHelper with StringResource keys instead of R ids.

aapt reads \' \" \@ \? as escapes; Compose resources kept the backslash, so a string
read through Res rendered "can\'t". The copy that feeds Compose resources now unescapes them.
Chat list rows, previews, quick reactions, quote panel, composer reply strip, photo chips and the
media viewer move to commonMain. Strings read through core Res, times of day through LocalIs24Hour,
and the few Android calls (reduced-motion setting, API-level blur check, BlurMaskFilter, font
padding) sit behind expect/actual. ChatInputDefaults moves to ui:components commonMain.
@bmc08gt bmc08gt self-assigned this Nov 2, 2026
@github-actions github-actions Bot added type: refactor Code restructuring, no behavior change area: ui Compose UI, theme, components, resources area: network gRPC, connectivity, API, exchange rates area: build-system Gradle, convention plugins, build-logic area: tokens Token accounts, balances, token info and removed type: refactor Code restructuring, no behavior change labels Nov 2, 2026
Cash bubble layout (#1944) and the system-message glyph change (#1937) are
taken as code/cash has them, then moved onto the KMP source sets:
CashBubbleLines resolves its wording through Res (composable stringResource,
or blocking lookups passed in by a test) and sits in commonMain.

code/cash's selectBuildTypeFrom made jvmMainCompileClasspath ambiguous for
libraries that publish android and jvm variants, which broke
:apps:flipcash:core:compileJvmMainJava and so the desktop build and jvmTest.
Both KMP convention plugins now ask that classpath for the jvm platform type.
@github-actions github-actions Bot added the type: refactor Code restructuring, no behavior change label Nov 3, 2026
@bmc08gt
bmc08gt merged commit f1ca7e0 into code/cash Nov 3, 2026
5 checks passed
bmc08gt added a commit that referenced this pull request Nov 3, 2026
…ee-pane

* origin/code/cash: (44 commits)
  refactor(chat-list): move the chat list into a KMP module and wire it into the desktop graph (#1950)
  build(deps): bump dev.zacsweers.metro from 1.4.5 to 1.5.1 (#1901)
  feat(flipcash): add return-payment contract scaffolding (#1949)
  refactor(chat-ui): make shared/chat-ui a KMP module (#1934)
  build(deps): bump com.google.firebase:firebase-bom from 34.19.0 to 35.1.0 (#1900)
  build(deps): bump io.ktor:ktor-network from 3.4.1 to 3.6.0 (#1909)
  build(deps): bump rinku from 1.6.0 to 1.9.0 (#1907)
  build(deps): bump androidx.webkit:webkit from 1.17.0 to 1.18.0 (#1906)
  build(deps): bump agp from 9.4.1 to 9.5.0 (#1905)
  build(deps): bump androidx-datastore from 1.2.1 to 1.3.0 (#1904)
  build(deps): bump compose-multiplatform from 1.12.1 to 1.12.2 (#1903)
  build(deps): bump com.google.android.gms:play-services-base (#1902)
  build(deps): bump okhttp from 5.5.0 to 5.5.1 (#1899)
  refactor(messenger): split ChatViewModel's reducer into per-area files (#1933)
  refactor(amount-entry): make shared/amount-entry a KMP module (#1932)
  fix(build): stop KMP host tests building release variants and debug manifests changing per commit (#1948)
  refactor(theme): collapse Avenir into one family with a real Medium face (#1947)
  perf: run independent hot-path calls concurrently (#1945)
  docs(claude): test gestures with device input and keep mode state at screen level (#1943)
  build: bump Flipcash to 2026.11.2
  ...

# Conflicts:
#	CLAUDE.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build-system Gradle, convention plugins, build-logic area: network gRPC, connectivity, API, exchange rates area: tokens Token accounts, balances, token info area: ui Compose UI, theme, components, resources type: refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant