Repository navigation
feat(ui): UI kit open to apps, shop widgets, stories V2 polls - #25
Merged
Merged
Conversation
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
… popup products open in the shop
…tered options, results header and vote count
…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
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.
The UI kit is open to apps from
package:rees46_sdk/rees46_sdk.dart, along withsdk.getStoriesandsdk.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;
getCategorytakes brands, locations, facet filters, a price range and sorting;enableAutoPopupPresentationcan 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.