User story / Problem statement
Currently, ConnectButton cancels the connect when clicked while it reads "Connecting…". A double-click on Connect therefore connects and cancels itself, and a button whose label says one thing and whose click does another is a trap. Raised in this review comment on #142.
Expected outcome
ConnectButton only connects and is inert while pending, as before #142. A new CancelConnectButton only cancels and is inert when nothing is connecting. A double-click on either does nothing past the first click. The prompt in dapp/frontend shows the cancel button beside the connect button instead of the "(click to cancel)" hint.
Acceptance criteria
Alternatives considered
- Ignore multi-clicks with
event.detail > 1 in composeAction: one line, but one button keeps doing two things
- Arm the cancel after a delay: timing-based and surprising
Technical notes
Keep both buttons mounted and in place while connecting: if the connect button takes the cancel button's spot, the second click of a double-click starts a new connect.
User story / Problem statement
Currently,
ConnectButtoncancels the connect when clicked while it reads "Connecting…". A double-click on Connect therefore connects and cancels itself, and a button whose label says one thing and whose click does another is a trap. Raised in this review comment on #142.Expected outcome
ConnectButtononly connects and is inert while pending, as before #142. A newCancelConnectButtononly cancels and is inert when nothing is connecting. A double-click on either does nothing past the first click. The prompt indapp/frontendshows the cancel button beside the connect button instead of the "(click to cancel)" hint.Acceptance criteria
ConnectButtonis inert while pending, with the disabled look back incanton-themeCancelConnectButtonships on the/connectsub-path with anatomy, theme rules, tests and docsCancelConnectButtonis inert (aria-disabled) when nothing is connectingConnectPromptrenders both buttons and drops the hintAlternatives considered
event.detail > 1incomposeAction: one line, but one button keeps doing two thingsTechnical notes
Keep both buttons mounted and in place while connecting: if the connect button takes the cancel button's spot, the second click of a double-click starts a new connect.