-
-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Make attributes clickable (without Provider) #1666
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1666 +/- ##
==========================================
- Coverage 8.86% 8.26% -0.60%
==========================================
Files 161 166 +5
Lines 6623 7149 +526
==========================================
+ Hits 587 591 +4
- Misses 6036 6558 +522
Continue to review full report at Codecov.
|
@teolemon Now that we download products by (smaller) packs of 25, couldn't we download the knowledge panels directly with the product? It's just a product field, that is not included in the default list in smoothie. |
@@ -54,6 +53,9 @@ class _ProductPageState extends State<ProductPage> { | |||
AnalyticsHelper.trackProductPageOpen( | |||
product: _product, | |||
); | |||
knowledgePanels = KnowledgePanelsQuery( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this will reissue a backend query, just to confirm, knowledge_panels are not fetched as part of the product query when we scan a product ?
Also, will this be cached ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jasmeet0817 The answers are no and no. Good point, cf. #1666 (comment)
final KnowledgePanel? knowledgePanel = | ||
knowledgePanels?.panelIdToPanelMap[attribute.panelId]; | ||
|
||
if (knowledgePanel == null || knowledgePanels == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will kind of suck if the user sees Loading dialog and then the KP is not found. And nothing happens :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can of course show a Snackbar or something similar there but I don't think that solves the fundamental problem, combining the query's on the other hand would simplfy everything
} | ||
|
||
if (!done) { | ||
knowledgePanels = await LoadingDialog.run<KnowledgePanels>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this loading dialog look like ? Does it just say "Loading". That might be ok but I'm just checking if we want a custom message ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default loading dialog title is Downloading data
Im definitely in favor of combining the querys, this would simplfy the whole code |
Are we good to merge @monsieurtanuki @jasmeet0817 ? |
As far as I'm concerned, no. I don't understand why we should keep knowledge panels apart from the other product data, and as @jasmeet0817 pointed out that means that they are not cached in the local database. My suggested solution: put the knowledge panels in the default product fields. Doing so is so much simpler. |
Sorry I don't have laptop access anymore, so I'm texting from phone. What was the reason for the split of the two api calls? Is it to reduce payload size when scanning? If that's the case then I wonder if there's a way of making a background api call for products on scan to fetch their KPs, otherwise page opening will be slow. I also think caching is super important. |
@jasmeet0817 I'm planning to build a button that refreshes all the database from the back-end. That's more or less needed by #1651. |
@M123-dev @jasmeet0817 @teolemon I've just tested the size of the results, with 3 barcodes, with the current smoothie fields, and with the current fields plus knowledge panels. I really think we can afford a 2.3 bigger size now that we're more frugal with smaller 25 pack.
|
Ok, let's try. |
Working on it. PR tomorrow (Friday) morning. |
Some metrics on latency of the api calls would be nice, so then we can see the impact of your change on the metrics. |
I'm quite optimistic. In addition to that we spare an additional call to the back end. |
Updated the PR @monsieurtanuki @jasmeet0817 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @M123-dev, now it's much easier to read (and to approve), isn't it?
It is easier to merge as well once it's approved, but I will leave @M123-dev the privilege 😊 |
Definitely @monsieurtanuki and thanks @teolemon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also looks good to me
What
knowledge_panel_card
toknowledge_panel_page
new_product_page
moved knowledge panel query from build method to initState + update method.summary_card
created new methodopenFullKnowledgePanel
to openknowledge_panel_page
with opening LoadingDialog if the knowledge panels aren't loaded already