Repository navigation
refactor(emojis): make libs:emojis a KMP module - #1925
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
libs:emojisbecomes 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 movingshared/chatto KMP; that follows in the next PR.RecentReactionsand the store interface move tocommonMain. The first commit is the directory move only, so the second shows the real edits.DataStoreRecentReactionsStoretakesPreferencesFilesinstead of aContext. It still opensrecent_reactionswith the same keys, andContextPreferencesFilesresolves to the same pathpreferencesDataStoreused, so existing Android data is read unchanged.ReactionsModuleis now incommonMainand takesPreferencesFiles.EmojiDrawabilitykeeps its API; the default probe comes fromexpect fun deviceGlyphProbe(). Android is the samePaint.hasGlyphprobe. The JVM actual asks AWT's logicalDialogfont 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.EmojiPickerViewModelnow callsdeviceGlyphProbe()in place ofEmojiDrawability.PaintGlyphProbe, which is the only consumer change.src/commonMain/kotlin/.../generated, and compile, KSP and lint tasks depend on it.androidHostTest(18 tests, same as before).RecentReactionsStoreTestnow 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 instrumentedEmojiDrawabilityVectorTestreadsreactions.jsonfrom resources instead of assets and moves toandroidDeviceTest; it compiles and assembles but I did not run it on a device.libs:emojisnow depends on:apps:flipcash:coreforPreferencesFiles. That pulls firebase'sprotolite-well-known-typesinto the device-test classpath, where it duplicatesprotobuf-javaliteclasses, so the build excludes it from device-test configurations only.