Skip to content

perf(accessibility): fix iOS accessibility in Predict components and …#29122

Merged
javiergarciavera merged 13 commits into
mainfrom
perf/predict-accessibility
May 7, 2026
Merged

perf(accessibility): fix iOS accessibility in Predict components and …#29122
javiergarciavera merged 13 commits into
mainfrom
perf/predict-accessibility

Conversation

@javiergarciavera

@javiergarciavera javiergarciavera commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

…Homepage section

  • PredictMarketRowItem, PredictMarketCard, PredictPositionRow, PredictActivity: Pressable → TouchableOpacity
  • PredictMarketDetails (and sub-components): fix view nesting for iOS XCUITest element lookup
  • PredictDetailsChart, TimeframeSelector: align accessibility props
  • PredictionsSection (Homepage): remove redundant Box wrappers, –1 native node

Description

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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.

Note

Low Risk
Primarily refactors layout/styling and view nesting to improve iOS accessibility/XCUITest element lookup, with minor navigation and rendering-guard tweaks; functional risk is low but UI regressions are possible.

Overview
Improves Predict and Homepage Predictions iOS accessibility/test reliability by simplifying view hierarchies and reducing unnecessary wrapper nodes (e.g., switching several layouts to direct TouchableOpacity styling, removing extra Box/View nesting, and returning null instead of empty containers).

Adjusts Predict Market Details header/actions composition (padding moved into components; actions now self-wrap with bottom border/padding) and fixes a wallet back-navigation target. Adds a new Predict E2E selector prefix (TRENDING_MARKET_CARD) and extends PredictionsSection tests to ensure the header and unrealized PnL row aren’t duplicated/shown when the trending carousel renders above positions.

Bumps build/version numbers in bitrise.yml and the iOS Xcode project (CURRENT_PROJECT_VERSION to 4823).

Reviewed by Cursor Bugbot for commit 6aa6fca. Bugbot is set up for automated code reviews on this repo. Configure here.

@javiergarciavera javiergarciavera requested a review from a team as a code owner April 21, 2026 15:43
@github-actions

Copy link
Copy Markdown
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.

Comment thread app/components/UI/Predict/views/PredictFeed/PredictFeed.tsx
@javiergarciavera javiergarciavera force-pushed the perf/predict-accessibility branch from 715b17f to 9e4e916 Compare April 21, 2026 16:16
@javiergarciavera javiergarciavera force-pushed the perf/predict-accessibility branch from 9e4e916 to aba8226 Compare April 21, 2026 16:17
@javiergarciavera javiergarciavera requested a review from a team as a code owner April 21, 2026 16:17
@javiergarciavera javiergarciavera force-pushed the perf/predict-accessibility branch from aba8226 to 9e4e916 Compare April 21, 2026 16:18
@github-actions github-actions Bot added size-M size-XL risk-medium Moderate testing recommended · Possible bug introduction risk and removed size-XL size-M labels Apr 21, 2026
Comment thread app/components/Views/Homepage/Sections/Predictions/PredictionsSection.tsx Outdated
javiergarciavera and others added 2 commits April 21, 2026 18:48
…Homepage section

- PredictMarketRowItem, PredictMarketCard, PredictPositionRow, PredictActivity: Pressable → TouchableOpacity
- PredictMarketDetails (and sub-components): fix view nesting for iOS XCUITest element lookup
- PredictDetailsChart, TimeframeSelector: align accessibility props
- PredictionsSection (Homepage): remove redundant Box wrappers, –1 native node

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The accessibility patch removed hasClaimablePositions and hasAnyPositions,
causing the section to skip rendering HomepagePredictPositions (and its
claim button) when positions.length === 0 but totalClaimableValue > 0.

Restore:
- hasClaimablePositions / hasAnyPositions variables
- isLoadingClaimable in isLoading guard
- showTrendingAbove branch when claimable-only and markets exist
- showHeader prop on HomepagePredictPositions for the carousel case
- Corrected isEmpty / itemCount / willRender in PositionsOnly variant

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@javiergarciavera javiergarciavera force-pushed the perf/predict-accessibility branch from 9e4e916 to 613a795 Compare April 21, 2026 16:52
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Apr 21, 2026
javiergarciavera and others added 2 commits April 21, 2026 19:01
…unts

During the rebase conflict resolution, --theirs took our flattened
Pressable/w-1/3 version instead of origin/main's TabsBar refactor.
The hardcoded w-1/3 width breaks layouts with fewer than 3 tabs.
Restore origin/main's TabsBar implementation which handles 1, 2, or 3
tabs correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The PnL row was originally grouped with the section header inside a
showHeader conditional. After extracting the header into its own guard,
the PnL row was left ungated and would render even when showHeader=false
(i.e. when the trending carousel is shown above positions). Restore the
original behaviour by adding showHeader to the PnL condition.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Apr 21, 2026
matallui
matallui previously approved these changes Apr 27, 2026
@javiergarciavera javiergarciavera added no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed team-predict Predict team labels Apr 28, 2026
@javiergarciavera javiergarciavera added this pull request to the merge queue May 4, 2026
@javiergarciavera javiergarciavera removed this pull request from the merge queue due to a manual request May 4, 2026
@metamaskbotv2 metamaskbotv2 Bot requested a review from a team as a code owner May 6, 2026 10:02
…ctions

Remove inner Box wrapper grouping SectionHeader and UnrealizedPnL row,
making both elements direct children of the outer Box. This reduces DOM
nesting, improves Appium accessibility, and aligns visual spacing between
Perps and Predictions sections.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@javiergarciavera javiergarciavera requested a review from a team as a code owner May 6, 2026 16:15
@javiergarciavera

Copy link
Copy Markdown
Contributor Author
recording.webm

@andrepimenta andrepimenta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving for mobile platform files

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePredictions, SmokeWalletPlatform, SmokeConfirmations, SmokePerps
  • Selected Performance tags: @PerformancePredict
  • Risk Level: medium
  • AI Confidence: 88%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR contains primarily UI/layout refactoring changes across Predict and Perps components, plus a navigation fix and a header duplication bug fix.

SmokePredictions: Directly required. Multiple Predict UI components were refactored:

  • PredictFeed.tsx: Navigation fix - simplified route params when navigating back to wallet home (removed TAB_STACK_FLOW nesting). This could affect navigation behavior in E2E tests.
  • PredictMarketDetails.tsx: Removed px-3 padding wrapper from header and actions components.
  • PredictMarketOutcome.tsx, PredictActivity.tsx, PredictMarketRowItem.tsx, PredictPositionDetail.tsx: JSX structure simplification.
  • PredictionsSection.tsx: Fixed duplicate header bug by moving showHeader prop from HomepagePredictTrendingMarkets to HomepagePredictPositions, and moved hasClaimablePositions calculation to component level.
  • PredictMarketCard.tsx, PredictPositionRow.tsx: Layout simplification.
  • Predict.testIds.ts: Added TRENDING_MARKET_CARD test ID.

SmokeWalletPlatform: Required per SmokePredictions tag description - Predictions is a section inside the Trending tab, and changes to Predictions views affect Trending. Also PerpsSection changes affect Trending.

SmokeConfirmations: Required per SmokePredictions tag description - opening/closing positions are on-chain transactions that go through confirmations.

SmokePerps: PerpsSection.tsx had layout simplification (removed wrapper Box around SectionHeader and HomepageSectionUnrealizedPnlRow). Per SmokePerps description, changes to Perps views affect Trending. Also required: SmokeWalletPlatform (already selected) and SmokeConfirmations (already selected).

bitrise.yml: Only a version number bump (4532 → 4823), no functional CI change that would require additional test tags.

ios/MetaMask.xcodeproj: Version-related iOS project file change, no functional impact on E2E tests.

Performance Test Selection:
The Predict UI components underwent significant layout refactoring (removing wrapper Box/View elements, simplifying JSX structure across PredictActivity, PredictMarketOutcome, PredictMarketRowItem, PredictPositionDetail, PredictDetailsChart, PredictMarketCard, PredictPositionRow). These structural changes could affect rendering performance of the prediction market list, market details, and position display. @PerformancePredict covers prediction market list loading, market details, deposit flows, and balance display - all directly affected by these component changes.

View GitHub Actions results

@javiergarciavera javiergarciavera enabled auto-merge May 6, 2026 16:48
@sonarqubecloud

sonarqubecloud Bot commented May 6, 2026

Copy link
Copy Markdown

@javiergarciavera javiergarciavera added this pull request to the merge queue May 7, 2026
Merged via the queue into main with commit 3c59b56 May 7, 2026
99 of 100 checks passed
@javiergarciavera javiergarciavera deleted the perf/predict-accessibility branch May 7, 2026 13:32
@github-actions github-actions Bot locked and limited conversation to collaborators May 7, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.77.0 Issue or pull request that will be included in release 7.77.0 label May 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.77.0 Issue or pull request that will be included in release 7.77.0 risk-medium Moderate testing recommended · Possible bug introduction risk size-XL team-predict Predict team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants