-
-
Notifications
You must be signed in to change notification settings - Fork 671
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
Refactor Scan Page #6884
base: master
Are you sure you want to change the base?
Refactor Scan Page #6884
Conversation
…. Create fixed aspect ratio container for camera scanner. Fix route to scan page.
…ow, as it does automatic lookups.
✅ Deploy Preview for inventree-web-pui-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
tracks towards: #5748 |
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 see multiple problems in a quick test:
- Constant errors that no QR code was found making notifications unusable
- Unknown codes are just disregarded - and do not show up in history; this is a blocking bug
Hmm, I encountered this at one point and thought the string comparison would suffice, but probably need to revert to just dump the errors to console instead of the pop-up notification. I was hoping to pass meaningful errors up to the user, but if it results in an error notification on every frame, that's bad.
What is the intended behavior for scanning invalid QR codes? Just showing the raw QR code string value in the history? Does showing invalid data in the history provide meaningful information to the user? Or would a popup notification with an error message and the QR code string also provide sufficient feedback to the user? |
This PR seems stale. Please react to show this is still important. |
Refactors Scan Page into more discrete components. The components on the page are still fairly tightly coupled, but separating into separate component files makes the separation of functions clearer and improves maintainability of each individual aspect.
Along with the refactor, I also included a few improvements of existing functions. I have changed some synchronous functions into Async/Await promises that are no longer blocking. I've also added some new UX features to communicate to the user what the current state is for the camera (stopped vs. loading vs. scanning).
This also improves the UX of the scanning with camera feature by preventing the dom element from resizing when the camera starts/stops.
Barcodes are now automatically searched upon successful scan.
I have more planned for this page, but felt the current state of this PR is at a good state to push upstream while I work on new features.
Example Functionality: