react-native-inapp-inspector 2.3.18 → 2.3.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +57 -0
- package/dist/commonjs/analytics.js +1 -24
- package/dist/commonjs/bundle.js +1 -16
- package/dist/commonjs/capture.d.ts +2 -0
- package/dist/commonjs/capture.js +1 -32
- package/dist/commonjs/components/AnalyticsDetail.js +92 -623
- package/dist/commonjs/components/AnalyticsEventCard.js +54 -350
- package/dist/commonjs/components/AnalyticsGraph.js +70 -370
- package/dist/commonjs/components/AnimatedEntrance.js +1 -11
- package/dist/commonjs/components/AppHeaderLogo.js +7 -134
- package/dist/commonjs/components/BrandCircleIcon.js +73 -118
- package/dist/commonjs/components/BrandSquareIcon.js +63 -108
- package/dist/commonjs/components/CodeSnippet.js +48 -623
- package/dist/commonjs/components/ConsoleLogCard.js +63 -537
- package/dist/commonjs/components/CopyButton.js +3 -89
- package/dist/commonjs/components/DiffViewer.js +19 -83
- package/dist/commonjs/components/DomainHeader.js +27 -127
- package/dist/commonjs/components/EmptyState.d.ts +1 -0
- package/dist/commonjs/components/EmptyState.js +10 -87
- package/dist/commonjs/components/EndOfListFooter.js +7 -81
- package/dist/commonjs/components/ErrorBoundary.js +72 -566
- package/dist/commonjs/components/HeadersSection.js +31 -110
- package/dist/commonjs/components/HighlightText.js +17 -58
- package/dist/commonjs/components/Inspector/AboutModal.d.ts +6 -0
- package/dist/commonjs/components/Inspector/AboutModal.js +351 -0
- package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +98 -797
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +284 -930
- package/dist/commonjs/components/Inspector/BundleTab.js +551 -2918
- package/dist/commonjs/components/Inspector/ConsoleTab.js +79 -492
- package/dist/commonjs/components/Inspector/CrashDetail.js +123 -672
- package/dist/commonjs/components/Inspector/CrashFilterModal.js +66 -498
- package/dist/commonjs/components/Inspector/CrashTab.js +98 -670
- package/dist/commonjs/components/Inspector/DebuggingTab.js +64 -871
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +143 -907
- package/dist/commonjs/components/Inspector/FabLauncher.js +85 -54
- package/dist/commonjs/components/Inspector/FeatureUnderDevNotice.js +6 -99
- package/dist/commonjs/components/Inspector/FeedbackModal.d.ts +9 -0
- package/dist/commonjs/components/Inspector/FeedbackModal.js +167 -521
- package/dist/commonjs/components/Inspector/InspectorContext.js +1 -21
- package/dist/commonjs/components/Inspector/InspectorHeader.js +219 -1093
- package/dist/commonjs/components/Inspector/LogDetail.js +168 -994
- package/dist/commonjs/components/Inspector/MainScreen.js +60 -332
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +136 -278
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +134 -361
- package/dist/commonjs/components/Inspector/NavigationTracker.js +1 -12
- package/dist/commonjs/components/Inspector/NetworkDetail.js +96 -432
- package/dist/commonjs/components/Inspector/NetworkFilterModal.js +60 -576
- package/dist/commonjs/components/Inspector/NetworkTab.js +84 -514
- package/dist/commonjs/components/Inspector/NpmStarPrompt.js +17 -433
- package/dist/commonjs/components/Inspector/NpmUpdateToast.js +25 -298
- package/dist/commonjs/components/Inspector/PerformanceTab.js +182 -1397
- package/dist/commonjs/components/Inspector/ReduxDetail.js +188 -1089
- package/dist/commonjs/components/Inspector/ReduxTab.js +85 -701
- package/dist/commonjs/components/Inspector/SettingsPanel.js +431 -3431
- package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +11 -180
- package/dist/commonjs/components/Inspector/StorageTab.js +93 -826
- package/dist/commonjs/components/Inspector/TabBar.js +47 -183
- package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +34 -408
- package/dist/commonjs/components/JsonViewer.js +168 -380
- package/dist/commonjs/components/LogCard.js +57 -567
- package/dist/commonjs/components/LogSyntaxHighlighter.js +11 -130
- package/dist/commonjs/components/MetaAccordion.js +69 -238
- package/dist/commonjs/components/MiniBarChart.js +3 -56
- package/dist/commonjs/components/MiniLineChart.js +3 -58
- package/dist/commonjs/components/NetworkIcons.d.ts +7 -0
- package/dist/commonjs/components/NetworkIcons.js +479 -997
- package/dist/commonjs/components/QRCodeView.js +5 -79
- package/dist/commonjs/components/SectionHeader.js +15 -37
- package/dist/commonjs/components/SegmentedTabs.js +7 -61
- package/dist/commonjs/components/SkeletonPlaceholder.js +11 -180
- package/dist/commonjs/components/Slider.js +15 -243
- package/dist/commonjs/components/SourcePageCard.js +30 -89
- package/dist/commonjs/components/Toast.js +5 -147
- package/dist/commonjs/components/TouchableScale.js +3 -24
- package/dist/commonjs/components/TreeNode.js +55 -130
- package/dist/commonjs/console.js +1 -16
- package/dist/commonjs/constants/index.js +1 -32
- package/dist/commonjs/constants/telemetryConfig.js +1 -6
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -4
- package/dist/commonjs/crash.js +1 -23
- package/dist/commonjs/customHooks/analyticsLogger.js +1 -250
- package/dist/commonjs/customHooks/bundleAnalyzer.js +1 -957
- package/dist/commonjs/customHooks/consoleLogger.js +6 -445
- package/dist/commonjs/customHooks/crashHandler.js +7 -656
- package/dist/commonjs/customHooks/logFilters.js +1 -23
- package/dist/commonjs/customHooks/networkLogger.js +2 -536
- package/dist/commonjs/customHooks/performanceTracker.js +63 -750
- package/dist/commonjs/customHooks/reduxLogger.js +2 -313
- package/dist/commonjs/customHooks/storageInspector.js +1 -435
- package/dist/commonjs/customHooks/useAccordion.js +1 -18
- package/dist/commonjs/decorators/index.js +1 -100
- package/dist/commonjs/helpers/gaAnalyticsRegistry.js +1 -148
- package/dist/commonjs/helpers/index.js +8 -921
- package/dist/commonjs/helpers/memoryManager.js +1 -99
- package/dist/commonjs/helpers/qrGenerator.js +1 -367
- package/dist/commonjs/helpers/remoteConfig.js +1 -165
- package/dist/commonjs/helpers/searchQueryParser.js +1 -62
- package/dist/commonjs/helpers/settingsStore.js +1 -144
- package/dist/commonjs/helpers/telemetry.js +1 -501
- package/dist/commonjs/helpers/toast.js +1 -20
- package/dist/commonjs/i18n/index.js +1 -90
- package/dist/commonjs/i18n/locales/en.json +1 -1122
- package/dist/commonjs/index.js +5 -2153
- package/dist/commonjs/metro.js +6 -468
- package/dist/commonjs/native/NativeInspector.d.ts +3 -0
- package/dist/commonjs/native/NativeInspector.js +1 -402
- package/dist/commonjs/native/NativeNetworkInspector.d.ts +1 -0
- package/dist/commonjs/native/NativeNetworkInspector.js +1 -4
- package/dist/commonjs/network.js +1 -13
- package/dist/commonjs/performance.js +1 -29
- package/dist/commonjs/redux.js +1 -20
- package/dist/commonjs/storage.js +1 -14
- package/dist/commonjs/styles/AppColors.js +1 -423
- package/dist/commonjs/styles/AppFonts.js +1 -17
- package/dist/commonjs/styles/common.js +1 -190
- package/dist/commonjs/styles/index.d.ts +6 -0
- package/dist/commonjs/styles/index.js +1 -1589
- package/dist/commonjs/types/enums.d.ts +2 -1
- package/dist/commonjs/types/enums.js +1 -150
- package/dist/commonjs/types/index.js +1 -18
- package/dist/commonjs/types/interfaces.d.ts +7 -0
- package/dist/commonjs/types/interfaces.js +1 -2
- package/dist/esm/analytics.js +1 -2
- package/dist/esm/bundle.js +1 -2
- package/dist/esm/capture.d.ts +2 -0
- package/dist/esm/capture.js +1 -29
- package/dist/esm/components/AnalyticsDetail.js +171 -664
- package/dist/esm/components/AnalyticsEventCard.js +77 -335
- package/dist/esm/components/AnalyticsGraph.js +95 -357
- package/dist/esm/components/AnimatedEntrance.js +1 -6
- package/dist/esm/components/AppHeaderLogo.js +7 -94
- package/dist/esm/components/BrandCircleIcon.js +114 -119
- package/dist/esm/components/BrandSquareIcon.js +73 -78
- package/dist/esm/components/CodeSnippet.js +58 -595
- package/dist/esm/components/ConsoleLogCard.js +91 -526
- package/dist/esm/components/CopyButton.js +3 -51
- package/dist/esm/components/DiffViewer.js +22 -48
- package/dist/esm/components/DomainHeader.js +43 -138
- package/dist/esm/components/EmptyState.d.ts +1 -0
- package/dist/esm/components/EmptyState.js +17 -56
- package/dist/esm/components/EndOfListFooter.js +15 -83
- package/dist/esm/components/ErrorBoundary.js +125 -582
- package/dist/esm/components/HeadersSection.js +52 -93
- package/dist/esm/components/HighlightText.js +17 -53
- package/dist/esm/components/Inspector/AboutModal.d.ts +6 -0
- package/dist/esm/components/Inspector/AboutModal.js +351 -0
- package/dist/esm/components/Inspector/AnalyticsFilterModal.js +225 -886
- package/dist/esm/components/Inspector/AnalyticsTab.js +296 -904
- package/dist/esm/components/Inspector/BundleTab.js +1175 -3502
- package/dist/esm/components/Inspector/ConsoleTab.js +113 -488
- package/dist/esm/components/Inspector/CrashDetail.js +236 -747
- package/dist/esm/components/Inspector/CrashFilterModal.js +149 -541
- package/dist/esm/components/Inspector/CrashTab.js +177 -711
- package/dist/esm/components/Inspector/DebuggingTab.js +156 -923
- package/dist/esm/components/Inspector/DeviceInfoTab.js +199 -924
- package/dist/esm/components/Inspector/FabLauncher.js +85 -49
- package/dist/esm/components/Inspector/FeatureUnderDevNotice.js +14 -70
- package/dist/esm/components/Inspector/FeedbackModal.d.ts +9 -0
- package/dist/esm/components/Inspector/FeedbackModal.js +182 -499
- package/dist/esm/components/Inspector/InspectorContext.js +1 -12
- package/dist/esm/components/Inspector/InspectorHeader.js +309 -1145
- package/dist/esm/components/Inspector/LogDetail.js +235 -1023
- package/dist/esm/components/Inspector/MainScreen.js +86 -320
- package/dist/esm/components/Inspector/MediaGalleryTab.js +157 -259
- package/dist/esm/components/Inspector/MediaPreviewModal.js +153 -340
- package/dist/esm/components/Inspector/NavigationTracker.js +1 -10
- package/dist/esm/components/Inspector/NetworkDetail.js +141 -472
- package/dist/esm/components/Inspector/NetworkFilterModal.js +122 -597
- package/dist/esm/components/Inspector/NetworkTab.js +125 -517
- package/dist/esm/components/Inspector/NpmStarPrompt.js +58 -434
- package/dist/esm/components/Inspector/NpmUpdateToast.js +45 -281
- package/dist/esm/components/Inspector/PerformanceTab.js +393 -1570
- package/dist/esm/components/Inspector/ReduxDetail.js +307 -1170
- package/dist/esm/components/Inspector/ReduxTab.js +144 -722
- package/dist/esm/components/Inspector/SettingsPanel.js +647 -3609
- package/dist/esm/components/Inspector/SkeletonPlaceholder.js +30 -163
- package/dist/esm/components/Inspector/StorageTab.js +172 -866
- package/dist/esm/components/Inspector/TabBar.js +52 -183
- package/dist/esm/components/Inspector/UpdateAvailableModal.js +79 -416
- package/dist/esm/components/JsonViewer.js +179 -353
- package/dist/esm/components/LogCard.js +93 -565
- package/dist/esm/components/LogSyntaxHighlighter.js +11 -123
- package/dist/esm/components/MetaAccordion.js +136 -267
- package/dist/esm/components/MiniBarChart.js +3 -18
- package/dist/esm/components/MiniLineChart.js +3 -20
- package/dist/esm/components/NetworkIcons.d.ts +7 -0
- package/dist/esm/components/NetworkIcons.js +481 -817
- package/dist/esm/components/QRCodeView.js +8 -45
- package/dist/esm/components/SectionHeader.js +22 -39
- package/dist/esm/components/SegmentedTabs.js +8 -57
- package/dist/esm/components/SkeletonPlaceholder.js +30 -163
- package/dist/esm/components/Slider.js +24 -213
- package/dist/esm/components/SourcePageCard.js +65 -86
- package/dist/esm/components/Toast.js +10 -117
- package/dist/esm/components/TouchableScale.js +3 -19
- package/dist/esm/components/TreeNode.js +58 -95
- package/dist/esm/console.js +1 -2
- package/dist/esm/constants/index.js +1 -28
- package/dist/esm/constants/telemetryConfig.js +1 -3
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/crash.js +1 -2
- package/dist/esm/customHooks/analyticsLogger.js +1 -230
- package/dist/esm/customHooks/bundleAnalyzer.js +1 -944
- package/dist/esm/customHooks/consoleLogger.js +6 -432
- package/dist/esm/customHooks/crashHandler.js +7 -630
- package/dist/esm/customHooks/logFilters.js +1 -20
- package/dist/esm/customHooks/networkLogger.js +2 -519
- package/dist/esm/customHooks/performanceTracker.js +63 -723
- package/dist/esm/customHooks/reduxLogger.js +2 -293
- package/dist/esm/customHooks/storageInspector.js +1 -418
- package/dist/esm/customHooks/useAccordion.js +1 -16
- package/dist/esm/decorators/index.js +1 -95
- package/dist/esm/helpers/gaAnalyticsRegistry.js +1 -143
- package/dist/esm/helpers/index.js +8 -861
- package/dist/esm/helpers/memoryManager.js +1 -91
- package/dist/esm/helpers/qrGenerator.js +1 -364
- package/dist/esm/helpers/remoteConfig.js +1 -160
- package/dist/esm/helpers/searchQueryParser.js +1 -59
- package/dist/esm/helpers/settingsStore.js +1 -134
- package/dist/esm/helpers/telemetry.js +1 -489
- package/dist/esm/helpers/toast.js +1 -15
- package/dist/esm/i18n/index.js +1 -78
- package/dist/esm/i18n/locales/en.json +1 -1122
- package/dist/esm/index.js +7 -1967
- package/dist/esm/metro.js +6 -459
- package/dist/esm/native/NativeInspector.d.ts +3 -0
- package/dist/esm/native/NativeInspector.js +1 -370
- package/dist/esm/native/NativeNetworkInspector.d.ts +1 -0
- package/dist/esm/native/NativeNetworkInspector.js +1 -2
- package/dist/esm/network.js +1 -1
- package/dist/esm/performance.js +1 -2
- package/dist/esm/redux.js +1 -1
- package/dist/esm/storage.js +1 -1
- package/dist/esm/styles/AppColors.js +1 -417
- package/dist/esm/styles/AppFonts.js +1 -13
- package/dist/esm/styles/common.js +1 -186
- package/dist/esm/styles/index.d.ts +6 -0
- package/dist/esm/styles/index.js +1 -1551
- package/dist/esm/types/enums.d.ts +2 -1
- package/dist/esm/types/enums.js +1 -147
- package/dist/esm/types/index.js +1 -2
- package/dist/esm/types/interfaces.d.ts +7 -0
- package/dist/esm/types/interfaces.js +1 -1
- package/ios/NetworkInspectorModule.mm +253 -136
- package/package.json +5 -3
- package/react-native-inapp-inspector.podspec +1 -1
- package/src/native/NativeInspector.ts +17 -0
- package/src/native/NativeNetworkInspector.ts +1 -0
- package/src/analytics.ts +0 -35
- package/src/bundle.ts +0 -25
- package/src/capture.ts +0 -101
- package/src/components/AnalyticsDetail.tsx +0 -870
- package/src/components/AnalyticsEventCard.tsx +0 -444
- package/src/components/AnalyticsGraph.tsx +0 -583
- package/src/components/AnimatedEntrance.tsx +0 -20
- package/src/components/AppHeaderLogo.tsx +0 -143
- package/src/components/BrandCircleIcon.tsx +0 -144
- package/src/components/BrandSquareIcon.tsx +0 -184
- package/src/components/CodeSnippet.tsx +0 -725
- package/src/components/ConsoleLogCard.tsx +0 -679
- package/src/components/CopyButton.tsx +0 -87
- package/src/components/DiffViewer.tsx +0 -82
- package/src/components/DomainHeader.tsx +0 -224
- package/src/components/EmptyState.tsx +0 -95
- package/src/components/EndOfListFooter.tsx +0 -100
- package/src/components/ErrorBoundary.tsx +0 -688
- package/src/components/HeadersSection.tsx +0 -172
- package/src/components/HighlightText.tsx +0 -100
- package/src/components/Inspector/AnalyticsFilterModal.tsx +0 -1250
- package/src/components/Inspector/AnalyticsTab.tsx +0 -1362
- package/src/components/Inspector/BundleTab.tsx +0 -4768
- package/src/components/Inspector/ConsoleTab.tsx +0 -726
- package/src/components/Inspector/CrashDetail.tsx +0 -997
- package/src/components/Inspector/CrashFilterModal.tsx +0 -721
- package/src/components/Inspector/CrashTab.tsx +0 -933
- package/src/components/Inspector/DebuggingTab.tsx +0 -1103
- package/src/components/Inspector/DeviceInfoTab.tsx +0 -1397
- package/src/components/Inspector/FabLauncher.tsx +0 -80
- package/src/components/Inspector/FeatureUnderDevNotice.tsx +0 -94
- package/src/components/Inspector/FeedbackModal.tsx +0 -626
- package/src/components/Inspector/InspectorContext.tsx +0 -28
- package/src/components/Inspector/InspectorHeader.tsx +0 -1545
- package/src/components/Inspector/LogDetail.tsx +0 -1431
- package/src/components/Inspector/MainScreen.tsx +0 -459
- package/src/components/Inspector/MediaGalleryTab.tsx +0 -355
- package/src/components/Inspector/MediaPreviewModal.tsx +0 -435
- package/src/components/Inspector/NavigationTracker.tsx +0 -13
- package/src/components/Inspector/NetworkDetail.tsx +0 -795
- package/src/components/Inspector/NetworkFilterModal.tsx +0 -730
- package/src/components/Inspector/NetworkTab.tsx +0 -820
- package/src/components/Inspector/NpmStarPrompt.tsx +0 -532
- package/src/components/Inspector/NpmUpdateToast.tsx +0 -387
- package/src/components/Inspector/PerformanceTab.tsx +0 -1967
- package/src/components/Inspector/ReduxDetail.tsx +0 -1651
- package/src/components/Inspector/ReduxTab.tsx +0 -987
- package/src/components/Inspector/SettingsPanel.tsx +0 -4580
- package/src/components/Inspector/SkeletonPlaceholder.tsx +0 -206
- package/src/components/Inspector/StorageTab.tsx +0 -1159
- package/src/components/Inspector/TabBar.tsx +0 -263
- package/src/components/Inspector/UpdateAvailableModal.tsx +0 -555
- package/src/components/JsonViewer.tsx +0 -547
- package/src/components/LogCard.tsx +0 -694
- package/src/components/LogSyntaxHighlighter.tsx +0 -178
- package/src/components/MetaAccordion.tsx +0 -355
- package/src/components/MiniBarChart.tsx +0 -42
- package/src/components/MiniLineChart.tsx +0 -33
- package/src/components/NetworkIcons.tsx +0 -2599
- package/src/components/QRCodeView.tsx +0 -75
- package/src/components/SectionHeader.tsx +0 -101
- package/src/components/SegmentedTabs.tsx +0 -83
- package/src/components/SkeletonPlaceholder.tsx +0 -206
- package/src/components/Slider.tsx +0 -300
- package/src/components/SourcePageCard.tsx +0 -150
- package/src/components/Toast.tsx +0 -131
- package/src/components/TouchableScale.tsx +0 -61
- package/src/components/TreeNode.tsx +0 -171
- package/src/console.ts +0 -24
- package/src/constants/index.ts +0 -41
- package/src/constants/telemetryConfig.ts +0 -4
- package/src/constants/version.ts +0 -3
- package/src/crash.ts +0 -32
- package/src/customHooks/analyticsLogger.ts +0 -336
- package/src/customHooks/bundleAnalyzer.ts +0 -1256
- package/src/customHooks/consoleLogger.ts +0 -530
- package/src/customHooks/crashHandler.ts +0 -944
- package/src/customHooks/logFilters.ts +0 -32
- package/src/customHooks/networkLogger.ts +0 -624
- package/src/customHooks/performanceTracker.ts +0 -1014
- package/src/customHooks/reduxLogger.ts +0 -406
- package/src/customHooks/storageInspector.ts +0 -513
- package/src/customHooks/useAccordion.tsx +0 -27
- package/src/decorators/index.ts +0 -184
- package/src/helpers/gaAnalyticsRegistry.ts +0 -204
- package/src/helpers/index.ts +0 -1092
- package/src/helpers/memoryManager.ts +0 -138
- package/src/helpers/qrGenerator.ts +0 -430
- package/src/helpers/remoteConfig.ts +0 -212
- package/src/helpers/searchQueryParser.ts +0 -84
- package/src/helpers/settingsStore.ts +0 -171
- package/src/helpers/telemetry.ts +0 -568
- package/src/helpers/toast.ts +0 -17
- package/src/i18n/index.ts +0 -104
- package/src/i18n/locales/en.json +0 -1125
- package/src/index.tsx +0 -2635
- package/src/metro.ts +0 -598
- package/src/network.ts +0 -22
- package/src/performance.ts +0 -38
- package/src/redux.ts +0 -23
- package/src/storage.ts +0 -18
- package/src/styles/AppColors.ts +0 -455
- package/src/styles/AppFonts.ts +0 -26
- package/src/styles/common.ts +0 -209
- package/src/styles/index.ts +0 -1606
- package/src/types/enums.ts +0 -208
- package/src/types/index.ts +0 -34
- package/src/types/interfaces.ts +0 -530
|
@@ -1,933 +0,0 @@
|
|
|
1
|
-
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Alert,
|
|
4
|
-
FlatList,
|
|
5
|
-
Modal,
|
|
6
|
-
Platform,
|
|
7
|
-
Pressable,
|
|
8
|
-
ScrollView,
|
|
9
|
-
StyleSheet,
|
|
10
|
-
Text,
|
|
11
|
-
TextInput,
|
|
12
|
-
TouchableOpacity,
|
|
13
|
-
View,
|
|
14
|
-
} from 'react-native';
|
|
15
|
-
import {useTranslation} from '../../i18n';
|
|
16
|
-
import {useInspector} from './InspectorContext';
|
|
17
|
-
import TouchableScale from '../TouchableScale';
|
|
18
|
-
import AnimatedEntrance from '../AnimatedEntrance';
|
|
19
|
-
import EmptyState from '../EmptyState';
|
|
20
|
-
import EndOfListFooter from '../EndOfListFooter';
|
|
21
|
-
import FeatureUnderDevNotice from './FeatureUnderDevNotice';
|
|
22
|
-
import HighlightText from '../HighlightText';
|
|
23
|
-
import JsonViewer from '../JsonViewer';
|
|
24
|
-
import styles from '../../styles';
|
|
25
|
-
import {AppColors} from '../../styles/AppColors';
|
|
26
|
-
import {AppFonts} from '../../styles/AppFonts';
|
|
27
|
-
import {
|
|
28
|
-
CrashRecord,
|
|
29
|
-
ParsedStackFrame,
|
|
30
|
-
CrashBreadcrumb,
|
|
31
|
-
} from '../../types';
|
|
32
|
-
import {
|
|
33
|
-
CrashFilterType,
|
|
34
|
-
CrashType,
|
|
35
|
-
} from '../../types/enums';
|
|
36
|
-
import {
|
|
37
|
-
clearCrashRecords,
|
|
38
|
-
} from '../../customHooks/crashHandler';
|
|
39
|
-
import CrashFilterModal, {
|
|
40
|
-
CrashFilters,
|
|
41
|
-
DEFAULT_CRASH_FILTERS,
|
|
42
|
-
isCrashFiltersDefault,
|
|
43
|
-
} from './CrashFilterModal';
|
|
44
|
-
import {
|
|
45
|
-
CrashIcon,
|
|
46
|
-
SearchIcon,
|
|
47
|
-
ClearIcon,
|
|
48
|
-
TrashIcon,
|
|
49
|
-
WarningTriangleIcon,
|
|
50
|
-
TerminalIcon,
|
|
51
|
-
LayersIcon,
|
|
52
|
-
ClockIcon,
|
|
53
|
-
ShieldAlertIcon,
|
|
54
|
-
CircleAlertIcon,
|
|
55
|
-
CircleCheckIcon,
|
|
56
|
-
CloseWhite,
|
|
57
|
-
WhiteBackNavigation,
|
|
58
|
-
GlobeIcon,
|
|
59
|
-
FlameIcon,
|
|
60
|
-
JsIcon,
|
|
61
|
-
HourglassIcon,
|
|
62
|
-
SkullIcon,
|
|
63
|
-
LayoutIcon,
|
|
64
|
-
ChipIcon,
|
|
65
|
-
AppleIcon,
|
|
66
|
-
AndroidIcon,
|
|
67
|
-
RepeatIcon,
|
|
68
|
-
CodeBracketsIcon,
|
|
69
|
-
FilterIcon,
|
|
70
|
-
ChevronIcon,
|
|
71
|
-
} from '../NetworkIcons';
|
|
72
|
-
|
|
73
|
-
const getRelativeTime = (timestamp: number): string => {
|
|
74
|
-
const now = Date.now();
|
|
75
|
-
const diff = Math.max(0, now - timestamp);
|
|
76
|
-
const seconds = Math.floor(diff / 1000);
|
|
77
|
-
const minutes = Math.floor(seconds / 60);
|
|
78
|
-
const hours = Math.floor(minutes / 60);
|
|
79
|
-
const days = Math.floor(hours / 24);
|
|
80
|
-
|
|
81
|
-
if (seconds < 60) return `${seconds}s ago`;
|
|
82
|
-
if (minutes < 60) return `${minutes}m ago`;
|
|
83
|
-
if (hours < 24) return `${hours}h ago`;
|
|
84
|
-
return `${days}d ago`;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const CrashTab = React.memo(() => {
|
|
90
|
-
const {t} = useTranslation();
|
|
91
|
-
const {crashRecords, selectedCrash, setSelectedCrash} = useInspector();
|
|
92
|
-
|
|
93
|
-
const listRef = useRef<FlatList>(null);
|
|
94
|
-
const [searchQuery, setSearchQuery] = useState('');
|
|
95
|
-
const [filterType, setFilterType] = useState<CrashFilterType>('all');
|
|
96
|
-
const [crashFilters, setCrashFilters] = useState<CrashFilters>(
|
|
97
|
-
DEFAULT_CRASH_FILTERS,
|
|
98
|
-
);
|
|
99
|
-
const [isFilterModalOpen, setIsFilterModalOpen] = useState(false);
|
|
100
|
-
const [detailSubTab, setDetailSubTab] = useState<
|
|
101
|
-
'stack' | 'device' | 'breadcrumbs' | 'raw'
|
|
102
|
-
>('stack');
|
|
103
|
-
|
|
104
|
-
// Calculate statistics
|
|
105
|
-
const stats = useMemo(() => {
|
|
106
|
-
const total = crashRecords.length;
|
|
107
|
-
let fatalCount = 0;
|
|
108
|
-
let jsCount = 0;
|
|
109
|
-
let promiseCount = 0;
|
|
110
|
-
let renderCount = 0;
|
|
111
|
-
let nativeCount = 0;
|
|
112
|
-
|
|
113
|
-
crashRecords.forEach(c => {
|
|
114
|
-
if (c.isFatal) fatalCount++;
|
|
115
|
-
if (c.type === 'js') jsCount++;
|
|
116
|
-
else if (c.type === 'promise') promiseCount++;
|
|
117
|
-
else if (c.type === 'render') renderCount++;
|
|
118
|
-
else if (c.type === 'native') nativeCount++;
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
return {total, fatalCount, jsCount, promiseCount, renderCount, nativeCount};
|
|
122
|
-
}, [crashRecords]);
|
|
123
|
-
|
|
124
|
-
// Filtered crash list
|
|
125
|
-
const filteredList = useMemo(() => {
|
|
126
|
-
let list = crashRecords.filter(item => {
|
|
127
|
-
// Type filter
|
|
128
|
-
if (filterType === 'fatal' && !item.isFatal) return false;
|
|
129
|
-
if (filterType === 'js' && item.type !== 'js') return false;
|
|
130
|
-
if (filterType === 'promise' && item.type !== 'promise') return false;
|
|
131
|
-
if (filterType === 'render' && item.type !== 'render') return false;
|
|
132
|
-
if (filterType === 'native' && item.type !== 'native') return false;
|
|
133
|
-
|
|
134
|
-
// Modal filters: crash types
|
|
135
|
-
if (crashFilters.types.size > 0 && !crashFilters.types.has('all')) {
|
|
136
|
-
const matches =
|
|
137
|
-
(crashFilters.types.has('fatal') && item.isFatal) ||
|
|
138
|
-
(crashFilters.types.has('js') && item.type === 'js') ||
|
|
139
|
-
(crashFilters.types.has('promise') && item.type === 'promise') ||
|
|
140
|
-
(crashFilters.types.has('render') && item.type === 'render') ||
|
|
141
|
-
(crashFilters.types.has('native') && item.type === 'native');
|
|
142
|
-
if (!matches) return false;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// Modal filters: time window
|
|
146
|
-
if (crashFilters.timeWindow !== 'all') {
|
|
147
|
-
const now = Date.now();
|
|
148
|
-
const cutoff =
|
|
149
|
-
crashFilters.timeWindow === '15m'
|
|
150
|
-
? now - 15 * 60 * 1000
|
|
151
|
-
: crashFilters.timeWindow === '1h'
|
|
152
|
-
? now - 60 * 60 * 1000
|
|
153
|
-
: crashFilters.timeWindow === '24h'
|
|
154
|
-
? now - 24 * 60 * 60 * 1000
|
|
155
|
-
: now - 7 * 24 * 60 * 60 * 1000;
|
|
156
|
-
if (item.timestamp < cutoff) return false;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// Modal filters: platform
|
|
160
|
-
if (crashFilters.platform !== 'all') {
|
|
161
|
-
const platform = (item.deviceInfo?.platform || '').toLowerCase();
|
|
162
|
-
if (platform !== crashFilters.platform) return false;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// Modal filters: engine
|
|
166
|
-
if (crashFilters.engine !== 'all') {
|
|
167
|
-
const isHermes = item.deviceInfo?.isHermes;
|
|
168
|
-
if (crashFilters.engine === 'hermes' && isHermes !== true) return false;
|
|
169
|
-
if (crashFilters.engine === 'jsc' && (isHermes === true)) return false;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// Search filter
|
|
173
|
-
if (searchQuery.trim().length > 0) {
|
|
174
|
-
const queryTokens = searchQuery.trim().toLowerCase().split(/\s+/).filter(Boolean);
|
|
175
|
-
const searchTarget = [
|
|
176
|
-
item.message || '',
|
|
177
|
-
item.name || '',
|
|
178
|
-
item.stack || '',
|
|
179
|
-
item.type || '',
|
|
180
|
-
item.deviceInfo?.platform || '',
|
|
181
|
-
...(item.breadcrumbs || []).map(b => `${b.type || ''} ${b.message || ''}`),
|
|
182
|
-
].join(' ').toLowerCase();
|
|
183
|
-
|
|
184
|
-
return queryTokens.every(token => searchTarget.includes(token));
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return true;
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
// Modal filters: sort order
|
|
191
|
-
if (crashFilters.sortBy === 'time_asc') {
|
|
192
|
-
list = [...list].sort((a, b) => a.timestamp - b.timestamp);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
return list;
|
|
196
|
-
}, [crashRecords, filterType, searchQuery, crashFilters]);
|
|
197
|
-
|
|
198
|
-
const handleClearAll = () => {
|
|
199
|
-
Alert.alert(
|
|
200
|
-
t('crash.clearTitle'),
|
|
201
|
-
t('crash.clearMessage'),
|
|
202
|
-
[
|
|
203
|
-
{text: t('crash.clearCancel'), style: 'cancel'},
|
|
204
|
-
{
|
|
205
|
-
text: t('crash.clearConfirm'),
|
|
206
|
-
style: 'destructive',
|
|
207
|
-
onPress: () => clearCrashRecords(),
|
|
208
|
-
},
|
|
209
|
-
],
|
|
210
|
-
);
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
const renderCard = useCallback(
|
|
214
|
-
({item, index}: {item: CrashRecord; index: number}) => {
|
|
215
|
-
const isFatal = item.isFatal;
|
|
216
|
-
const typeLabel = item.type.toUpperCase();
|
|
217
|
-
const topFrame = item.parsedStack && item.parsedStack.length > 0
|
|
218
|
-
? item.parsedStack.find(f => f.isAppCode) || item.parsedStack[0]
|
|
219
|
-
: null;
|
|
220
|
-
|
|
221
|
-
const typeBadgeBg =
|
|
222
|
-
item.type === 'native'
|
|
223
|
-
? `${AppColors.errorColor}22`
|
|
224
|
-
: item.type === 'render'
|
|
225
|
-
? `${AppColors.purple}22`
|
|
226
|
-
: item.type === 'promise'
|
|
227
|
-
? `${AppColors.darkOrange}22`
|
|
228
|
-
: `${AppColors.offerPurple}22`;
|
|
229
|
-
|
|
230
|
-
const typeBadgeColor =
|
|
231
|
-
item.type === 'native'
|
|
232
|
-
? AppColors.errorColor
|
|
233
|
-
: item.type === 'render'
|
|
234
|
-
? AppColors.purple
|
|
235
|
-
: item.type === 'promise'
|
|
236
|
-
? AppColors.darkOrange
|
|
237
|
-
: AppColors.offerPurple;
|
|
238
|
-
|
|
239
|
-
return (
|
|
240
|
-
<AnimatedEntrance index={index} distance={8}>
|
|
241
|
-
<TouchableScale
|
|
242
|
-
onPress={() => {
|
|
243
|
-
setSelectedCrash(item);
|
|
244
|
-
}}
|
|
245
|
-
style={[
|
|
246
|
-
localStyles.cardContainer,
|
|
247
|
-
isFatal && localStyles.fatalCardBorder,
|
|
248
|
-
]}>
|
|
249
|
-
{/* Header: #S.No, Badges & Timestamp */}
|
|
250
|
-
<View style={localStyles.cardHeader}>
|
|
251
|
-
<View style={localStyles.badgeRow}>
|
|
252
|
-
<View style={localStyles.sNoBadge}>
|
|
253
|
-
<Text style={localStyles.sNoBadgeText}>#{index + 1}</Text>
|
|
254
|
-
</View>
|
|
255
|
-
|
|
256
|
-
{isFatal ? (
|
|
257
|
-
<View style={localStyles.fatalBadge}>
|
|
258
|
-
<FlameIcon size={10} color={AppColors.white} />
|
|
259
|
-
<Text style={localStyles.fatalBadgeText}>{t('crash.fatalBadge')}</Text>
|
|
260
|
-
</View>
|
|
261
|
-
) : (
|
|
262
|
-
<View style={localStyles.caughtBadge}>
|
|
263
|
-
<Text style={localStyles.caughtBadgeText}>{t('crash.handledBadge')}</Text>
|
|
264
|
-
</View>
|
|
265
|
-
)}
|
|
266
|
-
|
|
267
|
-
<View
|
|
268
|
-
style={[
|
|
269
|
-
localStyles.typeBadge,
|
|
270
|
-
{backgroundColor: typeBadgeBg},
|
|
271
|
-
]}>
|
|
272
|
-
<Text
|
|
273
|
-
style={[
|
|
274
|
-
localStyles.typeBadgeText,
|
|
275
|
-
{color: typeBadgeColor},
|
|
276
|
-
]}>
|
|
277
|
-
{typeLabel}
|
|
278
|
-
</Text>
|
|
279
|
-
</View>
|
|
280
|
-
</View>
|
|
281
|
-
|
|
282
|
-
<View style={localStyles.timeRow}>
|
|
283
|
-
<ClockIcon size={11} color={AppColors.grayTextWeak} />
|
|
284
|
-
<Text style={localStyles.timestampText}>
|
|
285
|
-
{item.timeStr || new Date(item.timestamp).toLocaleTimeString()}
|
|
286
|
-
</Text>
|
|
287
|
-
<Text style={localStyles.relativeTimeText}>
|
|
288
|
-
{getRelativeTime(item.timestamp)}
|
|
289
|
-
</Text>
|
|
290
|
-
</View>
|
|
291
|
-
</View>
|
|
292
|
-
|
|
293
|
-
{/* Error Message */}
|
|
294
|
-
<View style={{marginVertical: 6}}>
|
|
295
|
-
<HighlightText
|
|
296
|
-
text={item.message || t('crash.unknownException')}
|
|
297
|
-
highlight={searchQuery}
|
|
298
|
-
numberOfLines={3}
|
|
299
|
-
style={localStyles.errorMessageText}
|
|
300
|
-
/>
|
|
301
|
-
</View>
|
|
302
|
-
|
|
303
|
-
{/* Top stack frame location if available */}
|
|
304
|
-
{topFrame && (
|
|
305
|
-
<View style={localStyles.locationRow}>
|
|
306
|
-
<TerminalIcon size={12} color={AppColors.grayTextWeak} />
|
|
307
|
-
<Text
|
|
308
|
-
numberOfLines={1}
|
|
309
|
-
ellipsizeMode="middle"
|
|
310
|
-
style={localStyles.locationText}>
|
|
311
|
-
{topFrame.method !== '<anonymous>' ? `${topFrame.method} ` : ''}
|
|
312
|
-
<Text style={{color: AppColors.purple, fontFamily: AppFonts.interBold}}>
|
|
313
|
-
{topFrame.file}:{topFrame.lineNumber}
|
|
314
|
-
</Text>
|
|
315
|
-
</Text>
|
|
316
|
-
</View>
|
|
317
|
-
)}
|
|
318
|
-
|
|
319
|
-
{/* Footer row: Actions */}
|
|
320
|
-
<View style={localStyles.cardFooter}>
|
|
321
|
-
<View style={{flexDirection: 'row', alignItems: 'center', gap: 6, flexWrap: 'wrap'}}>
|
|
322
|
-
{item.deviceInfo && (
|
|
323
|
-
<View style={localStyles.metaPill}>
|
|
324
|
-
{item.deviceInfo.platform === 'ios' ? (
|
|
325
|
-
<AppleIcon size={10} color={AppColors.grayText} />
|
|
326
|
-
) : item.deviceInfo.platform === 'android' ? (
|
|
327
|
-
<AndroidIcon size={10} color={AppColors.grayText} />
|
|
328
|
-
) : null}
|
|
329
|
-
<Text style={localStyles.metaPillText}>
|
|
330
|
-
{item.deviceInfo.platform?.toUpperCase()}{' '}
|
|
331
|
-
{item.deviceInfo.osVersion || ''}
|
|
332
|
-
</Text>
|
|
333
|
-
</View>
|
|
334
|
-
)}
|
|
335
|
-
{item.deviceInfo && (
|
|
336
|
-
<View style={localStyles.metaPill}>
|
|
337
|
-
<Text style={localStyles.metaPillText}>
|
|
338
|
-
{item.deviceInfo.isHermes ? 'Hermes' : 'JSC'}
|
|
339
|
-
</Text>
|
|
340
|
-
</View>
|
|
341
|
-
)}
|
|
342
|
-
{item.parsedStack && item.parsedStack.length > 0 && (
|
|
343
|
-
<View style={localStyles.metaPill}>
|
|
344
|
-
<CodeBracketsIcon size={10} color={AppColors.grayText} />
|
|
345
|
-
<Text style={localStyles.metaPillText}>
|
|
346
|
-
{item.parsedStack.length}
|
|
347
|
-
</Text>
|
|
348
|
-
</View>
|
|
349
|
-
)}
|
|
350
|
-
{item.breadcrumbs && item.breadcrumbs.length > 0 && (
|
|
351
|
-
<View style={localStyles.metaPill}>
|
|
352
|
-
<RepeatIcon size={10} color={AppColors.grayText} />
|
|
353
|
-
<Text style={localStyles.metaPillText}>
|
|
354
|
-
{item.breadcrumbs.length} trail
|
|
355
|
-
</Text>
|
|
356
|
-
</View>
|
|
357
|
-
)}
|
|
358
|
-
{item.memoryInfo && (
|
|
359
|
-
<View style={localStyles.metaPill}>
|
|
360
|
-
<Text style={localStyles.metaPillText}>
|
|
361
|
-
{item.memoryInfo.usedJSHeapSize} MB
|
|
362
|
-
</Text>
|
|
363
|
-
</View>
|
|
364
|
-
)}
|
|
365
|
-
</View>
|
|
366
|
-
</View>
|
|
367
|
-
</TouchableScale>
|
|
368
|
-
</AnimatedEntrance>
|
|
369
|
-
);
|
|
370
|
-
},
|
|
371
|
-
[searchQuery, setSelectedCrash],
|
|
372
|
-
);
|
|
373
|
-
|
|
374
|
-
return (
|
|
375
|
-
<View style={localStyles.container}>
|
|
376
|
-
{crashRecords.length > 0 && (
|
|
377
|
-
<>
|
|
378
|
-
{/* ─── Top Stats Bar ─── */}
|
|
379
|
-
<View style={localStyles.statsBar}>
|
|
380
|
-
<ScrollView
|
|
381
|
-
horizontal
|
|
382
|
-
showsHorizontalScrollIndicator={false}
|
|
383
|
-
contentContainerStyle={localStyles.statsScrollContent}>
|
|
384
|
-
<View style={[localStyles.statChip, localStyles.statChipActive]}>
|
|
385
|
-
<Text style={localStyles.statChipValue}>{stats.total}</Text>
|
|
386
|
-
<Text style={localStyles.statChipLabel}>{t('crash.statCrashes')}</Text>
|
|
387
|
-
</View>
|
|
388
|
-
|
|
389
|
-
<View style={localStyles.statChip}>
|
|
390
|
-
<Text style={[localStyles.statChipValue, {color: AppColors.errorColor}]}>
|
|
391
|
-
{stats.fatalCount}
|
|
392
|
-
</Text>
|
|
393
|
-
<Text style={localStyles.statChipLabel}>{t('crash.statFatal')}</Text>
|
|
394
|
-
</View>
|
|
395
|
-
|
|
396
|
-
<View style={localStyles.statChip}>
|
|
397
|
-
<Text style={[localStyles.statChipValue, {color: AppColors.offerPurple}]}>
|
|
398
|
-
{stats.jsCount}
|
|
399
|
-
</Text>
|
|
400
|
-
<Text style={localStyles.statChipLabel}>{t('crash.statJsErrors')}</Text>
|
|
401
|
-
</View>
|
|
402
|
-
|
|
403
|
-
<View style={localStyles.statChip}>
|
|
404
|
-
<Text style={[localStyles.statChipValue, {color: AppColors.darkOrange}]}>
|
|
405
|
-
{stats.promiseCount}
|
|
406
|
-
</Text>
|
|
407
|
-
<Text style={localStyles.statChipLabel}>{t('crash.statPromises')}</Text>
|
|
408
|
-
</View>
|
|
409
|
-
|
|
410
|
-
<View style={localStyles.statChip}>
|
|
411
|
-
<Text style={[localStyles.statChipValue, {color: AppColors.purple}]}>
|
|
412
|
-
{stats.renderCount}
|
|
413
|
-
</Text>
|
|
414
|
-
<Text style={localStyles.statChipLabel}>{t('crash.statRender')}</Text>
|
|
415
|
-
</View>
|
|
416
|
-
|
|
417
|
-
<View style={localStyles.statChip}>
|
|
418
|
-
<Text style={[localStyles.statChipValue, {color: AppColors.skyBlue}]}>
|
|
419
|
-
{stats.nativeCount}
|
|
420
|
-
</Text>
|
|
421
|
-
<Text style={localStyles.statChipLabel}>{t('crash.statNative')}</Text>
|
|
422
|
-
</View>
|
|
423
|
-
</ScrollView>
|
|
424
|
-
</View>
|
|
425
|
-
|
|
426
|
-
{/* ─── Search & Controls ─── */}
|
|
427
|
-
<View style={localStyles.controlsContainer}>
|
|
428
|
-
<View style={localStyles.searchRow}>
|
|
429
|
-
<View style={localStyles.searchInputWrapper}>
|
|
430
|
-
<SearchIcon color={AppColors.grayTextWeak} size={14} />
|
|
431
|
-
<TextInput
|
|
432
|
-
value={searchQuery}
|
|
433
|
-
onChangeText={setSearchQuery}
|
|
434
|
-
placeholder={t('crash.searchPlaceholder')}
|
|
435
|
-
placeholderTextColor={AppColors.grayTextWeak}
|
|
436
|
-
style={localStyles.searchInput}
|
|
437
|
-
autoCapitalize="none"
|
|
438
|
-
autoCorrect={false}
|
|
439
|
-
/>
|
|
440
|
-
{searchQuery.length > 0 && (
|
|
441
|
-
<View style={{flexDirection: 'row', alignItems: 'center', gap: 4}}>
|
|
442
|
-
<View
|
|
443
|
-
style={{
|
|
444
|
-
backgroundColor: `${AppColors.purple}20`,
|
|
445
|
-
borderRadius: 10,
|
|
446
|
-
paddingHorizontal: 6,
|
|
447
|
-
paddingVertical: 1.5,
|
|
448
|
-
}}>
|
|
449
|
-
<Text
|
|
450
|
-
style={{
|
|
451
|
-
color: AppColors.purple,
|
|
452
|
-
fontSize: 9.5,
|
|
453
|
-
fontFamily: AppFonts.interBold,
|
|
454
|
-
}}>
|
|
455
|
-
{filteredList.length}
|
|
456
|
-
</Text>
|
|
457
|
-
</View>
|
|
458
|
-
<TouchableOpacity onPress={() => setSearchQuery('')} hitSlop={8}>
|
|
459
|
-
<ClearIcon color={AppColors.grayTextWeak} size={14} />
|
|
460
|
-
</TouchableOpacity>
|
|
461
|
-
</View>
|
|
462
|
-
)}
|
|
463
|
-
</View>
|
|
464
|
-
|
|
465
|
-
{/* Crash Filters */}
|
|
466
|
-
<TouchableScale
|
|
467
|
-
onPress={() => setIsFilterModalOpen(true)}
|
|
468
|
-
style={[
|
|
469
|
-
localStyles.filterButton,
|
|
470
|
-
!isCrashFiltersDefault(crashFilters) && {
|
|
471
|
-
borderColor: `${AppColors.brandPurple}60`,
|
|
472
|
-
backgroundColor: `${AppColors.brandPurple}15`,
|
|
473
|
-
},
|
|
474
|
-
]}>
|
|
475
|
-
<FilterIcon
|
|
476
|
-
size={14}
|
|
477
|
-
color={
|
|
478
|
-
isCrashFiltersDefault(crashFilters)
|
|
479
|
-
? AppColors.grayTextStrong
|
|
480
|
-
: AppColors.brandPurple
|
|
481
|
-
}
|
|
482
|
-
/>
|
|
483
|
-
{!isCrashFiltersDefault(crashFilters) && (
|
|
484
|
-
<View
|
|
485
|
-
style={{
|
|
486
|
-
position: 'absolute',
|
|
487
|
-
top: 2,
|
|
488
|
-
right: 2,
|
|
489
|
-
width: 7,
|
|
490
|
-
height: 7,
|
|
491
|
-
borderRadius: 3.5,
|
|
492
|
-
backgroundColor: AppColors.darkOrange,
|
|
493
|
-
borderWidth: 1,
|
|
494
|
-
borderColor: AppColors.white,
|
|
495
|
-
}}
|
|
496
|
-
/>
|
|
497
|
-
)}
|
|
498
|
-
</TouchableScale>
|
|
499
|
-
|
|
500
|
-
{/* Clear Crashes */}
|
|
501
|
-
<TouchableScale
|
|
502
|
-
onPress={handleClearAll}
|
|
503
|
-
style={localStyles.clearButton}>
|
|
504
|
-
<TrashIcon size={14} color={AppColors.errorColor} />
|
|
505
|
-
</TouchableScale>
|
|
506
|
-
</View>
|
|
507
|
-
|
|
508
|
-
<FeatureUnderDevNotice featureName="Crash & Exception Sentinel" />
|
|
509
|
-
|
|
510
|
-
{/* ─── Filter Chips ─── */}
|
|
511
|
-
<ScrollView
|
|
512
|
-
horizontal
|
|
513
|
-
showsHorizontalScrollIndicator={false}
|
|
514
|
-
contentContainerStyle={localStyles.filterScrollContent}>
|
|
515
|
-
{(
|
|
516
|
-
[
|
|
517
|
-
{key: 'all', label: t('crash.filterAll'), Icon: LayersIcon},
|
|
518
|
-
{key: 'fatal', label: t('crash.filterFatal'), Icon: SkullIcon},
|
|
519
|
-
{key: 'js', label: t('crash.filterJsError'), Icon: JsIcon},
|
|
520
|
-
{key: 'promise', label: t('crash.filterPromise'), Icon: HourglassIcon},
|
|
521
|
-
{key: 'render', label: t('crash.filterRender'), Icon: LayoutIcon},
|
|
522
|
-
{key: 'native', label: t('crash.filterNative'), Icon: ChipIcon},
|
|
523
|
-
] as const
|
|
524
|
-
).map(chip => {
|
|
525
|
-
const isActive = filterType === chip.key;
|
|
526
|
-
return (
|
|
527
|
-
<TouchableOpacity
|
|
528
|
-
key={chip.key}
|
|
529
|
-
onPress={() => setFilterType(chip.key)}
|
|
530
|
-
style={[
|
|
531
|
-
localStyles.filterChip,
|
|
532
|
-
isActive && localStyles.filterChipActive,
|
|
533
|
-
]}>
|
|
534
|
-
<chip.Icon
|
|
535
|
-
size={12}
|
|
536
|
-
color={isActive ? AppColors.white : AppColors.grayTextStrong}
|
|
537
|
-
/>
|
|
538
|
-
<Text
|
|
539
|
-
style={[
|
|
540
|
-
localStyles.filterChipText,
|
|
541
|
-
isActive && localStyles.filterChipTextActive,
|
|
542
|
-
]}>
|
|
543
|
-
{chip.label}
|
|
544
|
-
</Text>
|
|
545
|
-
</TouchableOpacity>
|
|
546
|
-
);
|
|
547
|
-
})}
|
|
548
|
-
</ScrollView>
|
|
549
|
-
</View>
|
|
550
|
-
</>
|
|
551
|
-
)}
|
|
552
|
-
|
|
553
|
-
{/* ─── Crash List or Empty State ─── */}
|
|
554
|
-
{filteredList.length === 0 ? (
|
|
555
|
-
<ScrollView
|
|
556
|
-
contentContainerStyle={localStyles.emptyContainer}
|
|
557
|
-
showsVerticalScrollIndicator={false}>
|
|
558
|
-
<View style={localStyles.emptyIconCircle}>
|
|
559
|
-
<ShieldAlertIcon size={38} color={AppColors.greenColor} />
|
|
560
|
-
</View>
|
|
561
|
-
<Text style={localStyles.emptyTitle}>
|
|
562
|
-
{searchQuery.length > 0
|
|
563
|
-
? 'No matching crash entries'
|
|
564
|
-
: filterType !== 'all' || !isCrashFiltersDefault(crashFilters)
|
|
565
|
-
? 'No crashes match filters'
|
|
566
|
-
: t('crash.emptyTitle')}
|
|
567
|
-
</Text>
|
|
568
|
-
<Text style={localStyles.emptySub}>
|
|
569
|
-
{searchQuery
|
|
570
|
-
? `No crash entries matched "${searchQuery}"`
|
|
571
|
-
: filterType !== 'all' || !isCrashFiltersDefault(crashFilters)
|
|
572
|
-
? 'Try adjusting your filters or search keywords.'
|
|
573
|
-
: t('crash.emptySubtitle')}
|
|
574
|
-
</Text>
|
|
575
|
-
{(searchQuery.length > 0 ||
|
|
576
|
-
filterType !== 'all' ||
|
|
577
|
-
!isCrashFiltersDefault(crashFilters)) && (
|
|
578
|
-
<TouchableScale
|
|
579
|
-
onPress={() => {
|
|
580
|
-
setSearchQuery('');
|
|
581
|
-
setFilterType('all');
|
|
582
|
-
setCrashFilters(DEFAULT_CRASH_FILTERS);
|
|
583
|
-
}}
|
|
584
|
-
style={{
|
|
585
|
-
marginTop: 10,
|
|
586
|
-
paddingHorizontal: 14,
|
|
587
|
-
paddingVertical: 7,
|
|
588
|
-
borderRadius: 8,
|
|
589
|
-
backgroundColor: AppColors.purple,
|
|
590
|
-
}}>
|
|
591
|
-
<Text
|
|
592
|
-
style={{
|
|
593
|
-
fontFamily: AppFonts.interBold,
|
|
594
|
-
fontSize: 11.5,
|
|
595
|
-
color: AppColors.white,
|
|
596
|
-
}}>
|
|
597
|
-
Clear Search & Filters
|
|
598
|
-
</Text>
|
|
599
|
-
</TouchableScale>
|
|
600
|
-
)}
|
|
601
|
-
</ScrollView>
|
|
602
|
-
) : (
|
|
603
|
-
<>
|
|
604
|
-
<FlatList
|
|
605
|
-
ref={listRef}
|
|
606
|
-
data={filteredList}
|
|
607
|
-
keyExtractor={item => item.id}
|
|
608
|
-
renderItem={renderCard}
|
|
609
|
-
initialNumToRender={12}
|
|
610
|
-
maxToRenderPerBatch={8}
|
|
611
|
-
windowSize={5}
|
|
612
|
-
removeClippedSubviews={Platform.OS === 'android'}
|
|
613
|
-
renderToHardwareTextureAndroid={true}
|
|
614
|
-
contentContainerStyle={localStyles.listContent}
|
|
615
|
-
showsVerticalScrollIndicator={false}
|
|
616
|
-
ListFooterComponent={<EndOfListFooter />}
|
|
617
|
-
/>
|
|
618
|
-
</>
|
|
619
|
-
)}
|
|
620
|
-
|
|
621
|
-
{/* Filter Modal */}
|
|
622
|
-
<CrashFilterModal
|
|
623
|
-
visible={isFilterModalOpen}
|
|
624
|
-
onClose={() => setIsFilterModalOpen(false)}
|
|
625
|
-
filters={crashFilters}
|
|
626
|
-
onApply={setCrashFilters}
|
|
627
|
-
searchQuery={searchQuery}
|
|
628
|
-
/>
|
|
629
|
-
</View>
|
|
630
|
-
);
|
|
631
|
-
});
|
|
632
|
-
|
|
633
|
-
export default CrashTab;
|
|
634
|
-
|
|
635
|
-
const localStyles = StyleSheet.create({
|
|
636
|
-
container: {
|
|
637
|
-
flex: 1,
|
|
638
|
-
backgroundColor: AppColors.grayBackground,
|
|
639
|
-
},
|
|
640
|
-
statsBar: {
|
|
641
|
-
backgroundColor: AppColors.primaryLight,
|
|
642
|
-
borderBottomWidth: 1,
|
|
643
|
-
borderBottomColor: AppColors.grayBorderSecondary,
|
|
644
|
-
paddingVertical: 10,
|
|
645
|
-
},
|
|
646
|
-
statsScrollContent: {
|
|
647
|
-
paddingHorizontal: 16,
|
|
648
|
-
gap: 8,
|
|
649
|
-
},
|
|
650
|
-
statChip: {
|
|
651
|
-
flexDirection: 'row',
|
|
652
|
-
alignItems: 'center',
|
|
653
|
-
gap: 6,
|
|
654
|
-
paddingHorizontal: 10,
|
|
655
|
-
paddingVertical: 5,
|
|
656
|
-
borderRadius: 8,
|
|
657
|
-
backgroundColor: AppColors.purpleShade50,
|
|
658
|
-
borderWidth: 1,
|
|
659
|
-
borderColor: `${AppColors.purple}14`,
|
|
660
|
-
},
|
|
661
|
-
statChipActive: {
|
|
662
|
-
backgroundColor: `${AppColors.purple}14`,
|
|
663
|
-
borderColor: `${AppColors.purple}33`,
|
|
664
|
-
},
|
|
665
|
-
statChipValue: {
|
|
666
|
-
fontFamily: AppFonts.interBold,
|
|
667
|
-
fontSize: 13,
|
|
668
|
-
color: AppColors.primaryBlack,
|
|
669
|
-
},
|
|
670
|
-
statChipLabel: {
|
|
671
|
-
fontFamily: AppFonts.interMedium,
|
|
672
|
-
fontSize: 11,
|
|
673
|
-
color: AppColors.grayText,
|
|
674
|
-
},
|
|
675
|
-
controlsContainer: {
|
|
676
|
-
paddingHorizontal: 16,
|
|
677
|
-
paddingTop: 12,
|
|
678
|
-
paddingBottom: 6,
|
|
679
|
-
backgroundColor: AppColors.grayBackground,
|
|
680
|
-
},
|
|
681
|
-
searchRow: {
|
|
682
|
-
flexDirection: 'row',
|
|
683
|
-
alignItems: 'center',
|
|
684
|
-
gap: 8,
|
|
685
|
-
},
|
|
686
|
-
searchInputWrapper: {
|
|
687
|
-
flex: 1,
|
|
688
|
-
flexDirection: 'row',
|
|
689
|
-
alignItems: 'center',
|
|
690
|
-
backgroundColor: AppColors.primaryLight,
|
|
691
|
-
borderWidth: 1,
|
|
692
|
-
borderColor: AppColors.grayBorderSecondary,
|
|
693
|
-
borderRadius: 10,
|
|
694
|
-
paddingHorizontal: 10,
|
|
695
|
-
height: 38,
|
|
696
|
-
gap: 8,
|
|
697
|
-
},
|
|
698
|
-
searchInput: {
|
|
699
|
-
flex: 1,
|
|
700
|
-
fontFamily: AppFonts.interRegular,
|
|
701
|
-
fontSize: 13,
|
|
702
|
-
color: AppColors.primaryBlack,
|
|
703
|
-
paddingVertical: 0,
|
|
704
|
-
},
|
|
705
|
-
clearButton: {
|
|
706
|
-
width: 38,
|
|
707
|
-
height: 38,
|
|
708
|
-
borderRadius: 10,
|
|
709
|
-
backgroundColor: `${AppColors.errorColor}14`,
|
|
710
|
-
borderWidth: 1,
|
|
711
|
-
borderColor: `${AppColors.errorColor}22`,
|
|
712
|
-
alignItems: 'center',
|
|
713
|
-
justifyContent: 'center',
|
|
714
|
-
},
|
|
715
|
-
filterButton: {
|
|
716
|
-
width: 38,
|
|
717
|
-
height: 38,
|
|
718
|
-
borderRadius: 10,
|
|
719
|
-
backgroundColor: `${AppColors.brandPurple}0F`,
|
|
720
|
-
borderWidth: 1,
|
|
721
|
-
borderColor: `${AppColors.brandPurple}30`,
|
|
722
|
-
alignItems: 'center',
|
|
723
|
-
justifyContent: 'center',
|
|
724
|
-
},
|
|
725
|
-
filterScrollContent: {
|
|
726
|
-
paddingVertical: 10,
|
|
727
|
-
gap: 6,
|
|
728
|
-
},
|
|
729
|
-
filterChip: {
|
|
730
|
-
flexDirection: 'row',
|
|
731
|
-
alignItems: 'center',
|
|
732
|
-
gap: 5,
|
|
733
|
-
paddingHorizontal: 12,
|
|
734
|
-
paddingVertical: 6,
|
|
735
|
-
borderRadius: 8,
|
|
736
|
-
backgroundColor: AppColors.primaryLight,
|
|
737
|
-
borderWidth: 1,
|
|
738
|
-
borderColor: AppColors.grayBorderSecondary,
|
|
739
|
-
},
|
|
740
|
-
filterChipActive: {
|
|
741
|
-
backgroundColor: AppColors.purple,
|
|
742
|
-
borderColor: AppColors.purple,
|
|
743
|
-
},
|
|
744
|
-
filterChipText: {
|
|
745
|
-
fontFamily: AppFonts.interMedium,
|
|
746
|
-
fontSize: 12,
|
|
747
|
-
color: AppColors.grayText,
|
|
748
|
-
},
|
|
749
|
-
filterChipTextActive: {
|
|
750
|
-
fontFamily: AppFonts.interBold,
|
|
751
|
-
color: AppColors.white,
|
|
752
|
-
},
|
|
753
|
-
listContent: {
|
|
754
|
-
paddingHorizontal: 16,
|
|
755
|
-
paddingTop: 4,
|
|
756
|
-
paddingBottom: 24,
|
|
757
|
-
gap: 10,
|
|
758
|
-
},
|
|
759
|
-
cardContainer: {
|
|
760
|
-
backgroundColor: AppColors.primaryLight,
|
|
761
|
-
borderRadius: 12,
|
|
762
|
-
borderWidth: 1,
|
|
763
|
-
borderColor: AppColors.grayBorderSecondary,
|
|
764
|
-
padding: 14,
|
|
765
|
-
shadowColor: AppColors.shadowColorString,
|
|
766
|
-
shadowOffset: {width: 0, height: 1},
|
|
767
|
-
shadowOpacity: 0.05,
|
|
768
|
-
shadowRadius: 3,
|
|
769
|
-
elevation: 2,
|
|
770
|
-
},
|
|
771
|
-
fatalCardBorder: {
|
|
772
|
-
borderColor: `${AppColors.errorColor}44`,
|
|
773
|
-
},
|
|
774
|
-
cardHeader: {
|
|
775
|
-
flexDirection: 'row',
|
|
776
|
-
alignItems: 'center',
|
|
777
|
-
justifyContent: 'space-between',
|
|
778
|
-
},
|
|
779
|
-
badgeRow: {
|
|
780
|
-
flexDirection: 'row',
|
|
781
|
-
alignItems: 'center',
|
|
782
|
-
gap: 6,
|
|
783
|
-
flexShrink: 1,
|
|
784
|
-
},
|
|
785
|
-
sNoBadge: {
|
|
786
|
-
backgroundColor: AppColors.grayBackground,
|
|
787
|
-
borderWidth: 1,
|
|
788
|
-
borderColor: AppColors.grayBorderSecondary,
|
|
789
|
-
paddingHorizontal: 6,
|
|
790
|
-
paddingVertical: 3,
|
|
791
|
-
borderRadius: 5,
|
|
792
|
-
},
|
|
793
|
-
sNoBadgeText: {
|
|
794
|
-
fontFamily: AppFonts.interBold,
|
|
795
|
-
fontSize: 9.5,
|
|
796
|
-
color: AppColors.grayText,
|
|
797
|
-
letterSpacing: 0.3,
|
|
798
|
-
},
|
|
799
|
-
fatalBadge: {
|
|
800
|
-
flexDirection: 'row',
|
|
801
|
-
alignItems: 'center',
|
|
802
|
-
gap: 4,
|
|
803
|
-
backgroundColor: AppColors.errorColor,
|
|
804
|
-
paddingHorizontal: 6,
|
|
805
|
-
paddingVertical: 3,
|
|
806
|
-
borderRadius: 5,
|
|
807
|
-
},
|
|
808
|
-
fatalBadgeText: {
|
|
809
|
-
fontFamily: AppFonts.interBold,
|
|
810
|
-
fontSize: 9.5,
|
|
811
|
-
color: AppColors.white,
|
|
812
|
-
letterSpacing: 0.5,
|
|
813
|
-
},
|
|
814
|
-
caughtBadge: {
|
|
815
|
-
backgroundColor: `${AppColors.greenColor}1F`,
|
|
816
|
-
paddingHorizontal: 6,
|
|
817
|
-
paddingVertical: 3,
|
|
818
|
-
borderRadius: 5,
|
|
819
|
-
},
|
|
820
|
-
caughtBadgeText: {
|
|
821
|
-
fontFamily: AppFonts.interBold,
|
|
822
|
-
fontSize: 9.5,
|
|
823
|
-
color: AppColors.greenColor,
|
|
824
|
-
letterSpacing: 0.5,
|
|
825
|
-
},
|
|
826
|
-
typeBadge: {
|
|
827
|
-
paddingHorizontal: 6,
|
|
828
|
-
paddingVertical: 3,
|
|
829
|
-
borderRadius: 5,
|
|
830
|
-
},
|
|
831
|
-
typeBadgeText: {
|
|
832
|
-
fontFamily: AppFonts.interBold,
|
|
833
|
-
fontSize: 9.5,
|
|
834
|
-
letterSpacing: 0.5,
|
|
835
|
-
},
|
|
836
|
-
timeRow: {
|
|
837
|
-
flexDirection: 'row',
|
|
838
|
-
alignItems: 'center',
|
|
839
|
-
gap: 4,
|
|
840
|
-
flexShrink: 1,
|
|
841
|
-
},
|
|
842
|
-
timestampText: {
|
|
843
|
-
fontFamily: AppFonts.interRegular,
|
|
844
|
-
fontSize: 11,
|
|
845
|
-
color: AppColors.grayTextWeak,
|
|
846
|
-
},
|
|
847
|
-
relativeTimeText: {
|
|
848
|
-
fontFamily: AppFonts.interBold,
|
|
849
|
-
fontSize: 10,
|
|
850
|
-
color: AppColors.grayTextWeak,
|
|
851
|
-
backgroundColor: AppColors.grayBackground,
|
|
852
|
-
paddingHorizontal: 5,
|
|
853
|
-
paddingVertical: 1,
|
|
854
|
-
borderRadius: 4,
|
|
855
|
-
overflow: 'hidden',
|
|
856
|
-
},
|
|
857
|
-
errorMessageText: {
|
|
858
|
-
fontFamily: AppFonts.interBold,
|
|
859
|
-
fontSize: 13.5,
|
|
860
|
-
color: AppColors.primaryBlack,
|
|
861
|
-
lineHeight: 18,
|
|
862
|
-
},
|
|
863
|
-
locationRow: {
|
|
864
|
-
flexDirection: 'row',
|
|
865
|
-
alignItems: 'center',
|
|
866
|
-
gap: 6,
|
|
867
|
-
marginTop: 2,
|
|
868
|
-
marginBottom: 6,
|
|
869
|
-
backgroundColor: AppColors.purpleShade50,
|
|
870
|
-
paddingHorizontal: 8,
|
|
871
|
-
paddingVertical: 4,
|
|
872
|
-
borderRadius: 6,
|
|
873
|
-
},
|
|
874
|
-
locationText: {
|
|
875
|
-
fontFamily: AppFonts.interRegular,
|
|
876
|
-
fontSize: 11,
|
|
877
|
-
color: AppColors.grayText,
|
|
878
|
-
flex: 1,
|
|
879
|
-
},
|
|
880
|
-
cardFooter: {
|
|
881
|
-
flexDirection: 'row',
|
|
882
|
-
alignItems: 'center',
|
|
883
|
-
justifyContent: 'space-between',
|
|
884
|
-
marginTop: 6,
|
|
885
|
-
paddingTop: 8,
|
|
886
|
-
borderTopWidth: 1,
|
|
887
|
-
borderTopColor: AppColors.dividerColor,
|
|
888
|
-
},
|
|
889
|
-
metaPill: {
|
|
890
|
-
flexDirection: 'row',
|
|
891
|
-
alignItems: 'center',
|
|
892
|
-
gap: 4,
|
|
893
|
-
backgroundColor: AppColors.purpleShade50,
|
|
894
|
-
paddingHorizontal: 6,
|
|
895
|
-
paddingVertical: 2,
|
|
896
|
-
borderRadius: 4,
|
|
897
|
-
},
|
|
898
|
-
metaPillText: {
|
|
899
|
-
fontFamily: AppFonts.interMedium,
|
|
900
|
-
fontSize: 10,
|
|
901
|
-
color: AppColors.grayTextWeak,
|
|
902
|
-
},
|
|
903
|
-
emptyContainer: {
|
|
904
|
-
flexGrow: 1,
|
|
905
|
-
alignItems: 'center',
|
|
906
|
-
justifyContent: 'center',
|
|
907
|
-
padding: 32,
|
|
908
|
-
paddingBottom: 80,
|
|
909
|
-
},
|
|
910
|
-
emptyIconCircle: {
|
|
911
|
-
width: 72,
|
|
912
|
-
height: 72,
|
|
913
|
-
borderRadius: 36,
|
|
914
|
-
backgroundColor: `${AppColors.greenColor}1F`,
|
|
915
|
-
alignItems: 'center',
|
|
916
|
-
justifyContent: 'center',
|
|
917
|
-
marginBottom: 16,
|
|
918
|
-
},
|
|
919
|
-
emptyTitle: {
|
|
920
|
-
fontFamily: AppFonts.interBold,
|
|
921
|
-
fontSize: 17,
|
|
922
|
-
color: AppColors.primaryBlack,
|
|
923
|
-
marginBottom: 6,
|
|
924
|
-
},
|
|
925
|
-
emptySub: {
|
|
926
|
-
fontFamily: AppFonts.interRegular,
|
|
927
|
-
fontSize: 13,
|
|
928
|
-
color: AppColors.grayText,
|
|
929
|
-
textAlign: 'center',
|
|
930
|
-
lineHeight: 18,
|
|
931
|
-
maxWidth: 280,
|
|
932
|
-
},
|
|
933
|
-
});
|