react-native-inapp-inspector 2.0.5 → 2.0.7
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 +11 -0
- package/dist/commonjs/components/Inspector/AuditTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/AuditTab.js +741 -0
- package/dist/commonjs/components/Inspector/DeviceTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/DeviceTab.js +717 -0
- package/dist/commonjs/components/Inspector/FirstTimeWalkthroughModal.d.ts +7 -0
- package/dist/commonjs/components/Inspector/FirstTimeWalkthroughModal.js +600 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.js +28 -25
- package/dist/commonjs/components/Inspector/MainScreen.js +19 -2
- package/dist/commonjs/components/Inspector/NetworkDetail.js +15 -0
- package/dist/commonjs/components/Inspector/PerformanceHud.d.ts +7 -0
- package/dist/commonjs/components/Inspector/PerformanceHud.js +210 -0
- package/dist/commonjs/components/Inspector/PerformanceTab.js +30 -18
- package/dist/commonjs/components/Inspector/RequestReplayModal.d.ts +9 -0
- package/dist/commonjs/components/Inspector/RequestReplayModal.js +792 -0
- package/dist/commonjs/components/Inspector/RequestReplayView.d.ts +8 -0
- package/dist/commonjs/components/Inspector/RequestReplayView.js +871 -0
- package/dist/commonjs/components/Inspector/SettingsPanel.js +448 -49
- package/dist/commonjs/components/Inspector/StorageTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/StorageTab.js +610 -0
- package/dist/commonjs/components/Inspector/TabBar.js +23 -2
- package/dist/commonjs/components/NetworkIcons.d.ts +12 -0
- package/dist/commonjs/components/NetworkIcons.js +72 -3
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/storageInspector.d.ts +13 -0
- package/dist/commonjs/customHooks/storageInspector.js +179 -0
- package/dist/commonjs/helpers/deviceInfo.d.ts +4 -0
- package/dist/commonjs/helpers/deviceInfo.js +94 -0
- package/dist/commonjs/helpers/index.d.ts +2 -0
- package/dist/commonjs/helpers/index.js +12 -1
- package/dist/commonjs/helpers/packageAuditor.d.ts +5 -0
- package/dist/commonjs/helpers/packageAuditor.js +182 -0
- package/dist/commonjs/helpers/settingsStore.d.ts +1 -1
- package/dist/commonjs/helpers/settingsStore.js +4 -2
- package/dist/commonjs/i18n/locales/en.json +3 -2
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.js +127 -9
- package/dist/commonjs/native/NativeInspector.d.ts +1 -0
- package/dist/commonjs/types/enums.d.ts +7 -0
- package/dist/commonjs/types/enums.js +7 -0
- package/dist/commonjs/types/interfaces.d.ts +77 -0
- package/dist/esm/components/Inspector/AuditTab.d.ts +3 -0
- package/dist/esm/components/Inspector/AuditTab.js +702 -0
- package/dist/esm/components/Inspector/DeviceTab.d.ts +3 -0
- package/dist/esm/components/Inspector/DeviceTab.js +678 -0
- package/dist/esm/components/Inspector/FirstTimeWalkthroughModal.d.ts +7 -0
- package/dist/esm/components/Inspector/FirstTimeWalkthroughModal.js +560 -0
- package/dist/esm/components/Inspector/InspectorHeader.js +28 -25
- package/dist/esm/components/Inspector/MainScreen.js +19 -2
- package/dist/esm/components/Inspector/NetworkDetail.js +16 -1
- package/dist/esm/components/Inspector/PerformanceHud.d.ts +7 -0
- package/dist/esm/components/Inspector/PerformanceHud.js +170 -0
- package/dist/esm/components/Inspector/PerformanceTab.js +31 -19
- package/dist/esm/components/Inspector/RequestReplayModal.d.ts +9 -0
- package/dist/esm/components/Inspector/RequestReplayModal.js +752 -0
- package/dist/esm/components/Inspector/RequestReplayView.d.ts +8 -0
- package/dist/esm/components/Inspector/RequestReplayView.js +831 -0
- package/dist/esm/components/Inspector/SettingsPanel.js +449 -50
- package/dist/esm/components/Inspector/StorageTab.d.ts +3 -0
- package/dist/esm/components/Inspector/StorageTab.js +571 -0
- package/dist/esm/components/Inspector/TabBar.js +24 -3
- package/dist/esm/components/NetworkIcons.d.ts +12 -0
- package/dist/esm/components/NetworkIcons.js +57 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/storageInspector.d.ts +13 -0
- package/dist/esm/customHooks/storageInspector.js +170 -0
- package/dist/esm/helpers/deviceInfo.d.ts +4 -0
- package/dist/esm/helpers/deviceInfo.js +89 -0
- package/dist/esm/helpers/index.d.ts +2 -0
- package/dist/esm/helpers/index.js +10 -0
- package/dist/esm/helpers/packageAuditor.d.ts +5 -0
- package/dist/esm/helpers/packageAuditor.js +173 -0
- package/dist/esm/helpers/settingsStore.d.ts +1 -1
- package/dist/esm/helpers/settingsStore.js +4 -2
- package/dist/esm/i18n/locales/en.json +3 -2
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +123 -8
- package/dist/esm/native/NativeInspector.d.ts +1 -0
- package/dist/esm/types/enums.d.ts +7 -0
- package/dist/esm/types/enums.js +7 -0
- package/dist/esm/types/interfaces.d.ts +77 -0
- package/ios/NetworkInspectorModule.mm +12 -5
- package/package.json +4 -1
|
@@ -18,13 +18,13 @@ import { isReduxConnected } from '../../customHooks/reduxLogger';
|
|
|
18
18
|
import { isAnalyticsConnected } from '../../customHooks/analyticsLogger';
|
|
19
19
|
import { useTranslation } from '../../i18n';
|
|
20
20
|
import { getTelemetryConsentStatus, setTelemetryConsent, sendSessionTelemetryPing, } from '../../helpers/telemetry';
|
|
21
|
-
import { SignalIcon, TerminalIcon, AnalyticsIcon, SettingsIcon, SunIcon, MoonIcon, ScreenIcon, MotionIcon, LayersIcon, EyeIcon, CheckIcon, TrashIcon, PackageIcon, ReduxIcon, PerformanceIcon, CrashIcon, ShieldAlertIcon, ForwardChevronIcon, ChevronDownIcon, NpmIcon, } from '../NetworkIcons';
|
|
21
|
+
import { SignalIcon, TerminalIcon, AnalyticsIcon, SettingsIcon, GlobeIcon, SunIcon, MoonIcon, ScreenIcon, MotionIcon, LayersIcon, EyeIcon, CheckIcon, TrashIcon, PackageIcon, ReduxIcon, PerformanceIcon, CrashIcon, ShieldAlertIcon, ForwardChevronIcon, ChevronDownIcon, NpmIcon, DatabaseIcon, DevicePhoneIcon, ShieldCheckIcon, CpuIcon, } from '../NetworkIcons';
|
|
22
22
|
import { LIB_VERSION } from '../../constants';
|
|
23
23
|
import { copyToClipboard } from '../../helpers';
|
|
24
24
|
import { showToast } from '../../helpers/toast';
|
|
25
25
|
const SettingsPanel = () => {
|
|
26
26
|
const { t } = useTranslation();
|
|
27
|
-
const { settingsPage, setSettingsPage, settingsActiveSubTab, setSettingsActiveSubTab, tabVisibility, toggleTabVisibility, defaultTab, setDefaultTab, isDark, setIsDark, modalHeightPercent, setModalHeightPercent, modalAnimationType, setModalAnimationType, showDuplicateLogs, setShowDuplicateLogs, showUpdateToast, setShowUpdateToast, showConsoleLevels, setShowConsoleLevels, resetToDefaults, storage, logs, consoleLogs, analyticsEvents, reduxState, maxNetworkLogs, setMaxNetworkLogs, maxConsoleLogs, setMaxConsoleLogs, maxAnalyticsEventsLimit, setMaxAnalyticsEventsLimit, isAutoRamLimitEnabled, setIsAutoRamLimitEnabled, deviceFreeRamMb, reduxAutoRefresh, setReduxAutoRefreshState, reduxExpandDepth, setReduxExpandDepth, switchActiveTab, setSelected, setSelectedEvent, setReduxState, crashRecords, maxCrashLogs, setMaxCrashLogs, updateAvailable, latestNpmVersion, } = useInspector();
|
|
27
|
+
const { settingsPage, setSettingsPage, settingsActiveSubTab, setSettingsActiveSubTab, tabVisibility, toggleTabVisibility, defaultTab, setDefaultTab, isDark, setIsDark, modalHeightPercent, setModalHeightPercent, modalAnimationType, setModalAnimationType, showDuplicateLogs, setShowDuplicateLogs, showUpdateToast, setShowUpdateToast, showConsoleLevels, setShowConsoleLevels, resetToDefaults, storage, logs, consoleLogs, analyticsEvents, reduxState, maxNetworkLogs, setMaxNetworkLogs, maxConsoleLogs, setMaxConsoleLogs, maxAnalyticsEventsLimit, setMaxAnalyticsEventsLimit, isAutoRamLimitEnabled, setIsAutoRamLimitEnabled, deviceFreeRamMb, isPerformanceHudEnabled, setIsPerformanceHudEnabled, reduxAutoRefresh, setReduxAutoRefreshState, reduxExpandDepth, setReduxExpandDepth, switchActiveTab, setSelected, setSelectedEvent, setReduxState, crashRecords, maxCrashLogs, setMaxCrashLogs, updateAvailable, latestNpmVersion, openWalkthrough, deviceInfo, auditReport, storageEntries, } = useInspector();
|
|
28
28
|
const [stagedHeight, setStagedHeight] = useState(modalHeightPercent);
|
|
29
29
|
const [telemetryConsent, setTelemetryConsentState] = useState(true);
|
|
30
30
|
useEffect(() => {
|
|
@@ -63,6 +63,27 @@ const SettingsPanel = () => {
|
|
|
63
63
|
icon: 'logs',
|
|
64
64
|
desc: 'Terminal console logs, warnings, errors & stack traces',
|
|
65
65
|
},
|
|
66
|
+
{
|
|
67
|
+
key: 'storage',
|
|
68
|
+
label: 'Storage (AsyncStorage)',
|
|
69
|
+
category: 'core',
|
|
70
|
+
icon: 'storage',
|
|
71
|
+
desc: 'Browse, edit, create and delete local key-value storage & JSON',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
key: 'device',
|
|
75
|
+
label: 'Device & System Info',
|
|
76
|
+
category: 'diagnostic',
|
|
77
|
+
icon: 'device',
|
|
78
|
+
desc: 'Hermes runtime, Fabric New Arch, screen metrics & build info',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
key: 'audit',
|
|
82
|
+
label: 'Code Quality & Package Audit',
|
|
83
|
+
category: 'diagnostic',
|
|
84
|
+
icon: 'audit',
|
|
85
|
+
desc: 'Audit dependencies, peer conflicts, TS schema errors & React Native anti-patterns',
|
|
86
|
+
},
|
|
66
87
|
{
|
|
67
88
|
key: 'performance',
|
|
68
89
|
label: 'Performance Tracker',
|
|
@@ -105,6 +126,9 @@ const SettingsPanel = () => {
|
|
|
105
126
|
logs: Boolean(tabVisibility?.logs),
|
|
106
127
|
analytics: Boolean(tabVisibility?.analytics),
|
|
107
128
|
redux: Boolean(tabVisibility?.redux),
|
|
129
|
+
storage: Boolean(tabVisibility?.storage),
|
|
130
|
+
device: Boolean(tabVisibility?.device),
|
|
131
|
+
audit: Boolean(tabVisibility?.audit),
|
|
108
132
|
bundle: Boolean(tabVisibility?.bundle),
|
|
109
133
|
performance: Boolean(tabVisibility?.performance),
|
|
110
134
|
crash: Boolean(tabVisibility?.crash),
|
|
@@ -116,6 +140,9 @@ const SettingsPanel = () => {
|
|
|
116
140
|
logs: Boolean(tabVisibility?.logs),
|
|
117
141
|
analytics: Boolean(tabVisibility?.analytics),
|
|
118
142
|
redux: Boolean(tabVisibility?.redux),
|
|
143
|
+
storage: Boolean(tabVisibility?.storage),
|
|
144
|
+
device: Boolean(tabVisibility?.device),
|
|
145
|
+
audit: Boolean(tabVisibility?.audit),
|
|
119
146
|
bundle: Boolean(tabVisibility?.bundle),
|
|
120
147
|
performance: Boolean(tabVisibility?.performance),
|
|
121
148
|
crash: Boolean(tabVisibility?.crash),
|
|
@@ -287,16 +314,17 @@ const SettingsPanel = () => {
|
|
|
287
314
|
shadowRadius: 4,
|
|
288
315
|
shadowOffset: { width: 0, height: 2 },
|
|
289
316
|
}}>
|
|
317
|
+
{/* Tab 1: Modules & Tabs */}
|
|
290
318
|
<TouchableScale accessible={true} accessibilityRole="tab" accessibilityLabel={t('settings.modulesAndTools')} accessibilityState={{ selected: settingsActiveSubTab === 'module' }} onPress={() => {
|
|
291
319
|
animateNextLayout();
|
|
292
320
|
setSettingsActiveSubTab('module');
|
|
293
321
|
}} style={{
|
|
294
322
|
flex: 1,
|
|
295
|
-
paddingVertical:
|
|
323
|
+
paddingVertical: 8,
|
|
296
324
|
flexDirection: 'row',
|
|
297
325
|
alignItems: 'center',
|
|
298
326
|
justifyContent: 'center',
|
|
299
|
-
gap:
|
|
327
|
+
gap: 5,
|
|
300
328
|
borderRadius: 9,
|
|
301
329
|
backgroundColor: settingsActiveSubTab === 'module'
|
|
302
330
|
? AppColors.purple
|
|
@@ -304,11 +332,11 @@ const SettingsPanel = () => {
|
|
|
304
332
|
}}>
|
|
305
333
|
<LayersIcon color={settingsActiveSubTab === 'module'
|
|
306
334
|
? AppColors.white
|
|
307
|
-
: AppColors.grayText} size={
|
|
335
|
+
: AppColors.grayText} size={12.5}/>
|
|
308
336
|
<Text style={{
|
|
309
337
|
fontFamily: AppFonts.interBold,
|
|
310
|
-
fontSize:
|
|
311
|
-
lineHeight:
|
|
338
|
+
fontSize: 11.5,
|
|
339
|
+
lineHeight: 15,
|
|
312
340
|
color: settingsActiveSubTab === 'module'
|
|
313
341
|
? AppColors.white
|
|
314
342
|
: AppColors.grayText,
|
|
@@ -317,16 +345,48 @@ const SettingsPanel = () => {
|
|
|
317
345
|
</Text>
|
|
318
346
|
</TouchableScale>
|
|
319
347
|
|
|
348
|
+
{/* Tab 2: RAM & Limits */}
|
|
349
|
+
<TouchableScale accessible={true} accessibilityRole="tab" accessibilityLabel={t('settings.ramLimits')} accessibilityState={{ selected: settingsActiveSubTab === 'limits' }} onPress={() => {
|
|
350
|
+
animateNextLayout();
|
|
351
|
+
setSettingsActiveSubTab('limits');
|
|
352
|
+
}} style={{
|
|
353
|
+
flex: 1,
|
|
354
|
+
paddingVertical: 8,
|
|
355
|
+
flexDirection: 'row',
|
|
356
|
+
alignItems: 'center',
|
|
357
|
+
justifyContent: 'center',
|
|
358
|
+
gap: 5,
|
|
359
|
+
borderRadius: 9,
|
|
360
|
+
backgroundColor: settingsActiveSubTab === 'limits'
|
|
361
|
+
? AppColors.purple
|
|
362
|
+
: 'transparent',
|
|
363
|
+
}}>
|
|
364
|
+
<CpuIcon color={settingsActiveSubTab === 'limits'
|
|
365
|
+
? AppColors.white
|
|
366
|
+
: AppColors.grayText} size={12.5}/>
|
|
367
|
+
<Text style={{
|
|
368
|
+
fontFamily: AppFonts.interBold,
|
|
369
|
+
fontSize: 11.5,
|
|
370
|
+
lineHeight: 15,
|
|
371
|
+
color: settingsActiveSubTab === 'limits'
|
|
372
|
+
? AppColors.white
|
|
373
|
+
: AppColors.grayText,
|
|
374
|
+
}}>
|
|
375
|
+
{t('settings.ramLimits')}
|
|
376
|
+
</Text>
|
|
377
|
+
</TouchableScale>
|
|
378
|
+
|
|
379
|
+
{/* Tab 3: UI & Appearance */}
|
|
320
380
|
<TouchableScale accessible={true} accessibilityRole="tab" accessibilityLabel={t('settings.uiPreferences')} accessibilityState={{ selected: settingsActiveSubTab === 'ui' }} onPress={() => {
|
|
321
381
|
animateNextLayout();
|
|
322
382
|
setSettingsActiveSubTab('ui');
|
|
323
383
|
}} style={{
|
|
324
384
|
flex: 1,
|
|
325
|
-
paddingVertical:
|
|
385
|
+
paddingVertical: 8,
|
|
326
386
|
flexDirection: 'row',
|
|
327
387
|
alignItems: 'center',
|
|
328
388
|
justifyContent: 'center',
|
|
329
|
-
gap:
|
|
389
|
+
gap: 5,
|
|
330
390
|
borderRadius: 9,
|
|
331
391
|
backgroundColor: settingsActiveSubTab === 'ui'
|
|
332
392
|
? AppColors.purple
|
|
@@ -334,11 +394,11 @@ const SettingsPanel = () => {
|
|
|
334
394
|
}}>
|
|
335
395
|
<ScreenIcon color={settingsActiveSubTab === 'ui'
|
|
336
396
|
? AppColors.white
|
|
337
|
-
: AppColors.grayText} size={
|
|
397
|
+
: AppColors.grayText} size={12.5}/>
|
|
338
398
|
<Text style={{
|
|
339
399
|
fontFamily: AppFonts.interBold,
|
|
340
|
-
fontSize:
|
|
341
|
-
lineHeight:
|
|
400
|
+
fontSize: 11.5,
|
|
401
|
+
lineHeight: 15,
|
|
342
402
|
color: settingsActiveSubTab === 'ui'
|
|
343
403
|
? AppColors.white
|
|
344
404
|
: AppColors.grayText,
|
|
@@ -348,7 +408,7 @@ const SettingsPanel = () => {
|
|
|
348
408
|
</TouchableScale>
|
|
349
409
|
</View>
|
|
350
410
|
|
|
351
|
-
{settingsActiveSubTab === 'module'
|
|
411
|
+
{settingsActiveSubTab === 'module' && (<View style={{ gap: 12 }}>
|
|
352
412
|
{/* Individual Module Cards with Left Checkboxes */}
|
|
353
413
|
<View style={{ gap: 10 }}>
|
|
354
414
|
{allModules.map(moduleItem => {
|
|
@@ -364,17 +424,23 @@ const SettingsPanel = () => {
|
|
|
364
424
|
? `${logs.length} requests • Limit: ${maxNetworkLogs}`
|
|
365
425
|
: moduleItem.key === 'logs'
|
|
366
426
|
? `${consoleLogs.length} logs • Limit: ${maxConsoleLogs}`
|
|
367
|
-
: moduleItem.key === '
|
|
368
|
-
?
|
|
369
|
-
: moduleItem.key === '
|
|
370
|
-
? '
|
|
371
|
-
: moduleItem.key === '
|
|
372
|
-
? `${
|
|
373
|
-
: moduleItem.key === '
|
|
374
|
-
?
|
|
375
|
-
: moduleItem.key === '
|
|
376
|
-
?
|
|
377
|
-
: ''
|
|
427
|
+
: moduleItem.key === 'storage'
|
|
428
|
+
? `${storageEntries?.length || 0} keys • AsyncStorage/MMKV`
|
|
429
|
+
: moduleItem.key === 'device'
|
|
430
|
+
? `${deviceInfo?.platform ? deviceInfo.platform.toUpperCase() : 'Device'} • Hermes ${deviceInfo?.isHermes ? 'Enabled' : 'Off'}`
|
|
431
|
+
: moduleItem.key === 'audit'
|
|
432
|
+
? `${auditReport?.score != null ? `${auditReport.score}/100 Score • Quality Audit` : 'Package & Health Audit'}`
|
|
433
|
+
: moduleItem.key === 'performance'
|
|
434
|
+
? '60 FPS Target • Memory Telemetry'
|
|
435
|
+
: moduleItem.key === 'bundle'
|
|
436
|
+
? 'Metro Packager • Dependency Map'
|
|
437
|
+
: moduleItem.key === 'crash'
|
|
438
|
+
? `${crashRecords?.length || 0} crashes recorded • Crash Guard`
|
|
439
|
+
: moduleItem.key === 'analytics'
|
|
440
|
+
? `${analyticsEvents.length} events logged`
|
|
441
|
+
: moduleItem.key === 'redux'
|
|
442
|
+
? `${Object.keys(reduxState || {}).length} slices • Depth: ${reduxExpandDepth}`
|
|
443
|
+
: '';
|
|
378
444
|
return (<View key={moduleItem.key} style={{
|
|
379
445
|
backgroundColor: AppColors.primaryLight,
|
|
380
446
|
borderRadius: 14,
|
|
@@ -483,6 +549,15 @@ const SettingsPanel = () => {
|
|
|
483
549
|
{moduleItem.icon === 'analytics' && (<AnalyticsIcon color={isChecked
|
|
484
550
|
? AppColors.purple
|
|
485
551
|
: AppColors.grayTextWeak} size={16}/>)}
|
|
552
|
+
{moduleItem.icon === 'storage' && (<DatabaseIcon color={isChecked
|
|
553
|
+
? AppColors.purple
|
|
554
|
+
: AppColors.grayTextWeak} size={16}/>)}
|
|
555
|
+
{moduleItem.icon === 'device' && (<DevicePhoneIcon color={isChecked
|
|
556
|
+
? AppColors.purple
|
|
557
|
+
: AppColors.grayTextWeak} size={16}/>)}
|
|
558
|
+
{moduleItem.icon === 'audit' && (<ShieldCheckIcon color={isChecked
|
|
559
|
+
? AppColors.purple
|
|
560
|
+
: AppColors.grayTextWeak} size={16}/>)}
|
|
486
561
|
{moduleItem.icon === 'redux' && (<ReduxIcon color={isChecked
|
|
487
562
|
? AppColors.purple
|
|
488
563
|
: AppColors.grayTextWeak} size={16}/>)}
|
|
@@ -634,29 +709,29 @@ const SettingsPanel = () => {
|
|
|
634
709
|
borderTopColor: AppColors.dividerColor,
|
|
635
710
|
}}>
|
|
636
711
|
{/* Live Info Pill */}
|
|
637
|
-
<View style={{
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
712
|
+
{Boolean(liveStats) ? (<View style={{
|
|
713
|
+
flexDirection: 'row',
|
|
714
|
+
alignItems: 'center',
|
|
715
|
+
gap: 6,
|
|
716
|
+
flex: 1,
|
|
717
|
+
}}>
|
|
718
|
+
<View style={{
|
|
719
|
+
width: 6,
|
|
720
|
+
height: 6,
|
|
721
|
+
borderRadius: 3,
|
|
722
|
+
backgroundColor: isChecked
|
|
723
|
+
? AppColors.liveGreen
|
|
724
|
+
: AppColors.grayTextWeak,
|
|
725
|
+
}}/>
|
|
726
|
+
<Text style={{
|
|
727
|
+
fontFamily: AppFonts.interMedium,
|
|
728
|
+
fontSize: 11,
|
|
729
|
+
color: AppColors.grayText,
|
|
730
|
+
lineHeight: 14,
|
|
731
|
+
}}>
|
|
732
|
+
{liveStats}
|
|
733
|
+
</Text>
|
|
734
|
+
</View>) : (<View style={{ flex: 1 }}/>)}
|
|
660
735
|
|
|
661
736
|
{/* Sleek Configure Button */}
|
|
662
737
|
<TouchableScale accessible={true} accessibilityRole="button" accessibilityLabel={`Configure ${moduleItem.label} settings`} onPress={() => {
|
|
@@ -688,8 +763,11 @@ const SettingsPanel = () => {
|
|
|
688
763
|
</View>);
|
|
689
764
|
})}
|
|
690
765
|
</View>
|
|
766
|
+
</View>)}
|
|
691
767
|
|
|
692
|
-
|
|
768
|
+
{/* ─── TAB 2: RAM & RESOURCE LIMITS ──────────────────────────────────── */}
|
|
769
|
+
{settingsActiveSubTab === 'limits' && (<View style={{ gap: 14 }}>
|
|
770
|
+
{/* Section 1: RAM-Based Auto Limits */}
|
|
693
771
|
<View style={{
|
|
694
772
|
backgroundColor: AppColors.primaryLight,
|
|
695
773
|
borderRadius: 14,
|
|
@@ -706,7 +784,7 @@ const SettingsPanel = () => {
|
|
|
706
784
|
color: AppColors.grayTextWeak,
|
|
707
785
|
letterSpacing: 0.8,
|
|
708
786
|
}}>
|
|
709
|
-
RAM-
|
|
787
|
+
RAM-BASED AUTO TUNING
|
|
710
788
|
</Text>
|
|
711
789
|
|
|
712
790
|
{/* Auto RAM Limit Toggle */}
|
|
@@ -911,8 +989,329 @@ const SettingsPanel = () => {
|
|
|
911
989
|
</View>))}
|
|
912
990
|
</View>
|
|
913
991
|
</View>)}
|
|
992
|
+
|
|
993
|
+
<View style={{ height: 1, backgroundColor: AppColors.dividerColor }}/>
|
|
994
|
+
|
|
995
|
+
{/* Floating Mini Performance HUD Toggle */}
|
|
996
|
+
{renderSettingRow({
|
|
997
|
+
icon: <PerformanceIcon color={AppColors.purple} size={16}/>,
|
|
998
|
+
label: 'Show Mini Performance HUD Overlay',
|
|
999
|
+
description: 'Floating on-screen real-time FPS and Memory/Heap widget',
|
|
1000
|
+
right: (<TouchableScale accessible={true} accessibilityRole="switch" accessibilityLabel="Toggle mini performance HUD overlay" accessibilityState={{ checked: isPerformanceHudEnabled }} onPress={() => setIsPerformanceHudEnabled(prev => !prev)} style={{
|
|
1001
|
+
width: 42,
|
|
1002
|
+
height: 24,
|
|
1003
|
+
borderRadius: 12,
|
|
1004
|
+
backgroundColor: isPerformanceHudEnabled
|
|
1005
|
+
? AppColors.purple
|
|
1006
|
+
: AppColors.grayBorderSecondary,
|
|
1007
|
+
padding: 2,
|
|
1008
|
+
justifyContent: 'center',
|
|
1009
|
+
alignItems: isPerformanceHudEnabled
|
|
1010
|
+
? 'flex-end'
|
|
1011
|
+
: 'flex-start',
|
|
1012
|
+
}}>
|
|
1013
|
+
<View style={{
|
|
1014
|
+
width: 20,
|
|
1015
|
+
height: 20,
|
|
1016
|
+
borderRadius: 10,
|
|
1017
|
+
backgroundColor: AppColors.white,
|
|
1018
|
+
shadowColor: AppColors.black,
|
|
1019
|
+
shadowOpacity: 0.18,
|
|
1020
|
+
shadowRadius: 2,
|
|
1021
|
+
shadowOffset: { width: 0, height: 1 },
|
|
1022
|
+
}}/>
|
|
1023
|
+
</TouchableScale>),
|
|
1024
|
+
isLast: true,
|
|
1025
|
+
})}
|
|
1026
|
+
</View>
|
|
1027
|
+
|
|
1028
|
+
{/* Section 2: Fine-Tuned Resource Limits */}
|
|
1029
|
+
<View style={{
|
|
1030
|
+
backgroundColor: AppColors.primaryLight,
|
|
1031
|
+
borderRadius: 14,
|
|
1032
|
+
borderWidth: 1,
|
|
1033
|
+
borderColor: AppColors.grayBorderSecondary,
|
|
1034
|
+
overflow: 'hidden',
|
|
1035
|
+
padding: 14,
|
|
1036
|
+
gap: 12,
|
|
1037
|
+
}}>
|
|
1038
|
+
<Text style={{
|
|
1039
|
+
fontFamily: AppFonts.interBold,
|
|
1040
|
+
fontSize: 11,
|
|
1041
|
+
lineHeight: 14,
|
|
1042
|
+
color: AppColors.grayTextWeak,
|
|
1043
|
+
letterSpacing: 0.8,
|
|
1044
|
+
}}>
|
|
1045
|
+
MANUAL RESOURCE THRESHOLDS
|
|
1046
|
+
</Text>
|
|
1047
|
+
|
|
1048
|
+
{renderSettingRow({
|
|
1049
|
+
icon: <SignalIcon color={AppColors.purple} size={16}/>,
|
|
1050
|
+
label: 'Max Network / API Logs',
|
|
1051
|
+
description: 'Maximum in-memory API requests tracked before rotation',
|
|
1052
|
+
numericInput: {
|
|
1053
|
+
value: maxNetworkLogs,
|
|
1054
|
+
onChange: setMaxNetworkLogs,
|
|
1055
|
+
min: 10,
|
|
1056
|
+
max: 100,
|
|
1057
|
+
placeholder: '10 - 100',
|
|
1058
|
+
},
|
|
1059
|
+
})}
|
|
1060
|
+
|
|
1061
|
+
{renderSettingRow({
|
|
1062
|
+
icon: <TerminalIcon color={AppColors.purple} size={16}/>,
|
|
1063
|
+
label: 'Max Console Logs',
|
|
1064
|
+
description: 'Maximum log entries kept across info/warn/error streams',
|
|
1065
|
+
numericInput: {
|
|
1066
|
+
value: maxConsoleLogs,
|
|
1067
|
+
onChange: setMaxConsoleLogs,
|
|
1068
|
+
min: 20,
|
|
1069
|
+
max: 300,
|
|
1070
|
+
placeholder: '20 - 300',
|
|
1071
|
+
},
|
|
1072
|
+
})}
|
|
1073
|
+
|
|
1074
|
+
{renderSettingRow({
|
|
1075
|
+
icon: <AnalyticsIcon color={AppColors.purple} size={16}/>,
|
|
1076
|
+
label: 'Max Analytics Events',
|
|
1077
|
+
description: 'Capacity for captured analytics payloads & telemetry pings',
|
|
1078
|
+
numericInput: {
|
|
1079
|
+
value: maxAnalyticsEventsLimit,
|
|
1080
|
+
onChange: setMaxAnalyticsEventsLimit,
|
|
1081
|
+
min: 20,
|
|
1082
|
+
max: 200,
|
|
1083
|
+
placeholder: '20 - 200',
|
|
1084
|
+
},
|
|
1085
|
+
})}
|
|
1086
|
+
|
|
1087
|
+
{renderSettingRow({
|
|
1088
|
+
icon: <CrashIcon color={AppColors.errorColor} size={16}/>,
|
|
1089
|
+
label: 'Max Crash Records',
|
|
1090
|
+
description: 'Stored fatal exceptions and crash diagnostics logs',
|
|
1091
|
+
numericInput: {
|
|
1092
|
+
value: maxCrashLogs,
|
|
1093
|
+
onChange: setMaxCrashLogs,
|
|
1094
|
+
min: 5,
|
|
1095
|
+
max: 50,
|
|
1096
|
+
placeholder: '5 - 50',
|
|
1097
|
+
},
|
|
1098
|
+
isLast: true,
|
|
1099
|
+
})}
|
|
1100
|
+
</View>
|
|
1101
|
+
|
|
1102
|
+
{/* Section 3: Storage & Cache Cleansing */}
|
|
1103
|
+
<View style={{
|
|
1104
|
+
backgroundColor: AppColors.primaryLight,
|
|
1105
|
+
borderRadius: 14,
|
|
1106
|
+
borderWidth: 1,
|
|
1107
|
+
borderColor: AppColors.grayBorderSecondary,
|
|
1108
|
+
overflow: 'hidden',
|
|
1109
|
+
padding: 14,
|
|
1110
|
+
gap: 12,
|
|
1111
|
+
}}>
|
|
1112
|
+
<Text style={{
|
|
1113
|
+
fontFamily: AppFonts.interBold,
|
|
1114
|
+
fontSize: 11,
|
|
1115
|
+
lineHeight: 14,
|
|
1116
|
+
color: AppColors.grayTextWeak,
|
|
1117
|
+
letterSpacing: 0.8,
|
|
1118
|
+
}}>
|
|
1119
|
+
STORAGE & CACHE CLEANSING
|
|
1120
|
+
</Text>
|
|
1121
|
+
|
|
1122
|
+
{renderSettingRow({
|
|
1123
|
+
icon: <TrashIcon color={AppColors.errorColor} size={16}/>,
|
|
1124
|
+
label: 'Clear All Network Logs',
|
|
1125
|
+
description: `${logs.length} requests in memory`,
|
|
1126
|
+
onPress: () => {
|
|
1127
|
+
clearNetworkLogs();
|
|
1128
|
+
setSelected(null);
|
|
1129
|
+
Alert.alert(t('common.success'), 'Network logs cleared successfully.');
|
|
1130
|
+
},
|
|
1131
|
+
right: (<View style={{
|
|
1132
|
+
paddingHorizontal: 10,
|
|
1133
|
+
paddingVertical: 4,
|
|
1134
|
+
borderRadius: 6,
|
|
1135
|
+
backgroundColor: `${AppColors.errorColor}14`,
|
|
1136
|
+
borderWidth: 1,
|
|
1137
|
+
borderColor: `${AppColors.errorColor}33`,
|
|
1138
|
+
}}>
|
|
1139
|
+
<Text style={{
|
|
1140
|
+
fontFamily: AppFonts.interBold,
|
|
1141
|
+
fontSize: 11,
|
|
1142
|
+
color: AppColors.errorColor,
|
|
1143
|
+
}}>
|
|
1144
|
+
Clear ({logs.length})
|
|
1145
|
+
</Text>
|
|
1146
|
+
</View>),
|
|
1147
|
+
})}
|
|
1148
|
+
|
|
1149
|
+
{renderSettingRow({
|
|
1150
|
+
icon: <TrashIcon color={AppColors.errorColor} size={16}/>,
|
|
1151
|
+
label: 'Clear All Console Logs',
|
|
1152
|
+
description: `${consoleLogs.length} logs in memory`,
|
|
1153
|
+
onPress: () => {
|
|
1154
|
+
clearConsoleLogs();
|
|
1155
|
+
Alert.alert(t('common.success'), 'Console logs cleared successfully.');
|
|
1156
|
+
},
|
|
1157
|
+
right: (<View style={{
|
|
1158
|
+
paddingHorizontal: 10,
|
|
1159
|
+
paddingVertical: 4,
|
|
1160
|
+
borderRadius: 6,
|
|
1161
|
+
backgroundColor: `${AppColors.errorColor}14`,
|
|
1162
|
+
borderWidth: 1,
|
|
1163
|
+
borderColor: `${AppColors.errorColor}33`,
|
|
1164
|
+
}}>
|
|
1165
|
+
<Text style={{
|
|
1166
|
+
fontFamily: AppFonts.interBold,
|
|
1167
|
+
fontSize: 11,
|
|
1168
|
+
color: AppColors.errorColor,
|
|
1169
|
+
}}>
|
|
1170
|
+
Clear ({consoleLogs.length})
|
|
1171
|
+
</Text>
|
|
1172
|
+
</View>),
|
|
1173
|
+
})}
|
|
1174
|
+
|
|
1175
|
+
{renderSettingRow({
|
|
1176
|
+
icon: <TrashIcon color={AppColors.errorColor} size={16}/>,
|
|
1177
|
+
label: 'Clear Analytics Events',
|
|
1178
|
+
description: `${analyticsEvents.length} events recorded`,
|
|
1179
|
+
onPress: () => {
|
|
1180
|
+
clearAnalyticsEvents();
|
|
1181
|
+
setSelectedEvent(null);
|
|
1182
|
+
Alert.alert(t('common.success'), 'Analytics events cleared successfully.');
|
|
1183
|
+
},
|
|
1184
|
+
right: (<View style={{
|
|
1185
|
+
paddingHorizontal: 10,
|
|
1186
|
+
paddingVertical: 4,
|
|
1187
|
+
borderRadius: 6,
|
|
1188
|
+
backgroundColor: `${AppColors.errorColor}14`,
|
|
1189
|
+
borderWidth: 1,
|
|
1190
|
+
borderColor: `${AppColors.errorColor}33`,
|
|
1191
|
+
}}>
|
|
1192
|
+
<Text style={{
|
|
1193
|
+
fontFamily: AppFonts.interBold,
|
|
1194
|
+
fontSize: 11,
|
|
1195
|
+
color: AppColors.errorColor,
|
|
1196
|
+
}}>
|
|
1197
|
+
Clear ({analyticsEvents.length})
|
|
1198
|
+
</Text>
|
|
1199
|
+
</View>),
|
|
1200
|
+
})}
|
|
1201
|
+
|
|
1202
|
+
{renderSettingRow({
|
|
1203
|
+
icon: <TrashIcon color={AppColors.errorColor} size={16}/>,
|
|
1204
|
+
label: 'Clear Crash Logs',
|
|
1205
|
+
description: `${crashRecords.length} crash dumps recorded`,
|
|
1206
|
+
onPress: () => {
|
|
1207
|
+
clearCrashRecords();
|
|
1208
|
+
Alert.alert(t('common.success'), 'Crash records cleared successfully.');
|
|
1209
|
+
},
|
|
1210
|
+
isLast: true,
|
|
1211
|
+
right: (<View style={{
|
|
1212
|
+
paddingHorizontal: 10,
|
|
1213
|
+
paddingVertical: 4,
|
|
1214
|
+
borderRadius: 6,
|
|
1215
|
+
backgroundColor: `${AppColors.errorColor}14`,
|
|
1216
|
+
borderWidth: 1,
|
|
1217
|
+
borderColor: `${AppColors.errorColor}33`,
|
|
1218
|
+
}}>
|
|
1219
|
+
<Text style={{
|
|
1220
|
+
fontFamily: AppFonts.interBold,
|
|
1221
|
+
fontSize: 11,
|
|
1222
|
+
color: AppColors.errorColor,
|
|
1223
|
+
}}>
|
|
1224
|
+
Clear ({crashRecords.length})
|
|
1225
|
+
</Text>
|
|
1226
|
+
</View>),
|
|
1227
|
+
})}
|
|
914
1228
|
</View>
|
|
915
|
-
</View>)
|
|
1229
|
+
</View>)}
|
|
1230
|
+
|
|
1231
|
+
{/* ─── TAB 3: UI & APPEARANCE ────────────────────────────────────────── */}
|
|
1232
|
+
{settingsActiveSubTab === 'ui' && (<View style={{ gap: 14 }}>
|
|
1233
|
+
{/* Section 0: Interactive Walkthrough Tour */}
|
|
1234
|
+
<View style={{
|
|
1235
|
+
backgroundColor: AppColors.primaryLight,
|
|
1236
|
+
borderRadius: 14,
|
|
1237
|
+
borderWidth: 1,
|
|
1238
|
+
borderColor: AppColors.grayBorderSecondary,
|
|
1239
|
+
overflow: 'hidden',
|
|
1240
|
+
padding: 14,
|
|
1241
|
+
gap: 12,
|
|
1242
|
+
}}>
|
|
1243
|
+
<Text style={{
|
|
1244
|
+
fontFamily: AppFonts.interBold,
|
|
1245
|
+
fontSize: 11,
|
|
1246
|
+
lineHeight: 14,
|
|
1247
|
+
color: AppColors.grayTextWeak,
|
|
1248
|
+
letterSpacing: 0.8,
|
|
1249
|
+
}}>
|
|
1250
|
+
ONBOARDING & GUIDE
|
|
1251
|
+
</Text>
|
|
1252
|
+
|
|
1253
|
+
<View style={{
|
|
1254
|
+
flexDirection: 'row',
|
|
1255
|
+
alignItems: 'center',
|
|
1256
|
+
justifyContent: 'space-between',
|
|
1257
|
+
gap: 10,
|
|
1258
|
+
}}>
|
|
1259
|
+
<View style={{
|
|
1260
|
+
flexDirection: 'row',
|
|
1261
|
+
alignItems: 'center',
|
|
1262
|
+
gap: 10,
|
|
1263
|
+
flex: 1,
|
|
1264
|
+
}}>
|
|
1265
|
+
<View style={{
|
|
1266
|
+
width: 34,
|
|
1267
|
+
height: 34,
|
|
1268
|
+
borderRadius: 9,
|
|
1269
|
+
backgroundColor: `${AppColors.purple}16`,
|
|
1270
|
+
alignItems: 'center',
|
|
1271
|
+
justifyContent: 'center',
|
|
1272
|
+
}}>
|
|
1273
|
+
<GlobeIcon color={AppColors.purple} size={16}/>
|
|
1274
|
+
</View>
|
|
1275
|
+
<View style={{ flex: 1 }}>
|
|
1276
|
+
<Text style={{
|
|
1277
|
+
fontFamily: AppFonts.interBold,
|
|
1278
|
+
fontSize: 13.5,
|
|
1279
|
+
lineHeight: 18,
|
|
1280
|
+
color: AppColors.primaryBlack,
|
|
1281
|
+
}}>
|
|
1282
|
+
First-Time Walkthrough
|
|
1283
|
+
</Text>
|
|
1284
|
+
<Text style={{
|
|
1285
|
+
fontFamily: AppFonts.interRegular,
|
|
1286
|
+
fontSize: 11.5,
|
|
1287
|
+
color: AppColors.grayTextWeak,
|
|
1288
|
+
marginTop: 1,
|
|
1289
|
+
lineHeight: 16,
|
|
1290
|
+
}}>
|
|
1291
|
+
Explore features, gestures & developer tools
|
|
1292
|
+
</Text>
|
|
1293
|
+
</View>
|
|
1294
|
+
</View>
|
|
1295
|
+
|
|
1296
|
+
<TouchableScale style={{
|
|
1297
|
+
backgroundColor: `${AppColors.purple}14`,
|
|
1298
|
+
borderColor: `${AppColors.purple}30`,
|
|
1299
|
+
borderWidth: 1,
|
|
1300
|
+
paddingHorizontal: 12,
|
|
1301
|
+
paddingVertical: 7,
|
|
1302
|
+
borderRadius: 8,
|
|
1303
|
+
}} onPress={openWalkthrough} hitSlop={8}>
|
|
1304
|
+
<Text style={{
|
|
1305
|
+
fontFamily: AppFonts.interBold,
|
|
1306
|
+
fontSize: 12,
|
|
1307
|
+
color: AppColors.purple,
|
|
1308
|
+
}}>
|
|
1309
|
+
Start Tour →
|
|
1310
|
+
</Text>
|
|
1311
|
+
</TouchableScale>
|
|
1312
|
+
</View>
|
|
1313
|
+
</View>
|
|
1314
|
+
|
|
916
1315
|
{/* Section 1: Appearance */}
|
|
917
1316
|
<View style={{
|
|
918
1317
|
backgroundColor: AppColors.primaryLight,
|