-
-
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: Extract ingredients/packaging: loading / loaded / extracting states #5384
feat: Extract ingredients/packaging: loading / loaded / extracting states #5384
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5384 +/- ##
==========================================
- Coverage 9.54% 7.32% -2.23%
==========================================
Files 325 386 +61
Lines 16411 19847 +3436
==========================================
- Hits 1567 1454 -113
- Misses 14844 18393 +3549 ☔ View full report in Codecov by Sentry. |
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.
Hi @g123k!
LGTM, and this page did need some action!
Regarding the code, there are a couple of issues that bother me: changing translation tags, and not catching an exception.
The others are minor comments, feel free to ignore them.
@@ -1448,18 +1448,34 @@ | |||
"completed_basic_details_btn_text": "Complete basic details", | |||
"not_implemented_snackbar_text": "Not implemented yet", | |||
"category_picker_page_appbar_text": "Categories", | |||
"edit_ingredients_extrait_ingredients_btn_text": "Extract ingredients", | |||
"@edit_ingredients_extrait_ingredients_btn_text": { | |||
"edit_ingredients_extract_ingredients_btn_text": "Extract ingredients from the photo", |
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'm really not convinced it's such a brillant idea to change translation tags, as I fear it wipes out all the previous translations. For a very limited added-value: fixing an invisible useless typo.
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, it's now merged :/
@teleomon Is-it somehow possible to move an old translation to a new one?
OcrState _extractState(TransientFile transientFile) { | ||
if (_extractingData) { | ||
return OcrState.EXTRACTING_DATA; | ||
} else if (transientFile.isServerImage()) { | ||
return OcrState.IMAGE_LOADED; | ||
} else if (transientFile.isImageAvailable()) { | ||
return OcrState.IMAGE_LOADING; | ||
} else { | ||
return OcrState.OTHER; | ||
} | ||
} | ||
} |
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.
Looks brillant!
const CircularProgressIndicator.adaptive(), | ||
Expanded( | ||
child: Text( | ||
helper.getActionExtractingData(appLocalizations), | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
const CircularProgressIndicator.adaptive(), |
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.
2 progress indicators? A bit too much, isn't it?
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.
You can see it, on the video, with the Shimmer effect, actually it's OK.
To be honest, I've not checked on Android and in that case, I will remove the first one on non-Apple devices
), | ||
const Icon( | ||
Icons.download, | ||
semanticLabel: '', |
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.
Is that worth it?
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.
Yes, otherwise, the screen reader tries to say the character in font (that's the default behavior)
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.
Yes, otherwise, the screen reader tries to say the character in font (that's the default behavior)
Hmm, I guess that wouldn't hurt to say "download".
If I've understood well, that also means that we're supposed to give each Icon
we use in the app that meaningless semanticLabel: ''
parameter, which is not nice.
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.
That's not needed, because we have the text just before.
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 know it's your way of coding, putting several classes in the same file, and my way of coding is rather one class per file.
Beyond those differences, you may consider that 600 lines of code is a bit too much for a single file, and create additional files, e.g. one per button.
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, I will move _EditOcrMainAction
in a separate file, but sub widgets are just a way to prevent of giant Widget
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'm ok with subwidgets, I just don't like big files - and giant widgets ;)
} catch (e) { | ||
// | ||
} | ||
} catch (_) {} |
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 you're not resetting _extractingData
to false
when there's an exception in getExtractedText
?
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.
Nice catch 😆
I will fix that
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.
Hi everyone,
Extract ingredients and packaging share the same screen.
However, there are two issues:
I've made things clearer, that you can see in this video:
Untitled.mov