Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
2da82f1
feat(ui): design system tokens and base components
Xyzcancer Sep 11, 2026
9833d40
feat(ui): PersonalizationTheme extension so a host can rebrand the de…
Xyzcancer Sep 14, 2026
17c3203
fix(ui): follow the design file — button radii, LG height, input fill…
Xyzcancer Sep 14, 2026
6c41f9a
feat(ui): product card, product image and favorites badge
Xyzcancer Sep 14, 2026
e8046f6
feat(ui): product lists and recommender block
Xyzcancer Sep 14, 2026
609172c
feat(ui): search suggestions and catalogue screen, plus the arrow-rot…
Xyzcancer Sep 14, 2026
0ce2708
feat(ui): keep the design system out of the package barrel until release
Xyzcancer Sep 15, 2026
f433825
fix(ui): ship the icon assets from the package root so they bundle
Xyzcancer Sep 15, 2026
5710346
feat(example): UI Kit screen shows the design system's components and…
Xyzcancer Sep 15, 2026
6cb4a4d
feat(ui): instant search and filters screens, text link
Xyzcancer Sep 15, 2026
a35f351
feat(ui): product card follows the image aspect, carousel old price 1…
Xyzcancer Sep 15, 2026
09f028f
feat(example): instant search states, filters screen, card aspects in…
Xyzcancer Sep 15, 2026
48e833b
feat(ui): empty state in the catalogue
Xyzcancer Sep 16, 2026
4d97609
feat(example): catalogue empty state in the UI Kit pane
Xyzcancer Sep 16, 2026
138cfb7
feat(search): facets, suggested queries, old price and discount throu…
Xyzcancer Sep 16, 2026
971d4cc
feat(ui): card tap, product tap passthrough, title button toggles, ro…
Xyzcancer Sep 16, 2026
c0f50a7
feat(ui): instant search field and search results screen bound to the…
Xyzcancer Sep 16, 2026
99a776d
feat(example): search tab running the live search widgets
Xyzcancer Sep 16, 2026
bfd52fa
fix(android): full search returns the server response whole
Xyzcancer Sep 16, 2026
7bdd4a3
feat(ui): price bounds as placeholders in the search filters
Xyzcancer Sep 16, 2026
c80939a
style(ui): dart format the card, list, catalogue, theme and the examp…
Xyzcancer Sep 18, 2026
1cee01d
style(ui): dart format the remaining design system files
Xyzcancer Sep 18, 2026
e3f38d9
fix(ui): cards in a row share a baseline, loader replaces count and l…
Xyzcancer Sep 18, 2026
8e5f97b
feat(example): dark theme wired, bundled photos, category title on th…
Xyzcancer Sep 18, 2026
7eb2b16
feat(example): appearance switch on the UI Kit screen
Xyzcancer Sep 21, 2026
e157e90
feat(ui): in-app popup widget
Xyzcancer Sep 21, 2026
a275b21
feat(example): in-app popup exhibits
Xyzcancer Sep 21, 2026
c85da53
docs(ui): note what wiring the in-app popup to SDK data needs
Xyzcancer Sep 21, 2026
4027a0e
feat(example): fullscreen in-app popup exhibits
Xyzcancer Sep 21, 2026
3219b1c
docs(ui): in-app popup TODO follows the Android interception point
Xyzcancer Sep 22, 2026
ed98135
fix(ui): search results show "no results" only when there are none
Xyzcancer Sep 22, 2026
c7639b7
fix(ui): filter edits survive a rebuild of the results screen
Xyzcancer Sep 22, 2026
1efc10d
fix(ios): a search page becomes the right offset
Xyzcancer Sep 22, 2026
679d0aa
refactor(android): drop the unused search params builder
Xyzcancer Sep 22, 2026
7ab98d5
fix(ui): tokens follow the design file's variables again
Xyzcancer Sep 23, 2026
f171e3d
style(ui): format the radius scale fields
Xyzcancer Sep 23, 2026
9208d03
fix(ui): in-app popup cross, buttons and shadow as in the finished de…
Xyzcancer Sep 23, 2026
6151cac
perf(ui): the catalogue builds only the cards on screen
Xyzcancer Sep 23, 2026
744586a
feat(example): catalogue exhibits laid out whole in the showcase scroll
Xyzcancer Sep 23, 2026
2439d65
feat(ui): toast and loyalty card
Xyzcancer Sep 23, 2026
9231598
feat(example): toast and loyalty card exhibits
Xyzcancer Sep 23, 2026
4542c49
feat(example): category suggestions with pictures in the instant sear…
Xyzcancer Sep 30, 2026
07af627
fix(deps): build against Android SDK 2.39.0 and iOS SDK 3.34.0
Xyzcancer Sep 30, 2026
3e1f2c3
fix(android): enableAutoPopupPresentation reaches the native SDK
Xyzcancer Sep 30, 2026
7ebab07
chore(example): neutral logo on the loyalty card exhibits
Xyzcancer Sep 30, 2026
8672f2e
feat(stories): block data through the bridge
Xyzcancer Sep 30, 2026
d813ac1
feat(ui): stories v2 components
Xyzcancer Sep 30, 2026
973cddd
feat(ui): stories v2 viewer and widget
Xyzcancer Sep 30, 2026
cc894be
feat(example): stories v2 exhibits
Xyzcancer Sep 30, 2026
30763a3
fix(ui): stories v2 follow the shared rules
Xyzcancer Sep 30, 2026
ddc7db7
fix(ui): a viewed story's ring is solid
Xyzcancer Sep 30, 2026
e730f86
feat(stories): seen slides, cache dir and audio session through the b…
Xyzcancer Oct 1, 2026
023cffa
feat(ui): stories playback state machine
Xyzcancer Oct 2, 2026
50721ac
feat(ui): video cache for stories
Xyzcancer Oct 2, 2026
fd1bdae
feat(ui): stories seen store and sound state
Xyzcancer Oct 2, 2026
75ee846
feat(ui): stories v2 viewer and widget on the shared rules
Xyzcancer Oct 2, 2026
a76ef3c
feat(example): stories v2 round-2 exhibits
Xyzcancer Oct 2, 2026
644e6b7
fix(ui): a carousel product closes the stories viewer with the sheet …
Xyzcancer Oct 2, 2026
e8a8102
fix(ui): stories video plays from the network while the cache fills
Xyzcancer Oct 2, 2026
f672df4
fix(ui): a stories button without a link keeps the viewer open
Xyzcancer Oct 2, 2026
bc5fbed
fix(ui): restarting a story slide keeps its media and tracking
Xyzcancer Oct 2, 2026
792baf4
fix(ui): the stories sound button names the current sound state
Xyzcancer Oct 2, 2026
054d81b
fix(ui): the stories cross closes the viewer with the sheet open
Xyzcancer Oct 2, 2026
3bb7d34
fix(ui): story text line spacing follows the nearest preset
Xyzcancer Oct 2, 2026
fe0c4db
fix(ui): stories readiness and retry timers freeze in the background
Xyzcancer Oct 2, 2026
e6af726
fix(ui): stories drop promoToastPosition, the toast is always on top
Xyzcancer Oct 2, 2026
ece5bdc
fix(ui): stories controller queues open, turns the open viewer, waits…
Xyzcancer Oct 2, 2026
f7a0164
fix(ui): stories show() reports an empty block
Xyzcancer Oct 2, 2026
653b383
fix(ui): a stories controller handed to a loaded block runs its queue…
Xyzcancer Oct 2, 2026
3e6b9b6
fix(ui): a story restart seeks only a ready video
Xyzcancer Oct 2, 2026
97cb2e3
fix(ui): stories v2 drop repeated story ids
Xyzcancer Oct 2, 2026
debbfd8
feat(ui): stories v2 reads gif frame delays and loop length
Xyzcancer Oct 6, 2026
0b84eac
feat(ui): stories v2 loads images itself, a gif off the slide stays o…
Xyzcancer Oct 6, 2026
c324d27
feat(ui): stories v2 plays gif slides for at least one loop and pause…
Xyzcancer Oct 6, 2026
e9a5cf5
feat(example): stories v2 sample block with a gif story and a cover bar
Xyzcancer Oct 6, 2026
edfd13f
fix(ui): stories v2 product card shows the promo code of the slide's …
Xyzcancer Oct 7, 2026
17936b4
fix(ui): stories v2 product picture no longer opens the product, taps…
Xyzcancer Oct 7, 2026
32c5134
feat(example): stories v2 sample product slide carries a text block p…
Xyzcancer Oct 8, 2026
a97de07
fix(ui): stories seen slides read back over the bridge without a fail…
Xyzcancer Oct 9, 2026
8888ac6
Merge remote-tracking branch 'origin/master' into feature/uikit-desig…
Xyzcancer Oct 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ android {

dependencies {
// REES46 Android SDK.
val rees46AndroidSdkVersion = "v2.38.0"
val rees46AndroidSdkVersion = "v2.39.0"
add("rees46Implementation", "com.github.rees46:android-sdk:$rees46AndroidSdkVersion")

// Used directly by the push presenter (NotificationCompat / ContextCompat). The native SDK
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.rees46.rees46_flutter_sdk

import android.content.ActivityNotFoundException
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.os.SystemClock
import com.rees46.rees46_flutter_sdk.pigeon.FlutterError
Expand Down Expand Up @@ -29,6 +31,7 @@ import com.personalization.api.models.tracking.TrackingSource
import com.personalization.api.models.tracking.TrackingSourceType
import com.personalization.api.params.ProfileParams
import com.personalization.api.params.SearchParams as NativeSearchParams
import com.personalization.SearchParams as LegacySearchParams
import com.personalization.sdk.data.models.dto.notification.NotificationData
import com.rees46.rees46_flutter_sdk.push.Rees46PushNotifier
import com.rees46.rees46_flutter_sdk.push.Rees46ShopStore
Expand Down Expand Up @@ -142,6 +145,7 @@ class Rees46FlutterSdkPlugin :
stream = config.stream,
autoSendPushToken = config.autoSendPushToken,
needReInitialization = config.needReInitialization,
enableAutoPopupPresentation = config.enableAutoPopupPresentation,
)
// F3: initialize (and register) the instance through the multi-instance
// `Rees46` facade so it is reachable by shopId via Rees46.getInstance.
Expand Down Expand Up @@ -326,15 +330,31 @@ class Rees46FlutterSdkPlugin :
return
}
try {
val params = buildSearchParams(paramsJson)
sdk(shopId).searchManager.searchFull(
query = query,
searchParams = params,
onSearchFull = { response ->
callback(Result.success(Gson().toJson(response)))
},
onError = { code, message ->
callback(Result.failure(FlutterError("search_failed", message ?: "error $code", null)))
// The raw, deprecated SDK.search entry point rather than the typed
// searchManager.searchFull: up to android-sdk v2.38.0 the typed SearchFullResponse and
// Product had no `filters`, `industrial_filters`, `oldprice`, `oldprice_formatted`,
// `discount` or `discount_formatted`, so Gson dropped them before they reached Dart,
// and the results screen needs the facets and the old price. The raw entry point
// returns the server JSON as is.
// TODO: v2.39.0, which this plugin now pins, has those fields. Switch to
// sdk(shopId).searchManager.searchFull(query, NativeSearchParams, …) with
// Gson().toJson(response), as searchInstant does, and move the params builder to
// NativeSearchParams — after checking against a live shop that the typed response
// carries everything the results screen reads.
val params = buildLegacySearchParams(paramsJson)
@Suppress("DEPRECATION")
sdk(shopId).search(
query,
LegacySearchParams.TYPE.FULL,
params,
object : OnApiCallbackListener() {
override fun onSuccess(response: JSONObject?) {
callback(Result.success(response?.toString() ?: "{}"))
}

override fun onError(code: Int, msg: String?) {
callback(Result.failure(FlutterError("search_failed", msg ?: "error $code", null)))
}
},
)
} catch (t: Throwable) {
Expand Down Expand Up @@ -475,6 +495,71 @@ class Rees46FlutterSdkPlugin :
}
}

override fun getStories(code: String, shopId: String?, callback: (Result<String>) -> Unit) {
if (code.isBlank()) {
callback(Result.failure(FlutterError("bad_args", "code is required", null)))
return
}
try {
// The public raw entry point: the listener gets the server JSON as is, the same payload
// the iOS bridge hands over, so Dart parses one shape. The typed loader
// (storiesManager.loadStories) is internal to the SDK module.
sdk(shopId).stories(
code,
object : OnApiCallbackListener() {
override fun onSuccess(response: JSONObject?) {
callback(Result.success(response?.toString() ?: "{}"))
}

override fun onError(code: Int, msg: String?) {
callback(Result.failure(FlutterError("get_stories_failed", msg ?: "error $code", null)))
}
},
)
} catch (t: Throwable) {
callback(Result.failure(FlutterError("get_stories_failed", t.message, null)))
}
}

override fun openUrl(url: String, callback: (Result<Boolean>) -> Unit) {
val uri = Uri.parse(url)
if (url.isBlank() || uri.scheme.isNullOrEmpty()) {
callback(Result.success(false))
return
}
// The activity when there is one: from the application context a new task is required.
val activity = activityBinding?.activity
val intent = Intent(Intent.ACTION_VIEW, uri)
if (activity == null) intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
try {
(activity ?: applicationContext).startActivity(intent)
callback(Result.success(true))
} catch (e: ActivityNotFoundException) {
callback(Result.success(false))
}
}

// region stories viewer (UI kit)

override fun getStoriesSeen(shop: String): Map<String, List<String>> =
StoriesSeenStore.read(applicationContext, shop)

override fun setStorySlideSeen(shop: String, storyId: String, slideId: String) =
StoriesSeenStore.add(applicationContext, shop, storyId, slideId)

override fun getCacheDirectory(): String = applicationContext.cacheDir.absolutePath

// The audio session calls are iOS-only. On Android video_player plays with
// `mixWithOthers: true` and so never requests the audio focus: a muted video leaves the
// user's music alone, and there is no session to restore.
override fun beginStoriesAudio() = Unit

override fun updateStoriesAudio(muted: Boolean) = Unit

override fun endStoriesAudio() = Unit

// endregion

override fun getSid(shopId: String?): String = sdk(shopId).getSid()

override fun getDid(shopId: String?): String? = sdk(shopId).getDid()
Expand Down Expand Up @@ -892,8 +977,14 @@ class Rees46FlutterSdkPlugin :

}

private fun buildSearchParams(paramsJson: String?): NativeSearchParams {
val params = NativeSearchParams()
/**
* Search parameters from the bridge JSON, on the legacy params class the raw search entry point
* takes. Keys come from the current parameter enum — both classes implement the same interface —
* so the wire names stay identical.
*/
@Suppress("DEPRECATION")
private fun buildLegacySearchParams(paramsJson: String?): LegacySearchParams {
val params = LegacySearchParams()
if (paramsJson.isNullOrBlank()) return params
val json = JSONObject(paramsJson)
json.optInt("limit").takeIf { it > 0 }
Expand Down Expand Up @@ -924,6 +1015,17 @@ private fun buildSearchParams(paramsJson: String?): NativeSearchParams {
?.let { params.put(NativeSearchParams.Parameter.COLORS, it) }
jsonArrayToStringArray(json.optJSONArray("fashion_sizes"))
?.let { params.put(NativeSearchParams.Parameter.FASHION_SIZES, it) }
json.optJSONObject("filters")?.let { facets ->
val searchFilters = NativeSearchParams.SearchFilters()
var any = false
facets.keys().forEach { name ->
jsonArrayToStringArray(facets.optJSONArray(name))?.let {
searchFilters.put(name, it)
any = true
}
}
if (any) params.put(NativeSearchParams.Parameter.FILTERS, searchFilters.toString())
}
return params
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.rees46.rees46_flutter_sdk

import android.content.Context
import android.content.SharedPreferences

/**
* The slides of the UI kit's stories (V2) the user has seen, per shop: one preferences file
* per shop, a key per story id holding the set of seen slide ids. It survives app restarts, so a
* story reopens at its first unseen slide and its cover keeps the seen segments.
*
* The plugin's own store, not the native SDK's: the Flutter viewer is drawn in Dart, and the
* native SDK keeps no such state for it.
*/
internal object StoriesSeenStore {

private const val PREFS_PREFIX = "rees46_flutter_stories_seen_"

/** Seen slide ids by story id for [shop]; empty when nothing was seen yet. */
fun read(context: Context, shop: String): Map<String, List<String>> =
prefs(context, shop).all.mapNotNull { (storyId, value) ->
(value as? Set<*>)?.filterIsInstance<String>()?.let { storyId to it.sorted() }
}.toMap()

/** Adds [slideId] to the seen slides of [storyId] for [shop]. */
fun add(context: Context, shop: String, storyId: String, slideId: String) {
val prefs = prefs(context, shop)
// The returned set must not be modified in place: copy it.
val seen = prefs.getStringSet(storyId, null).orEmpty()
if (slideId in seen) return
prefs.edit().putStringSet(storyId, seen + slideId).apply()
}

// The shop id becomes part of a file name: anything but letters, digits, `-` and `_` is
// replaced.
private fun prefs(context: Context, shop: String): SharedPreferences =
context.getSharedPreferences(
PREFS_PREFIX + shop.replace(Regex("[^A-Za-z0-9_-]"), "_"),
Context.MODE_PRIVATE,
)
}
Loading
Loading