Skip to content

feat(ui): UI kit open to apps, shop widgets, stories V2 polls - #25

Merged
Xyzcancer merged 58 commits into
masterfrom
ui-components-use-cases
Nov 9, 2026
Merged

Xyzcancer merged 58 commits into
masterfrom
ui-components-use-cases

Conversation

@Xyzcancer

@Xyzcancer Xyzcancer commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

The UI kit is open to apps from package:rees46_sdk/rees46_sdk.dart, along with sdk.getStories and sdk.openUrl. The README does not announce it yet.

What the kit gains on this branch: a recommender block, search and category screens with filters and sorting, stories V2 polls and a share button, product cards on the shop's data.

Popups v3 and stories over API v3 (share links, polls) are not public API: they stay behind a src barrel of their own and are not reachable from the package or the kit's widgets.

SDK: products get old price, discount, deeplinks and facets; getCategory takes brands, locations, facet filters, a price range and sorting; enableAutoPopupPresentation can be changed at any time.

Native SDKs: Android 2.47.0 and iOS 3.37.0, the releases that open the kit there; the bridges pass a category's price range and sorting to them, and the kit's category screen shows both.

Product, RecommendedProduct and SearchProduct gain nullable oldPrice,
oldPriceFormatted, discount, discountFormatted, discountPercent,
deeplinkAndroid, deeplinkIos, isNew and picture where missing.
CategoryResponse gains brands, filters and priceRange,
ProductsListResponse gains brands and filters. Parsing tests run on
live API samples.
Recommendations, product info and search products now carry
oldprice, oldprice_formatted, discount, deeplink_ios, is_new and
picture where REES46 3.35.0 has them; products list passes brands and
filters, category passes brands.
PersonalizationProduct gains url and deeplink (the link of the running
platform). Search, recommendation and catalog products map through the
same rules; the search mapper it replaces kept its behaviour.
The API carries no rating, so the screen draws cards without one unless
showRating is set; the catalog draws the rating only with its own
showRating flag.
Keyed by shop, request kind and parameters; answers live ten minutes,
at most 32 of them with the oldest evicted first; the same request in
flight goes out once; errors are not cached. Not wired to any widget
yet.
Idle, Loading, Content, Empty and Error states and a controller that
runs a request, tells an empty answer from content, repeats the last
request and drops answers to superseded ones. Not wired yet.
A failed first page shows errorText with a retryText button built from
the kit's empty state and button; a failed next page turns load more
into retryText. Retry asks for the same page, infinite scroll waits
for it, and onError is called as before.
The badge needs a positive discount number (discount, else
discount_percent) besides the shown old price, so a zero, true or
garbage discount no longer reads as -0% or -true%. The text keeps
exactly one leading minus.
The key is the JSON of the shop, the kind and the sorted parameters, so
a value holding & or = no longer matches another set of parameters.
The ten-minute lifetime runs on a Stopwatch instead of the wall clock.
fetch now subscribes with callbacks and returns a cancellable
subscription. A request older than 30 seconds takes no new waiters and
a new generation goes out; an older generation answers only its own
waiters and stays out of the cache when a newer one exists or clear()
came after it started. The last waiter leaving drops the request from
flight, force skips both the cached answer and the request in flight,
and a throwing callback no longer keeps the answer from the others.
A null or empty errorText or retryText falls back to the default
text, so a failed page always shows a retry button and infinite scroll
is never left waiting for a button that is not there.
The header drops its "Found 0 products" line while the first page
shows its error, so the error does not read as an empty result.
They used to set the value of a disposed notifier, which asserts in
debug builds.
The Dart Product reads them as nullable, so the native zeros of
REES46 Product came through as a real 0 on iOS while Android sends
nothing. Search products keep the zeros their model expects.
Samples rebuilt as Gson of the Android v2.45.0 models and as the iOS
bridge dictionaries over REES46 3.35.0, with the fields that wait for a
native release asserted null. The raw-answer tests are labelled parser
only.
discount_formatted is formatted from discount, so it is used only when
the badge number comes from discount; a badge from discount_percent
reads <discount_percent>%, and discount 0 with "0%" and
discount_percent 5 now shows -5% instead of -0%.
The block takes a recommendation code (with item, category and locations)
or a collection id, loads through the shared request cache and shows the
answer in a products block. It takes no space until products arrive, stays
hidden for an empty, short or failed answer, and fades in. A second block
with the same parameters draws the cached answer in its first frame; the
controller's reload goes past the cache. A tap on a recommendation stores
the dynamic source with the block code before the host hears of it.
…sts their categories

CategoryResponse and SearchFullResponse gain brandCounts,
SearchIndustrialFilters gains colorCounts and fashionSizeCounts.
ProductsListResponse gains categories; the iOS bridge sends none until
the native model has them.
showDots defaults to false in PersonalizationProductsBlock and
PersonalizationRecommenderBlock: the carousel scrolls freely, and a dot
per product is no indicator.
In a narrow column the label ends with an ellipsis instead of breaking
letter by letter.
…f shrinking

The internal PersonalizationWrapRow lays boxes in a row and wraps what
does not fit. The list card moves the badge under the price and the
button under the price block, to the right; the grid card puts a long
old price above the price. Prices and a single button label stay on
one line.
…croll

With a bounded height only the sections scroll; inside a host scroll
the screen follows its content as before.
PersonalizationCategoryScreen loads, pages, filters and tracks a
category on the same core as PersonalizationSearchResultsScreen. Both
show the ten most common facets first (maxFacets; a host list wins),
label filter values by their JSON title with product counts
(showValueCounts, facetValueTitle from the host), and show the found
count only once the first page of the current request answers. The
category screen hides its price section and sort button until the
bridges apply them.
As in the native demos. A tab is built on first open and keeps its
state; the shop has its own navigator inside the tab, and system back
walks it while the tab is open.
ProductsListResponse.categories first, the products' category paths
where a bridge sends none (iOS for now); a page of 10 products is
enough.
… bought-with and popular blocks

ShopSearchField is the one instant search of home, category and
product. The product page shows the similar, bought-with and popular
blocks under server titles, each hidden while it has no products.
…ng and facet titles

Search and category sort through the platform picker (ShopSort); the
shop names its feed's facets and their values (shopFacetTitle,
shopFacetValueTitle).
# Conflicts:
#	example/lib/main.dart
#	example/lib/ui_kit_pane.dart
…er button, a header menu shows demo popups by hand
…consent checkbox takes the form's colors, kit blocks the theme of the popup's background; a link the host opened itself closes the popup without close
… on iOS and Android, and popups v3 follow it
…(or the native demos' rees46://game) opens from outside, a popup or a story; trigger popups keep off it; #185 in the header's popup menu
….dart; popups v3 and stories over API v3 move behind their own src barrel
…s a price range and sorting, and the kit's category screen shows both
@Xyzcancer
Xyzcancer marked this pull request as ready for review November 9, 2026 18:09
@Xyzcancer
Xyzcancer merged commit c6d3585 into master Nov 9, 2026
@Xyzcancer
Xyzcancer deleted the ui-components-use-cases branch November 9, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant