-
-
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: #2174 - doomscrolling instead of "download more" button #2770
Conversation
…utton Impacted file: * `product_query_page.dart` * we display the whole list of products, even if we don't know them (not even their barcodes) * we trigger automatically the download of the next page, when the first unknown product is asked by the `ListView` * when we are loading the next page we don't hide the previous results with a dialog or a progress indicator
…utton Impacted file: * `Podfile.lock`: wtf * `product_query_page.dart` * we display the whole list of products, even if we don't know them (not even their barcodes) * we trigger automatically the download of the next page, when the first unknown product is asked by the `ListView` * when we are loading the next page we don't hide the previous results with a dialog or a progress indicator
Codecov Report
@@ Coverage Diff @@
## develop #2770 +/- ##
==========================================
- Coverage 8.86% 7.13% -1.73%
==========================================
Files 161 218 +57
Lines 6623 10619 +3996
==========================================
+ Hits 587 758 +171
- Misses 6036 9861 +3825
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
like for first unknown page index - 5? >> perhaps one or two page ahead, given the speed ?
if (index >= _model.displayBarcodes.length) { | ||
// TODO(monsieurtanuki): maybe display something specific for data being downloaded (the next page) and unknown data (beyond next page) | ||
return const SmoothProductCardTemplate(); | ||
} |
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.
One thing, the template has no common loading animation it is just a plan thing, if it takes over a certain amount of time and the user can scroll as long as he want's it could create the illusion that something is broken, therefor I'd suggest to at max show only one template at a time.
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.
it's usually solved using a shimmering effect that suggests loading
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.
Yeah but I'd still prefer a single one and as we know monsieurtanuki isn't a friend of fancy animations so thats something we can always add later
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.
ok
@teolemon @M123-dev Oops, I had minor changes about to be pushed. What do you think of that: const int numberOfPagesBeforeDownload = 1;
const int numberOfDownloadingPages = 1;
// if not all products are already downloaded
if (_model.supplier.partialProductList.totalSize >
_model.displayBarcodes.length) {
if (index >=
_model.displayBarcodes.length -
numberOfPagesBeforeDownload *
_model.supplier.productQuery.pageSize) {
_downloadNextPage();
}
}
if (index >=
_model.displayBarcodes.length +
numberOfDownloadingPages *
_model.supplier.productQuery.pageSize) {
return const SmoothProductCardTemplate(
message: 'Will be loaded later',
);
}
if (index >= _model.displayBarcodes.length) {
return SmoothProductCardTemplate(
message: _loadingNext ? 'Loading...' : 'Could not load',
);
} |
Looks great, I'd prefer a animation but a yeah would be good to have. |
@M123-dev Now the code is merged - without the latest suggested changes. |
Impacted file:
Podfile.lock
: wtf (ios:pod update Sentry
)product_query_page.dart
What
ListView
Screenshot
Fixes bug(s)