Page MenuHomePhabricator

[Cashtab] Improve handling of URL populated txs
ClosedPublic

Authored by bytesofman on Jan 12 2024, 07:00.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABC07b93589aa12: [Cashtab] Improve handling of URL populated txs
Summary

Improve extension behavior by updating the txInfoFromUrl case

Cashtab is able to pre-populate the SendXec screen with a transaction by the use of limited URL params. The format, for now, is slightly different compared with bip21. I plan to add bip21 string in URL support in a later diff, in a way that preserves backward compatibility.

This param in URL approach is how a webapp is able to pass transaction information to the extension. Based on user feedback from users of ecash.land, there are some high impact improvements available to improve the user experience. These are implemented in this diff.

If a Cashtab window has valid tx params in the URL that populate a valid tx,

  1. Close the window after the tx is complete.
  2. Disable multi-send as this is not currently supported by URL params or bip21
  3. Disable input fields (address and amount. For now, the Cashtab Msg field is not disabled as app-set opreturns are not yet supported).
  4. Remove forced modal confirmation (so, the modal is a user setting). Instead of forcing a confirmation modal, make sure the tx values are clearly displayed.
Test Plan

npm test

npm run extension

Make some transactions at ecash.land.

  • Confirm the 'Multiple Recipients' switch is not visible.
  • Confirm window closes on completion
  • Confirm no send confirmation modal unless enabled in Settings
  • Confirm input is disabled in windows opened by the webapp.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

close window after this type of tx completes

Apply utxo refresh and close-after-success methods, lock inputs if tx is from url params

backout chronik-client changes

back out unrelated package lock changes (from local module testing)

bytesofman edited the test plan for this revision. (Show Details)
bytesofman edited the summary of this revision. (Show Details)
bytesofman edited the test plan for this revision. (Show Details)

Add 'App Transaction' label

bytesofman published this revision for review.EditedJan 13 2024, 20:51

this diff at left, existing at right

image.png (646×949 px, 69 KB)

There are further style improvements available but I think this is outside the scope of this diff. Here, I just want there to be some sort of alert, since we are removing the forced modal.

  • New color for text in disabled input fields
  • Maybe entirely hide the disabled input fields and replace with a different tx summary

Other improvements

  • Get URL of requesting website and add to alert

clarify notice, 'app tx' is meaningless

This revision is now accepted and ready to land.Jan 14 2024, 04:55