Skip to content
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

Barcode scanner #1834

Merged
merged 37 commits into from
Dec 26, 2024
Merged

Barcode scanner #1834

merged 37 commits into from
Dec 26, 2024

Conversation

r0xsh
Copy link
Member

@r0xsh r0xsh commented Jul 12, 2024

@r0xsh r0xsh marked this pull request as draft July 12, 2024 22:23
@Atala Atala self-requested a review September 9, 2024 16:25
@Atala Atala marked this pull request as ready for review September 19, 2024 14:02
@r0xsh r0xsh linked an issue Nov 8, 2024 that may be closed by this pull request
@r0xsh r0xsh marked this pull request as draft November 12, 2024 17:34
@Atala Atala removed their request for review November 12, 2024 17:39
Copy link
Member

@Atala Atala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested:

  • scan an assigned task -> pop up shows unassign/ok
    if i click unassign then it unassigns but I am not redirected back to the "My tasks" screen
    if i click OK then nothing happens, the popup close and no information shows up in task field, i am stuck on the empty barcode screen + barcode scanning does not seem to work a second time

scanning an unassigned task -> it assigns directly to me without a popup opening, is that normal?

scanning a task assigned to another rider -> pop up opens and i can assign it to myself

so all in all here are the problems :

  • what does the "ok" button means to the user in the various popups? it is more a yes/no question no? so it should be a "NO" button
  • when clicking on "ok" nothing shows, nothing happens (and i think you can not scan anymore)
  • after clicking unassign/assign/assign to me then you should be redirected to the tasklist or to the map (the page you were originally on)
  • how one is supposed to complete a task? when i scan a task that is assigned to me then i can only unassign, not complete. also in the UI/UX when the task is assigned to me, complete the task should be the main choice

if (!hasPermission) {
return (
<View>
<Text>No camera permission</Text>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe write a more helpful message? like "Allow camera in app setting to use the barcode scanner"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if i click unassign then it unassigns but I am not redirected back to the "My tasks" screen

Yup this is intentional behavior, but this feature is hard to design since it can be used is many scenarios. But i think is can be solve by having a "batch scanning mode".
The feature was originally thought for doing batch scan at morning when the rider prepares his route. But you're right this create some friction in a rider workflow.

if i click OK then nothing happens, the popup close and no information shows up in task field, i am stuck on the empty barcode screen + barcode scanning does not seem to work a second time

Just go back, no ?

scanning an unassigned task -> it assigns directly to me without a popup opening, is that normal?

Yup expected behavior, the alert is shown only when the task is already assigned to self or another rider.

what does the "ok" button means to the user in the various popups? it is more a yes/no question no? so it should be a "NO" button

It just close the modal, maybe No label will be clearer 👍

when clicking on "ok" nothing shows, nothing happens (and i think you can not scan anymore)

You can't scan twice the same barcode ? But i agree this is a bit annoying. I already thought about a potential fix for that: https://github.com/coopcycle/coopcycle-app/pull/1834/files#diff-044fc4e1bab6b1c678131dde9f7719a282973acbf04d245c16c2fd26cb335d8aR248-R254

how one is supposed to complete a task? when i scan a task that is assigned to me then i can only unassign, not complete. also in the UI/UX when the task is assigned to me, complete the task should be the main choice

The task should be in DOING status to trigger the complete behavior

@Atala
Copy link
Member

Atala commented Nov 28, 2024

in the new "task complete UI"

  • I think the phone label to call directly should be next to the phone number on its right (also more easily reachable by right hand thumb there)
  • how one can mark task as "DONE" without incident?

@Atala
Copy link
Member

Atala commented Nov 28, 2024

(check yarn lint errors)

The notifications are not removed, they are stacked into a queue then displayed when the `state.app.shouldNotificationBeDisplayed` is set back to `true`
@r0xsh
Copy link
Member Author

r0xsh commented Dec 4, 2024

Fix this navigator error

WARN Found screens with the same name nested inside one another. Check:
CourierNav > CourierBarcode, CourierNav > CourierBarcode > CourierBarcode

@Atala
Copy link
Member

Atala commented Dec 5, 2024

  • on the scan page, show task packages list (so you can see quickly if you have all the needed packages) + highlight the package that was just scanned
  • add the possibility to scan again (maybe action button?), as someone would like to assign himself several deliveries in a row
  • change the "add a note" button color to not grey (looks disabled)
  • (backend problem) : it stills assign in the wrong order :
    image
  • add action "start task" when scanning an already assigned drop (and force-finish the pickup at the same time ?)

to elaborate on the last comment, I still think there is a UI/UX issue as you can only scan drops but you need to validate pickups as well, for example when you prepare your tour at the warehouse. so on top of my head there are two ways to do that :

  • silently validate the pickup when you assign yourself the task (it means that the package is in your hands so you have done the pickup (!))
  • when scanning, allow to explictly validate the pickup

good job nevertheless !! go get 'em

@r0xsh
Copy link
Member Author

r0xsh commented Dec 6, 2024

on the scan page, show task packages list (so you can see quickly if you have all the needed packages) + highlight the package that was just scanned

Maybe a bit tricky to add, like this is not a small feature

add the possibility to scan again (maybe action button?), as someone would like to assign himself several deliveries in a row

That would work, it only prevent to scan the same barcode twice

@Atala
Copy link
Member

Atala commented Dec 11, 2024

ah you dont have the task serialized so you can display the packages list ? it should come with the task no?

@r0xsh
Copy link
Member Author

r0xsh commented Dec 12, 2024

ah you don't have the task serialized so you can display the packages list ? it should come with the task no?

The show part can be done since, I've the packages serialized into the reply. The tricky part is to show which packages has been scanned. Like how it should be handled in the app state + the ui/ux part seems also a bit tricky

@Atala
Copy link
Member

Atala commented Dec 12, 2024

ah ok
maybe just show the packages list then, and i can create an issue ?

@r0xsh
Copy link
Member Author

r0xsh commented Dec 12, 2024

I've decided to release the barcode functionality without implementing pickup validation during dropoff scanning. There are two main reasons for this:

  1. It falls outside the original scope of this feature
  2. The implementation has become overly complex in the web interface. Adding this to the mobile app would be even more complicated since we'd need to handle attachments (notes, signatures, proof of delivery) and our current app state architecture isn't well-suited for this new behavior.

coopcycle/coopcycle-web#4784 (comment)

@r0xsh
Copy link
Member Author

r0xsh commented Dec 12, 2024

maybe just show the packages list then, and i can create an issue ?

This is more or less the case, it's handled by a modal, but maybe it worth moving this out of the modal and display it in the view instead

@r0xsh r0xsh merged commit 60cc013 into master Dec 26, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate barcodes in the app
2 participants