Skip to content

Commit ea630f7

Browse files
perf(accessibility): flatten header group in Perps and Predictions sections
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>
1 parent 14f0b1e commit ea630f7

2 files changed

Lines changed: 24 additions & 28 deletions

File tree

app/components/Views/Homepage/Sections/Perpetuals/PerpsSection.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -442,18 +442,16 @@ const PerpsSectionMain = forwardRef<SectionRefreshHandle, PerpsSectionProps>(
442442
return (
443443
<View ref={sectionViewRef} onLayout={onLayout}>
444444
<Box gap={3}>
445-
<Box gap={1}>
446-
<SectionHeader title={title} onPress={handleViewAllPerps} />
447-
{showHomepageUnrealizedPnl && (
448-
<HomepageSectionUnrealizedPnlRow
449-
isLoading={perpsAccountLoading}
450-
valueText={homepageUnrealizedPnl?.valueText}
451-
tone={homepageUnrealizedPnl?.tone ?? 'neutral'}
452-
label={strings('perps.unrealized_pnl')}
453-
testID="homepage-perps-unrealized-pnl"
454-
/>
455-
)}
456-
</Box>
445+
<SectionHeader title={title} onPress={handleViewAllPerps} />
446+
{showHomepageUnrealizedPnl && (
447+
<HomepageSectionUnrealizedPnlRow
448+
isLoading={perpsAccountLoading}
449+
valueText={homepageUnrealizedPnl?.valueText}
450+
tone={homepageUnrealizedPnl?.tone ?? 'neutral'}
451+
label={strings('perps.unrealized_pnl')}
452+
testID="homepage-perps-unrealized-pnl"
453+
/>
454+
)}
457455
{showSkeleton || pendingTrending ? (
458456
<SectionRow>
459457
<PerpsPositionSkeleton />

app/components/Views/Homepage/Sections/Predictions/PredictionsSection.tsx

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -199,22 +199,20 @@ const HomepagePredictPositions = ({
199199
}: HomepagePredictPositionsProps) => (
200200
<Box gap={3}>
201201
{showHeader && (
202-
<Box gap={1}>
203-
<SectionHeader
204-
title={title}
205-
onPress={onViewAll}
206-
testID={WalletViewSelectorsIDs.HOMEPAGE_SECTION_TITLE('predictions')}
207-
/>
208-
{predictHomepageUnrealizedPnl.show && (
209-
<HomepageSectionUnrealizedPnlRow
210-
isLoading={predictHomepageUnrealizedPnl.isLoading}
211-
valueText={predictHomepageUnrealizedPnl.valueText}
212-
tone={predictHomepageUnrealizedPnl.tone}
213-
label={strings('predict.unrealized_pnl_label')}
214-
testID="homepage-predict-unrealized-pnl"
215-
/>
216-
)}
217-
</Box>
202+
<SectionHeader
203+
title={title}
204+
onPress={onViewAll}
205+
testID={WalletViewSelectorsIDs.HOMEPAGE_SECTION_TITLE('predictions')}
206+
/>
207+
)}
208+
{showHeader && predictHomepageUnrealizedPnl.show && (
209+
<HomepageSectionUnrealizedPnlRow
210+
isLoading={predictHomepageUnrealizedPnl.isLoading}
211+
valueText={predictHomepageUnrealizedPnl.valueText}
212+
tone={predictHomepageUnrealizedPnl.tone}
213+
label={strings('predict.unrealized_pnl_label')}
214+
testID="homepage-predict-unrealized-pnl"
215+
/>
218216
)}
219217
{isLoadingPositions ? (
220218
<>

0 commit comments

Comments
 (0)