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

Fix: Safe Apps loading state #1674

Merged
merged 7 commits into from
Feb 17, 2023
Merged

Fix: Safe Apps loading state #1674

merged 7 commits into from
Feb 17, 2023

Conversation

katspaugh
Copy link
Member

@katspaugh katspaugh commented Feb 16, 2023

What it solves

Resolves #1671

How this PR fixes it

I've created a separate route for individual Safe Apps: /apps/open?appUrl=....
The Safe Apps list will remain on /apps.

This makes it easier to pre-render the route in an efficient way, and show placeholder skeletons.

How to test it

Go to apps, open an app, reload the page.
Test custom apps.

@github-actions
Copy link

github-actions bot commented Feb 16, 2023

Branch preview

✅ Deploy successful!

https://skeletons--webcore.review-web-core.5afe.dev

@github-actions
Copy link

github-actions bot commented Feb 16, 2023

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link
Member

@DiogoSoaress DiogoSoaress left a comment

Choose a reason for hiding this comment

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

Tested and looks good. Only thing I 'd suggest to adjust is this skeleton in the NftGrid to match the checkbox width

src/pages/balances/nfts.tsx Outdated Show resolved Hide resolved
Copy link
Member

@DiogoSoaress DiogoSoaress left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Member

@iamacook iamacook left a comment

Choose a reason for hiding this comment

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

Looks good to me but I think we should consider adjusting the placeholder of the NFT page. There's no table when the Safe has no NFTs.

nft skeleton

We keep the table when all tokens are hidden:

asset skeleton

src/pages/apps/index.tsx Outdated Show resolved Hide resolved
@@ -21,8 +21,8 @@ import { getOrigin } from '@/components/safe-apps/utils'
const SafeApps: NextPage = () => {
const chainId = useChainId()
const router = useRouter()

const [appUrl, routerReady] = useSafeAppUrl()
Copy link
Member

Choose a reason for hiding this comment

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

Co-authored-by: Aaron Cook <aaron@safe.global>
@katspaugh
Copy link
Member Author

Looks good to me but I think we should consider adjusting the placeholder of the NFT page. There's no table when the Safe has no NFTs.

That's why I originally had a circular loader there but now we optimize for the happy path, i.e. when you do have NFTs. One can argue that if a person deliberately visits that page, they likely have NFTs.

@katspaugh
Copy link
Member Author

Reg. showing an empty assets table, it probably was a bad idea to allow hiding the native token (I insisted on it), but it's an edge case.

@katspaugh
Copy link
Member Author

katspaugh commented Feb 16, 2023

I accidentally merged this branch to dev prior to the last two commits. So I'll merge the rest as well, it fixes the e2e tests.

@katspaugh katspaugh force-pushed the skeletons branch 11 times, most recently from d02980d to 98d06e6 Compare February 17, 2023 08:37
@katspaugh katspaugh changed the title Fix: skeleton loaders Fix: Safe Apps loading state Feb 17, 2023
Custom app test

Create a separate route for individual apps

Tests
@katspaugh katspaugh merged commit 007f5d7 into dev Feb 17, 2023
@katspaugh katspaugh deleted the skeletons branch February 17, 2023 11:48
@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Skeleton loaders around Safe
3 participants