Skip to content

fix(hero): render HexChartFallback on Android — skip SVG entirely#70

Merged
andrlut merged 1 commit into
mainfrom
fix/hero-android-fallback
May 3, 2026
Merged

fix(hero): render HexChartFallback on Android — skip SVG entirely#70
andrlut merged 1 commit into
mainfrom
fix/hero-android-fallback

Conversation

@andrlut

@andrlut andrlut commented May 3, 2026

Copy link
Copy Markdown
Owner

Summary

Hero kept native-crashing on Android even after PR #69's ErrorBoundary. A native crash from react-native-svg's C++/Java side bypasses any JS error boundary — there's no way to catch it from JS. So the boundary alone wasn't enough.

Pivot

On Android, never construct any react-native-svg components on Hero. Render HexChartFallback (pure-RN Views + Text) directly. Same data, same dim cards, same pip rows — just no radar polygon visualization.

iOS and web keep the proper HexChart with all its SVG goodness, still wrapped in the ErrorBoundary as belt-and-suspenders.

Plus

Restored fontFamily="Manrope_800ExtraBold" on <SvgText> labels — the rest of the app uses Manrope and the inconsistency stood out. Now matters only for iOS/web (the only platforms that hit that code path).

When can Android get the polygon back?

Two upstream blockers:

  1. Brush.getVal null guard from software-mansion/react-native-svg#2940 needs to land
  2. Native typeface registration for SVG text on Android needs a clean answer

Once both are resolved (or we patch-package), drop the Platform.OS branch.

Test plan

  • Open Hero on Android — page loads with the fallback (overall number on top, 2×3 dim cards). App does not close.
  • Tap the card → self-assessment modal opens
  • Adjust scores → fallback updates immediately
  • iOS / web: still see the SVG hexagon polygon with Manrope labels

🤖 Generated with Claude Code

@andrlut andrlut merged commit 3c33b70 into main May 3, 2026
2 checks passed
@andrlut andrlut deleted the fix/hero-android-fallback branch May 3, 2026 13:32
…store Manrope on iOS/web

Hero kept native-crashing on Android even with ErrorBoundary in place.
A native crash from react-native-svg's C++/Java side bypasses the JS
boundary — there's no way to catch it in JS. The user reported the
app still force-closes after PR #69 OTA'd.

Pivot: on Android, never construct any react-native-svg components.
Render HexChartFallback (pure-RN Views/Text) directly. Same data, same
look-and-feel for the dim cards / pips, just without the radar polygon.

iOS and web continue to render the proper HexChart with Manrope on
SvgText labels. Both platforms still wear the ErrorBoundary so any
JS-level throw drops in inline.

Restored fontFamily="Manrope_800ExtraBold" on the SvgText labels per
user request — the rest of the app already uses Manrope and the
inconsistency was visible.

Re-enable the SVG path on Android once react-native-svg ships the
Brush.getVal null guard (PR software-mansion/react-native-svg#2940)
and we resolve native typeface registration for SVG text.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant