feat: implement error boundaries for main screens and layout components#78
Merged
RUKAYAT-CODER merged 3 commits intorinafcode:mainfrom Apr 24, 2026
Merged
Conversation
|
@Ekene001 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Kindly resolve conflict |
…/Error-Boundary-Implementation
Contributor
Author
|
@RUKAYAT-CODER okay ser, ive resolved the conflicts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #51
Summary
Prevents full-app crashes from isolated component failures by wrapping all navigation layers, screens, modals, and critical providers with a shared, production-ready
ErrorBoundary. Isolated failures now show a scoped fallback UI with a retry button instead of taking down the entire app.Also fixes a navigation crash caused by unregistered routes in
SwipeableNavigation.tsx.Changes
Enhanced shared ErrorBoundary (
ErrorBoundary.tsx)boundaryNameprop for named boundary identification in crash reportsonError/onResetcallbacks for lifecycle hookscrashReporting.tsinsidecomponentDidCatchresetKey— increments to force a full subtree remount on tapNavigation layer boundaries
_layout.tsx(root) — wrapped withboundaryName="RootLayout"_layout.tsx(tab) — tab layout wrappedindex.tsx,explore.tsx— individual tab screens wrappedmodal.tsx— modal route wrappedAppNavigator.tsx— all screens wrapped viawithErrorBoundaryHOC;NavigationContaineritself wrappedSwipeableNavigation.tsx— per-screen boundaries viawithErrorBoundary; section-level isolation added for the swipeable navigation bodyModal-level boundaries
Each modal's content tree is isolated so a crash inside a modal cannot propagate to the app shell.
BiometricPrompt.tsx—boundaryName="BiometricPromptModal"AvatarCamera.tsx—boundaryName="AvatarCameraModal"AchievementBadges.tsx—boundaryName="AchievementBadgesModal"FilterSheet.tsx—boundaryName="FilterSheetModal"MobileVideoPlayer.tsx—boundaryName="MobileVideoPlayer.FullscreenModal"MobileCourseViewer.tsx—CourseViewer.NoteModalandCourseViewer.QuizModalNotificationPrompt.tsx— both permission-request and fallback branches wrappedSettingsPicker.tsx—boundaryName="SettingsPickerModal"Bug fix: missing navigation routes (out of scope, required for test validation)
SwipeableNavigation.tsx was missing CourseViewer, Settings, and Quiz as registered screens, causing a crash when navigating from HomeScreen - which blocked on-device testing of the boundary isolation. All three added as hidden drawer screens (drawerItemStyle: { display: 'none' }).