Page MenuHomePhabricator

[Cashtab] Show notifications for price milestones
ClosedPublic

Authored by bytesofman on Apr 5 2024, 22:26.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABCd35c09a50a93: [Cashtab] Show notifications for price milestones
Summary

Show a notification if we hit a new "tens" place in price, e.g. price goes from sixty-something per 1,000,000 XEC to seventy-something per 1,000,000 XEC

Show a special zero killed notification if price goes over $100 per 1,000,000 XEC

Do not show notifications unless currency is at a similar-ish price basis to USD.

Test Plan

npm test

Diff Detail

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

Event Timeline

Failed tests logs:

====== CashTab Unit Tests: <App /> We see a price notification if new price is at a new tens level in USD per 1,000,000 XEC ======
TestingLibraryElementError: Unable to find an element with the text: XEC is now $0.0000071 USD}. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="ant-spin-nested-loading css-dev-only-do-not-override-1rqnfsa"
    >
      <div>
        <div
          aria-busy="true"
          aria-live="polite"
          class="ant-spin ant-spin-spinning css-dev-only-do-not-override-1rqnfsa"
        >
          <span
            aria-label="loading"
            class="anticon anticon-loading anticon-spin cashLoadingIcon ant-spin-dot"
            role="img"
          >
            <svg
              aria-hidden="true"
              data-icon="loading"
              fill="currentColor"
              focusable="false"
              height="1em"
              viewBox="0 0 1024 1024"
              width="1em"
            >
              <path
                d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"
              />
            </svg>
          </span>
        </div>
      </div>
      <div
        class="ant-spin-container ant-spin-blur"
      >
        <div
          class="sc-cjHlYL csXHjT"
        >
          <div
            class="Toastify"
          />
          <div
            class="sc-eLdqWK FSffr"
          >
            <div
              class="sc-hgRTRy hfJVJn"
            >
              <div
                class="sc-kEYyzF gXcBPd"
                data-testid="loading-ctn"
              />
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</body>
    at Object.getElementError (/work/cashtab/node_modules/@testing-library/dom/dist/config.js:37:19)
    at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:76:38
    at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:52:17
    at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:95:19
    at Object.getByText (/work/cashtab/src/components/App/__tests__/App.test.js:1292:20)

Each failure log is accessible here:
CashTab Unit Tests: <App /> We see a price notification if new price is at a new tens level in USD per 1,000,000 XEC

add integration test and remove debug logs

add integration test to confirm notifications are only shown for dollar-ish currencies

bytesofman published this revision for review.Apr 6 2024, 03:58
bytesofman edited the summary of this revision. (Show Details)
emack requested changes to this revision.Apr 6 2024, 07:41
emack added a subscriber: emack.

The issue I can see with this feature is the process of killing a zero is never a one off event. You could have the scenario where we go months on end where the price is constantly killing and reviving a zero, which would result in wallets being inundated with these alerts. One mitigation would be to introduce this with a toggle in General Settings, so users who don't mind frequent alerts can explicitly switch it on. And if they get sick of it then have the option of disabling it.

Also if you're introducing a price-related alert then it would make sense to have a price chart widget somewhere in the app to support user retention.

This revision now requires changes to proceed.Apr 6 2024, 07:41

The issue I can see with this feature is the process of killing a zero is never a one off event. You could have the scenario where we go months on end where the price is constantly killing and reviving a zero, which would result in wallets being inundated with these alerts. One mitigation would be to introduce this with a toggle in General Settings, so users who don't mind frequent alerts can explicitly switch it on. And if they get sick of it then have the option of disabling it.

At some point we need to be opinionated about what Cashtab UX is like. We can add a switch later for "price notifications" on or off if we get some user feedback. I want to avoid complicating the app based on hypothetical user preferences.

The notifications only happen if the price went up (or went up again). So -- yes, a zero may be slayed many times. But we avoid the (heretical) notifications of "price is now less"

Also if you're introducing a price-related alert then it would make sense to have a price chart widget somewhere in the app to support user retention.

Mb but imo there is not a great place for this. We will never have "the best" price chart and this is not really what Cashtab is designed to do. At any rate, not related to this diff.

This revision is now accepted and ready to land.Apr 6 2024, 21:06