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

Add hold to confirm functionality in action that need confirmation #822

Merged
merged 9 commits into from Apr 11, 2024

Conversation

JoaoMario109
Copy link
Contributor

Closes #762

@JoaoMario109
Copy link
Contributor Author

This issue will be good to be solved prior to finishing this PR, it will allow to use the same component from slide to confirm.

j2only/slide-unlock#37

@patrickelectric
Copy link
Member

@JoaoMario109 It appears that the new version 0.5.4 adds a position props, please check it out.

@JoaoMario109
Copy link
Contributor Author

The PR containing modification to allow position to call completed was merged

j2only/slide-unlock#38

Right now I'm only keeping this as draft because I need to await the npm release, as soon as the new release is available I'll update the lib and make ready for review

@JoaoMario109 JoaoMario109 marked this pull request as ready for review March 21, 2024 11:38
@JoaoMario109 JoaoMario109 marked this pull request as draft March 22, 2024 13:12
@rafaellehmkuhl
Copy link
Member

The PR containing modification to allow position to call completed was merged

j2only/slide-unlock#38

Right now I'm only keeping this as draft because I need to await the npm release, as soon as the new release is available I'll update the lib and make ready for review

Just checked and the latest version includes it! Nice!

Copy link
Member

@rafaellehmkuhl rafaellehmkuhl left a comment

Choose a reason for hiding this comment

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

Didn't test yet, but the code looks good! The cleanup in mainVehicle.ts is perfect!

@rafaellehmkuhl
Copy link
Member

rafaellehmkuhl commented Apr 5, 2024

@ericjohnson97 I think a quick look from you would also be worth it!

The idea here as basically to:

  1. Not require confirmation from joystick by default
  2. Add the "hold to confirm" functionality but make it opt-in for the user
  3. Make the arm/disarm/takeoff/land functions pure, and delegate to those who want to use the "slide to confirm" functionality (e.g.: screen widgets) the responsibility of adding it before the actual action call

@rafaellehmkuhl rafaellehmkuhl self-requested a review April 5, 2024 12:51
Copy link
Member

@rafaellehmkuhl rafaellehmkuhl left a comment

Choose a reason for hiding this comment

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

After testing, I have found some bugs:

  1. The ArmerButton is not working (after you slide, nothing happens)
  2. The HoldToConfirm button is not working (I've mapped it to my joystick, but holding it do nothing)

Some improvements that I think would come very handy for the user:

  1. A popup/alert/something telling the user that they need to map the HoldToConfirm button after ticking the "require confirmation" checkbox for some action (this one you mentioned already that was going to be added, so I'm adding here just for remembering purposed)
  2. There should be some visual feedback while the user is holding the confirm button. From the code, this appears to be the case already. I'm adding here because I didn't receive it, but it's probably related to the HoldToConfirm button not being working at all
  3. There's no timeout on the slider, which causes it to be there indefinitely if the user decides not to confirm it
  4. There's no timeout on the slider reject alert, which causes it to be there indefinitely until the user clicks outside it with the mouse, breaking the purpose of the HoldToConfirm functionality

* Add hold to confirm action in cockpit action protocol
* Add a enable/disable hold to confirm option in mission store to allow
  users to control this functionality
@JoaoMario109 JoaoMario109 force-pushed the 762-hold-to-confirm branch 2 times, most recently from 07935e5 to a93dd6e Compare April 11, 2024 12:25
* Add hold to confirm action to map action from controller to percentage
  of complete confirm action
* Remove slide to confirm from store and move it to the outside UI
  elements that use it, with this, th confirmation can be segregated by
  UI and controller actions
* Add confirmation per cockpit joystick action, so users can choose if
  they want confimation when certains actions are mapped in joystick
* Add extra tooltips where hold to confirm or any extra confirmation
  step can be required explained to the user where it will affect.
* Add default text fields generation to avoid needing repetitive texts
  on calls
* Add a default 5 seconds timeout on slide to confirm, so if user does
  not confirm in this interval will be auto denied
* Adjust tooltip location on require confirmation info tooltip
@JoaoMario109 JoaoMario109 marked this pull request as ready for review April 11, 2024 13:56
Copy link
Member

@rafaellehmkuhl rafaellehmkuhl left a comment

Choose a reason for hiding this comment

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

The code looks very good and all the bugs I had with the draft version are now fixed!
Nice addition Lago!

@rafaellehmkuhl rafaellehmkuhl merged commit 5237e3d into bluerobotics:master Apr 11, 2024
8 checks passed
@ES-Alexander ES-Alexander added the docs-needed Change needs to be documented label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-needed Change needs to be documented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "hold-to-confirm" so we can have security checks on the joystick
4 participants