bigcommerce / catalyst

Catalyst - for Composable Commerce
https://catalyst-demo.site
MIT License
90 stars 59 forks source link

fix(core): improve redirect behavior after creating account #1088

Open bc-yevhenii-buliuk opened 1 month ago

bc-yevhenii-buliuk commented 1 month ago

What/Why?

This PR improves redirect behavior after creating account, namely, it adds a banner about the successful creation of an account.

Testing

locally

before:

https://github.com/user-attachments/assets/12aaf09a-fc0c-44f3-b69e-d1e93be43131

after:

https://github.com/user-attachments/assets/7ff7469d-44b1-431c-978e-f4279fff2221

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
catalyst-latest ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2024 2:17pm
8 Skipped Deployments | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **catalyst** | ⬜️ Ignored ([Inspect](https://vercel.com/bigcommerce-platform/catalyst/2ZeitezAEo4v81XX4bkBYsDXfDx7)) | | | Aug 28, 2024 2:17pm | | **catalyst-1millionproducts-store** | ⬜️ Ignored ([Inspect](https://vercel.com/bigcommerce-platform/catalyst-1millionproducts-store/9ufNcq5SGFu2fmmRixRfrRYZJ9xn)) | [Visit Preview](https://catalyst-1millionproducts-store-git-d24242-bigcommerce-platform.vercel.app) | | Aug 28, 2024 2:17pm | | **catalyst-au** | ⬜️ Ignored ([Inspect](https://vercel.com/bigcommerce-platform/catalyst-au/9CE4a1S5FtYziRZHPGUZZvHWwnni)) | [Visit Preview](https://catalyst-au-git-fix-create-account-ce8bd5-bigcommerce-platform.vercel.app) | | Aug 28, 2024 2:17pm | | **catalyst-integration-customer-access-token** | ⬜️ Ignored ([Inspect](https://vercel.com/bigcommerce-platform/catalyst-integration-customer-access-token/DtmWpNnNz9GF9EZrCSR1NPAzhuDP)) | [Visit Preview](https://catalyst-integration-customer-a-git-1b5daf-bigcommerce-platform.vercel.app) | | Aug 28, 2024 2:17pm | | **catalyst-staging** | ⬜️ Ignored ([Inspect](https://vercel.com/bigcommerce-platform/catalyst-staging/GmQkCucHAcaEFKWg3pDzfeb2zQ1m)) | [Visit Preview](https://catalyst-staging-git-fix-create-acc-34b8d2-bigcommerce-platform.vercel.app) | | Aug 28, 2024 2:17pm | | **catalyst-test-store** | ⬜️ Ignored ([Inspect](https://vercel.com/bigcommerce-platform/catalyst-test-store/Gx3qzcZeUbWQUBDYgTWJrEcKDvTd)) | [Visit Preview](https://catalyst-test-store-git-fix-create-dbff42-bigcommerce-platform.vercel.app) | | Aug 28, 2024 2:17pm | | **catalyst-uk** | ⬜️ Ignored ([Inspect](https://vercel.com/bigcommerce-platform/catalyst-uk/93s5gq37riNV58Fc8oSuEHRgtHNA)) | [Visit Preview](https://catalyst-uk-git-fix-create-account-60210d-bigcommerce-platform.vercel.app) | | Aug 28, 2024 2:17pm | | **catalyst-unstable** | ⬜️ Ignored ([Inspect](https://vercel.com/bigcommerce-platform/catalyst-unstable/7Vb73TcFQ264J4HsEeDvj9Y9T4My)) | [Visit Preview](https://catalyst-unstable-git-fix-create-ac-445b00-bigcommerce-platform.vercel.app) | | Aug 28, 2024 2:17pm |
changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: d52081d505c88cec2262e5c3ee1e78689d8f8700

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | -------------------------- | ----- | | @bigcommerce/catalyst-core | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

bc-yevhenii-buliuk commented 1 month ago

This PR implements appearance of success banner by adding a search parameter to the URL. Thanks to this parameter we can control banner appearance.

Another possible solution to implement was to use the context and change its status to "success" after redirecting to the account page, but due to reloading the browser after the redirect, the context returns to its initial state with an "idle" status, which does not allow the banner to be displayed.

Open to suggestions, thanks!

jorgemoya commented 1 week ago

Hey @bc-yevhenii-buliuk, do you think you can rebase and merge this if test pass? 🙏

bc-yevhenii-buliuk commented 1 week ago

Hey @bc-yevhenii-buliuk, do you think you can rebase and merge this if test pass? 🙏

@jorgemoya yes, sure! I'm making final edits after testing this PR and plan to merge it soon.

github-actions[bot] commented 2 days ago

⚡️🏠 Lighthouse report

Lighthouse ran against https://catalyst-latest-ignke6rfq-bigcommerce-platform.vercel.app

🖥️ Desktop

We ran Lighthouse against the changes on a desktop and produced this report. Here's the summary:

Category Score
🟠 Performance 89
🟢 Accessibility 100
🟢 Best practices 96
🟠 SEO 82

📱 Mobile

We ran Lighthouse against the changes on a mobile and produced this report. Here's the summary:

Category Score
🟢 Performance 100
🟢 Accessibility 100
🟢 Best practices 96
🟠 SEO 85