-
-
Notifications
You must be signed in to change notification settings - Fork 282
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: 4628 - new "reorder Knowledge Panels" feature from dev mode #4778
feat: 4628 - new "reorder Knowledge Panels" feature from dev mode #4778
Conversation
New files: * `reorderable_knowledge_panel_page.dart`: Page where the user can reorder the Knowledge Panel Cards. * `reordered_knowledge_panel_cards.dart`: Knowledge Panel Cards as reordered by the user. * `standard_knowledge_panel_page.dart`: Knowledge Panel Cards as provided by the server. Impacted files: * `app_en.arb`: added a "reorder the attributes" label * `knowledge_panel_card.dart`: added an `isClickable` parameter to be get rid of the click icon+effect when reordering attributes * `knowledge_panel_expanded_card.dart`: added an `isClickable` parameter * `knowledge_panel_group_card.dart`: added an `isClickable` parameter * `knowledge_panel_page.dart`: explicitly setting `isClickable: true` * `knowledge_panels_builder.dart`: added an `isClickable` parameter * `new_product_page.dart`: now using a dev-mode flag to determine if we display the reorder feature; moved code to new class `StandardKnowledgePanelCards` * `pubspec.lock`: wtf * `score_card.dart`: unrelated minor refactoring * `user_preferences.dart`: added the user ordered attribute list as preference * `user_preferences_dev_mode.dart`: added a flag for user reordered attribute feature
Codecov Report
@@ Coverage Diff @@
## develop #4778 +/- ##
==========================================
- Coverage 9.89% 9.85% -0.05%
==========================================
Files 312 315 +3
Lines 15809 15878 +69
==========================================
Hits 1565 1565
- Misses 14244 14313 +69
📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
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.
I don't get what's going on visually. It looks that everything was flattened (the screen with the reorder button), and I can't visually understand where I am. Also, there seems to be some duplicated data (packaging)
Of course everything is flattened, as all KP "items" are now considered equal. If we put those items inside "Health" or "Environment" cards, then the concept of reordering cannot be achieved, can it? Imagine I want to put Nova, Ecoscore and Saturated Fats on top, should we say "Health / Nova", "Environment / Ecoscore" then "Health: Saturated Fats"?
That's probably because my screenshots were at too early a stage of my dev, when I didn't discriminate between panels and panel_groups. |
Generally speaking, it's OK for, as the idea would be to pick the items we want, then we can reorder them. |
@g123k If you're worried about blowtorching the code when you refactor the product page, keep in mind that the new display is in a separate file, |
@teolemon You can consider it as a POC, with potential iterative improvements. |
Code-wise, I have a general question about the implementation. I have not a strong opinion on this and this is an opened question, but shouldn't we have a kind of hierarchy to force grouping by section? |
That's the way I interpreted it. Like, I care about packagings and NOVA, and not really about the rest. Or, given that each user (like me) has a limited interest in ALL data, pinning specific data would be the answer. I don't want to reorder all, I'm just interested in a couple of food data, so I pin them, and see them on top of everything. |
@g123k @teolemon I can't remember if reordering KPs was part of the POC.
|
This was tested at the beginning of the POC to know if people were interested, but never designed. The only drawback pointed out by @teolemon is actually, it's step 2 of the issue. |
@g123k @teolemon I cannot picture exactly what you mean.
TBH I would appreciate a verbose description of what is supposed to happen here. Possible scenario: I can somehow remove the actual "reorder items" feature from this PR and keep most of the induced refactoring. That way we would be ready when we have a clear view of what to do, especially on the new tab'ed product page. |
The closest mockup we have at the moment are this one it is meant to be for the homepage but it gives you an indication of where we could go. The second mockup gives you a sense of what the 4u page will look like. cc @g123k |
The idea of the "For me" tab will be split in two parts:
That's why for the second part, we have to first ask for the items the user wants, then offer the ability to reorder them |
Seems better for me, I would just change the title of the first step with something like "Personal feed: select the attributes" |
@g123k In those cases, please approve the PR first and then I'll do the minor changes. With just a couple of reviewers at the moment, we need to remove frictions in the PR approval process in order to have smoother code integration. Assuming that smoother code integration is a good idea. |
It will be DEV mode, right ? If so, we can potentially merge @monsieurtanuki, but then I'll add it to my newly created tracker of unfinished features.
|
My issue with approving partial PR was that we didn't track the missing features. |
What
Screenshot
Fixes bug(s)
Files
New files:
reorderable_knowledge_panel_page.dart
: Page where the user can reorder the Knowledge Panel Cards.reordered_knowledge_panel_cards.dart
: Knowledge Panel Cards as reordered by the user.standard_knowledge_panel_page.dart
: Knowledge Panel Cards as provided by the server.Impacted files:
app_en.arb
: added a "reorder the attributes" labelknowledge_panel_card.dart
: added anisClickable
parameter to be get rid of the click icon+effect when reordering attributesknowledge_panel_expanded_card.dart
: added anisClickable
parameterknowledge_panel_group_card.dart
: added anisClickable
parameterknowledge_panel_page.dart
: explicitly settingisClickable: true
knowledge_panels_builder.dart
: added anisClickable
parameternew_product_page.dart
: now using a dev-mode flag to determine if we display the reorder feature; moved code to new classStandardKnowledgePanelCards
pubspec.lock
: wtfscore_card.dart
: unrelated minor refactoringuser_preferences.dart
: added the user ordered attribute list as preferenceuser_preferences_dev_mode.dart
: added a flag for user reordered attribute feature