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

feat: Add logic for new requireScroll prop for Snap Footer component #29863

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hmalik88
Copy link
Contributor

@hmalik88 hmalik88 commented Jan 22, 2025

Description

Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions:

  1. What is the reason for the change? A new prop was added: requireScroll.
  2. What is the improvement/solution? Snap devs can now optionally include the requireScroll prop in their footers. The prop ensures that the footer buttons are disabled until the snap ui content has been viewed. This prop also means that a scroll arrow is also passed along to the template renderer based on the isScrolledToBottom prop.

Related issues

Fixes: MetaMask/snaps#3021

Manual testing steps

  1. Go to https://github.com/hmalik88/swiss-knife-snap and pull down the repo.
  2. Install the snap and click "Trigger long content"
  3. Observe that a scroll arrow appears and that the footer is disabled until content is scrolled.

Screenshots/Recordings

After

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.

Copy link
Contributor

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.

@metamaskbot metamaskbot added the team-snaps-platform Snaps Platform team label Jan 22, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [fb1ef7c]
Page Load Metrics (1814 ± 116 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint27622621720409196
domContentLoaded136722351789242116
load143722621814242116
domInteractive246738126
backgroundConnect676242210
firstReactRender1579332210
getState4106192512
initialActions0492115
loadScripts9901733132520398
setupStore65819209
uiStartup163526862089308148
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 999 Bytes (0.01%)
  • common: 0 Bytes (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-snaps-platform Snaps Platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add prop & logic to disable footer actions until the entire content is viewed
2 participants