Skip to content

Conversation

@Daniel-Cross
Copy link
Contributor

@Daniel-Cross Daniel-Cross commented May 6, 2025

Description

small fix to address the default size of the skeleton component when no value is provided by the snap

Related issues

Fixes: #14838

Manual testing steps

  1. Create a test example of a skeleton loader via the snaps monorepo
  2. Use the following code
import type { OnRpcRequestHandler } from '@metamask/snaps-sdk';
import { Box, Text, Skeleton, Section } from '@metamask/snaps-sdk/jsx';

/**
 * Handle incoming JSON-RPC requests, sent through `wallet_invokeSnap`.
 *
 * @param args - The request handler args as object.
 * @param args.origin - The origin of the request, e.g., the website that
 * invoked the snap.
 * @param args.request - A validated JSON-RPC request object.
 * @returns The result of `snap_dialog`.
 * @throws If the request method is not valid for this snap.
 */
export const onRpcRequest: OnRpcRequestHandler = async ({
  origin,
  request,
}) => {
  switch (request.method) {
    case 'hello':
      return snap.request({
        method: 'snap_dialog',
        params: {
          type: 'confirmation',
          content: (
            <Box>
              <Skeleton />
              <Section>
                <Box alignment="space-between" direction="horizontal">
                  <Text fontWeight="medium" color="alternative">
                    Network Fee
                  </Text>
                  <Box direction="horizontal" alignment="center">
                    <Skeleton />
                    <Text>SOL</Text>
                  </Box>
                </Box>
              </Section>
            </Box>
          ),
        },
      });
    default:
      throw new Error('Method not found.');
  }
};

Screenshots/Recordings

Before

After

Simulator Screenshot - iPhone 16 Pro - 2025-05-06 at 14 37 10

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@Daniel-Cross Daniel-Cross self-assigned this May 6, 2025
@Daniel-Cross Daniel-Cross requested a review from a team as a code owner May 6, 2025 16:14
@Daniel-Cross Daniel-Cross added No QA Needed Apply this label when your PR does not need any QA effort. needs-smoke-e2e labels May 6, 2025
@Daniel-Cross Daniel-Cross linked an issue May 6, 2025 that may be closed by this pull request
@Daniel-Cross Daniel-Cross added team-snaps-platform-deprecated DEPRECATED: please use "team-core-platform" instead (or "team-new-networks" for Solana snap issues) no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels May 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2025

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 7, 2025

@Daniel-Cross Daniel-Cross enabled auto-merge May 7, 2025 09:46
@Daniel-Cross Daniel-Cross added this pull request to the merge queue May 7, 2025
Merged via the queue into main with commit ba60302 May 7, 2025
40 checks passed
@Daniel-Cross Daniel-Cross deleted the 14838-bug-skeleton-loader-on-confirmation-screen-overflowing branch May 7, 2025 10:08
@github-actions github-actions bot locked and limited conversation to collaborators May 7, 2025
@metamaskbot metamaskbot added the release-7.47.0 Issue or pull request that will be included in release 7.47.0 label May 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

No QA Needed Apply this label when your PR does not need any QA effort. no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.47.0 Issue or pull request that will be included in release 7.47.0 team-mobile-platform Mobile Platform team team-snaps-platform-deprecated DEPRECATED: please use "team-core-platform" instead (or "team-new-networks" for Solana snap issues)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Skeleton loader on confirmation screen overflowing

4 participants