Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/add-team-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ on:

jobs:
add-team-label:
name: Add team label
if: ${{ !github.event.pull_request.head.repo.fork }}
uses: metamask/github-tools/.github/workflows/add-team-label.yml@7fe185fdb0e60981c898e88d82e44ff33f604daa
secrets:
TEAM_LABEL_TOKEN: ${{ secrets.TEAM_LABEL_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: Add team label
uses: MetaMask/github-tools/.github/actions/add-team-label@v1
with:
team-label-token: ${{ secrets.TEAM_LABEL_TOKEN }}
17 changes: 11 additions & 6 deletions .github/workflows/automated-rca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ permissions:

jobs:
automated-rca:
uses: MetaMask/github-tools/.github/workflows/post-gh-rca.yml@5da154078ddf6c022ed89dc3dbf378594afb8266
with:
repo-owner: ${{ github.repository_owner }}
repo-name: ${{ github.event.repository.name }}
issue-number: ${{ github.event.issue.number }}
issue-labels: '["Sev0-urgent", "Sev1-high"]'
name: Automated RCA
runs-on: ubuntu-latest
steps:
- name: Automated RCA
uses: MetaMask/github-tools/.github/actions/post-gh-rca@v1
with:
repo-owner: ${{ github.repository_owner }}
repo-name: ${{ github.event.repository.name }}
issue-number: ${{ github.event.issue.number }}
issue-labels: '["Sev0-urgent", "Sev1-high"]'
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/build-android-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
echo "✅ System images installed"

- name: Setup Android Build Environment
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@6742ebe1a3541cb13972d65352a0622a6a6677db
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@v1
with:
platform: android
setup-simulator: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-ios-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:

# Install Node.js, Xcode tools, and other iOS development dependencies
- name: Installing iOS Environment Setup
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@6742ebe1a3541cb13972d65352a0622a6a6677db
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@v1
with:
platform: ios
setup-simulator: false
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/changelog-check.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
name: ChangeLog Check
name: Check Changelog

on:
pull_request:
types: [opened, synchronize, labeled, unlabeled]

jobs:
check-changelog:
name: Check Changelog
runs-on: ubuntu-latest
# Asking engineers to update CHANGELOG.md increases the potential for
# conflicts across all pull requests.
# Disable this workflow until we can refine the new changelog process.
if: false

uses: MetaMask/github-tools/.github/workflows/changelog-check.yml@91e349d177db2c569e03c7aa69d2acb404b62f75
with:
base-branch: ${{ github.event.pull_request.base.ref }}
head-ref: ${{ github.head_ref }}
labels: ${{ toJSON(github.event.pull_request.labels) }}
pr-number: ${{ github.event.pull_request.number }}
repo: ${{ github.repository }}
secrets:
gh-token: ${{ secrets.PR_TOKEN }}
steps:
- name: Check changelog
uses: MetaMask/github-tools/.github/actions/check-changelog@v1
with:
base-branch: ${{ github.event.pull_request.base.ref }}
head-ref: ${{ github.head_ref }}
labels: ${{ toJSON(github.event.pull_request.labels) }}
pr-number: ${{ github.event.pull_request.number }}
repo: ${{ github.repository }}
15 changes: 9 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -576,13 +576,16 @@ jobs:

log-merge-group-failure:
name: Log merge group failure
runs-on: ubuntu-latest
# Only run this job if the merge group event fails, skip on forks
if: ${{ github.event_name == 'merge_group' && failure() && !github.event.repository.fork }}
needs:
- check-all-jobs-pass
uses: metamask/github-tools/.github/workflows/log-merge-group-failure.yml@6bbad335a01fce1a9ec1eabd9515542c225d46c0
secrets:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
SPREADSHEET_ID: ${{ secrets.GOOGLE_MERGE_QUEUE_SPREADSHEET_ID }}
SHEET_NAME: ${{ secrets.GOOGLE_MERGE_QUEUE_SHEET_NAME }}
steps:
- name: Log merge group failure to Google Sheets
uses: MetaMask/github-tools/.github/actions/log-merge-group-failure@v1
with:
google-application-credentials: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
google-service-account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
spreadsheet-id: ${{ secrets.GOOGLE_MERGE_QUEUE_SPREADSHEET_ID }}
sheet-name: ${{ secrets.GOOGLE_MERGE_QUEUE_SHEET_NAME }}
29 changes: 16 additions & 13 deletions .github/workflows/create-release-pr-legacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,24 @@ jobs:
id-token: write

create-release-pr:
name: Create release pull request
runs-on: ubuntu-latest
needs: generate-build-version
uses: MetaMask/github-tools/.github/workflows/create-release-pr.yml@fc6fe1a3fb591f6afa61f0dbbe7698bd50fab9c7
with:
platform: mobile
base-branch: ${{ inputs.base-branch }}
semver-version: ${{ inputs.semver-version }}
previous-version-tag: ${{ inputs.previous-version-tag }}
mobile-build-version: ${{ needs.generate-build-version.outputs.build-version }}
github-tools-version: fc6fe1a3fb591f6afa61f0dbbe7698bd50fab9c7

secrets:
# This token needs read permissions to metamask-planning & write permissions to metamask-mobile
github-token: ${{ secrets.PR_TOKEN }}
google-application-creds-base64: ${{ secrets.GCP_RLS_SHEET_ACCOUNT_BASE64 }}
permissions:
contents: write
pull-requests: write
steps:
- name: Create Release pull request
uses: MetaMask/github-tools/.github/actions/create-release-pr@v1
with:
platform: mobile
checkout-base-branch: ${{ inputs.base-branch }}
release-pr-base-branch: ${{ inputs.base-branch }}
semver-version: ${{ inputs.semver-version }}
previous-version-ref: ${{ inputs.previous-version-tag }}
mobile-build-version: ${{ needs.generate-build-version.outputs.build-version }}
google-application-creds-base64: ${{ secrets.GCP_RLS_SHEET_ACCOUNT_BASE64 }}
# This token needs read permissions to metamask-planning & write
# permissions to metamask-mobile.
github-token: ${{ secrets.PR_TOKEN }}

2 changes: 1 addition & 1 deletion .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
pull-requests: write
steps:
- name: Create Release PR
uses: MetaMask/github-tools/.github/actions/create-release-pr@v1.1.2
uses: MetaMask/github-tools/.github/actions/create-release-pr@v1
with:
platform: mobile
checkout-base-branch: ${{ needs.resolve-bases.outputs.checkout_base }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/merge-stable-sync-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'OWNER'
)
uses: MetaMask/github-tools/.github/workflows/merge-approved-pr.yml@7c0ab4db1e9c1d5673fe7958e8959f1842edbebd
uses: MetaMask/github-tools/.github/workflows/merge-approved-pr.yml@v1
with:
pr-number: ${{ github.event.issue.number }}
# Merge PRs from stable-main-X.Y.Z into main
required-base-branch: 'main'
head-branch-pattern: '^stable-main-[0-9]+\.[0-9]+\.[0-9]+$'
secrets:
github-token: ${{ secrets.METAMASK_MOBILE_BRANCH_SYNC_TOKEN }}
github-token: ${{ secrets.METAMASK_MOBILE_BRANCH_SYNC_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/merge-version-bump-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'OWNER'
)
uses: MetaMask/github-tools/.github/workflows/merge-approved-pr.yml@7c0ab4db1e9c1d5673fe7958e8959f1842edbebd
uses: MetaMask/github-tools/.github/workflows/merge-approved-pr.yml@v1
with:
pr-number: ${{ github.event.issue.number }}
# Merge PRs from version-bump/X.Y.Z into main
required-base-branch: 'main'
head-branch-pattern: '^version-bump/[0-9]+\.[0-9]+\.[0-9]+$'
secrets:
github-token: ${{ secrets.METAMASK_MOBILE_BRANCH_SYNC_TOKEN }}
github-token: ${{ secrets.METAMASK_MOBILE_BRANCH_SYNC_TOKEN }}
21 changes: 12 additions & 9 deletions .github/workflows/publish-slack-release-testing-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ on:

jobs:
call-publish-slack-release-testing-status:
name: Publish Slack release testing status
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
uses: MetaMask/github-tools/.github/workflows/publish-slack-release-testing-status.yml@bce51a03da4736bef72f67b71ca77714a38fc067
with:
platform: 'mobile'
test-only: 'true'
google-document-id: '1tsoodlAlyvEUpkkcNcbZ4PM9HuC9cEM80RZeoVv5OCQ'
secrets:
slack-api-key: ${{ secrets.SLACKBOT_RLS_TOKEN }}
github-token: ${{ secrets.PR_TOKEN }}
google-application-creds-base64: ${{ secrets.GCP_RLS_SHEET_ACCOUNT_BASE64 }}
steps:
- name: Publish Slack release testing status
uses: MetaMask/github-tools/.github/actions/publish-slack-release-testing-status@v1
with:
platform: 'mobile'
test-only: 'true'
google-document-id: '1tsoodlAlyvEUpkkcNcbZ4PM9HuC9cEM80RZeoVv5OCQ'
slack-api-key: ${{ secrets.SLACKBOT_RLS_TOKEN }}
github-token: ${{ secrets.PR_TOKEN }}
google-application-creds-base64: ${{ secrets.GCP_RLS_SHEET_ACCOUNT_BASE64 }}
18 changes: 10 additions & 8 deletions .github/workflows/remove-rca-needed-label-sheets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ permissions:

jobs:
remove-rca-labels:
name: Remove RCA-needed Labels
uses: MetaMask/github-tools/.github/workflows/remove-rca-needed-label-sheets.yml@d354252842b91355deb6d57c752812f745f99679
with:
spreadsheet_id: '1Y16QEnDwZuR3DAQIe3T5LTWy1ye07GNYqxIei_cMg24'
sheet_name: 'Form Responses 1'
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
google-application-creds-base64: ${{ secrets.GCP_RLS_SHEET_ACCOUNT_BASE64 }}
name: Remove RCA-needed labels
runs-on: ubuntu-latest
steps:
- name: Remove RCA-needed labels
uses: MetaMask/github-tools/.github/actions/remove-rca-needed-label-sheets@v1
with:
spreadsheet-id: '1Y16QEnDwZuR3DAQIe3T5LTWy1ye07GNYqxIei_cMg24'
sheet-name: 'Form Responses 1'
github-token: ${{ secrets.GITHUB_TOKEN }}
google-application-creds-base64: ${{ secrets.GCP_RLS_SHEET_ACCOUNT_BASE64 }}
2 changes: 1 addition & 1 deletion .github/workflows/run-e2e-smoke-tests-android-flask.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: yarn setup:github-ci --no-build-ios

- name: Configure Keystore
uses: MetaMask/github-tools/.github/actions/configure-keystore@0259e8a920318b02a8860e178d79796eaa08de02
uses: MetaMask/github-tools/.github/actions/configure-keystore@v1
with:
aws-role-to-assume: ${{ secrets.METAMASK_MOBILE_BUILDER_SIGNER_QA }}
aws-region: us-east-2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-e2e-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
echo "✅ System images installed"

- name: Set up E2E environment
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@6742ebe1a3541cb13972d65352a0622a6a6677db
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@v1
with:
platform: ${{ inputs.platform }}
setup-simulator: ${{ inputs.platform == 'ios' }}
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/stable-branch-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ jobs:

run-stable-sync:
name: Run Stable branch sync
runs-on: ubuntu-latest
needs: get-next-version
uses: metamask/github-tools/.github/workflows/stable-sync.yml@701a894f38883ab48560f948e98b76cc6b4d623f
secrets:
github-token: ${{ secrets.STABLE_SYNC_TOKEN }}
with:
semver-version: ${{ needs.get-next-version.outputs.next-version }}
repo-type: 'mobile' # Accepts 'mobile' or 'extension'
github-tools-version: '701a894f38883ab48560f948e98b76cc6b4d623f'
stable-branch-name: 'stable'
steps:
- name: Run stable branch sync
uses: MetaMask/github-tools/.github/actions/stable-sync@v1
with:
semver-version: ${{ needs.get-next-version.outputs.next-version }}
repo-type: 'mobile'
stable-branch-name: 'stable'
github-token: ${{ secrets.STABLE_SYNC_TOKEN }}
7 changes: 6 additions & 1 deletion .github/workflows/stale-issue-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ on:

jobs:
stale:
uses: metamask/github-tools/.github/workflows/stale-issue-pr.yml@566da3332757544da431707bde71a242b182b3ac
name: Close stale issues and PRs
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Close stale issues and PRs
uses: MetaMask/github-tools/.github/actions/stale-issue-pr@v1

5 changes: 2 additions & 3 deletions .github/workflows/update-release-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: |
BRANCH_NAME="${{ github.ref_name }}"
echo "Checking branch: $BRANCH_NAME"

# Validate branch matches release/x.y.z format (semantic versioning)
if [[ "$BRANCH_NAME" =~ ^release/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
VERSION="${BRANCH_NAME#release/}"
Expand All @@ -48,11 +48,10 @@ jobs:
pull-requests: write
steps:
- name: Update Release Changelog
uses: MetaMask/github-tools/.github/actions/update-release-changelog@v1.1.3
uses: MetaMask/github-tools/.github/actions/update-release-changelog@v1
with:
release-branch: ${{ github.ref_name }}
repository-url: ${{ github.server_url }}/${{ github.repository }}
platform: mobile
previous-version-ref: 'null'
github-tools-version: v1.1.3
github-token: ${{ secrets.PR_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ const TabsList = forwardRef<TabsListRef, TabsListProps>(
return (
<Box
key={tab.key}
twClassName={isActive ? 'flex-1' : 'absolute opacity-0'}
twClassName={isActive ? 'flex-1' : 'hidden'}
pointerEvents={!isActive ? 'none' : 'auto'}
>
{tab.content}
Expand Down
34 changes: 21 additions & 13 deletions app/components/Base/RemoteImage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,21 @@ interface RemoteImageProps {
contentFit?: ImageContentFit;
}

const createStyles = () =>
StyleSheet.create({
imageStyle: {
width: '100%',
height: '100%',
borderRadius: 8,
},
detailedImageStyle: {
borderRadius: 8,
},
});
const styles = StyleSheet.create({
imageStyle: {
width: '100%',
height: '100%',
borderRadius: 8,
},
detailedImageStyle: {
borderRadius: 8,
},
});

const RemoteImage: React.FC<RemoteImageProps> = (props) => {
const [error, setError] = useState<string | undefined>(undefined);
const source = resolveAssetSource(props.source);
const ipfsGateway = useIpfsGateway();
const styles = createStyles();
const [resolvedIpfsUrl, setResolvedIpfsUrl] = useState<string | false>(false);

const uri =
Expand Down Expand Up @@ -117,7 +115,17 @@ const RemoteImage: React.FC<RemoteImageProps> = (props) => {
if (width && height) {
const { width: calculatedWidth, height: calculatedHeight } =
calculateImageDimensions(width, height);
setDimensions({ width: calculatedWidth, height: calculatedHeight });

// Only update if dimensions actually changed
setDimensions((prevDimensions) => {
if (
prevDimensions?.width === calculatedWidth &&
prevDimensions?.height === calculatedHeight
) {
return prevDimensions; // Return same reference, no re-render
}
return { width: calculatedWidth, height: calculatedHeight };
});
}
},
[calculateImageDimensions],
Expand Down
Loading
Loading