Skip to content

refactor(emojis): make libs:emojis a KMP module - #1925

Merged
bmc08gt merged 2 commits into
refactor/chat-unused-depsfrom
refactor/emojis-kmp
Oct 31, 2026
Merged

bmc08gt merged 2 commits into
refactor/chat-unused-depsfrom
refactor/emojis-kmp

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

libs:emojis becomes a Kotlin Multiplatform module (flipcash.kmp.app.library, Android + JVM) so Compose Desktop can use the reaction picker and recents. This is the first step toward moving shared/chat to KMP; that follows in the next PR.

  • The emoji tables, catalog loader, RecentReactions and the store interface move to commonMain. The first commit is the directory move only, so the second shows the real edits.
  • DataStoreRecentReactionsStore takes PreferencesFiles instead of a Context. It still opens recent_reactions with the same keys, and ContextPreferencesFiles resolves to the same path preferencesDataStore used, so existing Android data is read unchanged. ReactionsModule is now in commonMain and takes PreferencesFiles.
  • EmojiDrawability keeps its API; the default probe comes from expect fun deviceGlyphProbe(). Android is the same Paint.hasGlyph probe. The JVM actual asks AWT's logical Dialog font whether it can display the string. AWT has no single-glyph check, so a ZWJ sequence a font draws as separate components reads as drawable on desktop.
  • EmojiPickerViewModel now calls deviceGlyphProbe() in place of EmojiDrawability.PaintGlyphProbe, which is the only consumer change.
  • The emoji generator task writes into src/commonMain/kotlin/.../generated, and compile, KSP and lint tasks depend on it.
  • Host tests move to androidHostTest (18 tests, same as before). RecentReactionsStoreTest now gives each test its own temp preferences directory. test-vectors/ is added as a resource directory on the host and device test source sets. The instrumented EmojiDrawabilityVectorTest reads reactions.json from resources instead of assets and moves to androidDeviceTest; it compiles and assembles but I did not run it on a device.
  • libs:emojis now depends on :apps:flipcash:core for PreferencesFiles. That pulls firebase's protolite-well-known-types into the device-test classpath, where it duplicates protobuf-javalite classes, so the build excludes it from device-test configurations only.

Compose Desktop needs the reaction picker and recents. The data tables, catalog
loader and recents store move to commonMain. DataStoreRecentReactionsStore takes
PreferencesFiles instead of a Context, with the same recent_reactions file and
keys. EmojiDrawability's Paint probe becomes an expect/actual: Paint.hasGlyph on
Android, an AWT font check on the JVM.
@bmc08gt bmc08gt self-assigned this Oct 31, 2026
@github-actions github-actions Bot added the type: refactor Code restructuring, no behavior change label Oct 31, 2026
@bmc08gt
bmc08gt merged commit 683fcbd into refactor/chat-unused-deps Oct 31, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant