react-native-inapp-inspector 2.2.3 → 2.2.4
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/dist/commonjs/components/AnalyticsDetail.js +5 -1
- package/dist/commonjs/components/AnalyticsEventCard.js +2 -1
- package/dist/commonjs/components/DiffViewer.js +1 -1
- package/dist/commonjs/components/Inspector/BundleTab.js +22 -0
- package/dist/commonjs/components/Inspector/DeviceInfoTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +835 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.js +12 -14
- package/dist/commonjs/components/Inspector/LogDetail.js +6 -3
- package/dist/commonjs/components/Inspector/MainScreen.js +7 -3
- package/dist/commonjs/components/Inspector/NetworkTab.js +92 -15
- package/dist/commonjs/components/Inspector/PerformanceTab.js +38 -12
- package/dist/commonjs/components/Inspector/SettingsPanel.js +440 -229
- package/dist/commonjs/components/Inspector/StorageTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/StorageTab.js +892 -0
- package/dist/commonjs/components/Inspector/TabBar.js +14 -0
- package/dist/commonjs/components/Inspector/TelemetryConsentModal.js +11 -2
- package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +4 -1
- package/dist/commonjs/components/NetworkIcons.d.ts +6 -0
- package/dist/commonjs/components/NetworkIcons.js +30 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/bundleAnalyzer.js +44 -22
- package/dist/commonjs/customHooks/storageInspector.d.ts +67 -0
- package/dist/commonjs/customHooks/storageInspector.js +486 -0
- package/dist/commonjs/i18n/locales/en.json +8 -2
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.js +16 -1
- package/dist/commonjs/storage.d.ts +5 -0
- package/dist/commonjs/storage.js +18 -0
- package/dist/commonjs/types/enums.d.ts +5 -0
- package/dist/commonjs/types/enums.js +5 -0
- package/dist/esm/components/AnalyticsDetail.js +6 -2
- package/dist/esm/components/AnalyticsEventCard.js +2 -1
- package/dist/esm/components/DiffViewer.js +1 -1
- package/dist/esm/components/Inspector/BundleTab.js +22 -0
- package/dist/esm/components/Inspector/DeviceInfoTab.d.ts +3 -0
- package/dist/esm/components/Inspector/DeviceInfoTab.js +796 -0
- package/dist/esm/components/Inspector/InspectorHeader.js +13 -15
- package/dist/esm/components/Inspector/LogDetail.js +7 -4
- package/dist/esm/components/Inspector/MainScreen.js +7 -3
- package/dist/esm/components/Inspector/NetworkTab.js +93 -16
- package/dist/esm/components/Inspector/PerformanceTab.js +39 -13
- package/dist/esm/components/Inspector/SettingsPanel.js +441 -230
- package/dist/esm/components/Inspector/StorageTab.d.ts +3 -0
- package/dist/esm/components/Inspector/StorageTab.js +853 -0
- package/dist/esm/components/Inspector/TabBar.js +15 -1
- package/dist/esm/components/Inspector/TelemetryConsentModal.js +11 -2
- package/dist/esm/components/Inspector/UpdateAvailableModal.js +4 -1
- package/dist/esm/components/NetworkIcons.d.ts +6 -0
- package/dist/esm/components/NetworkIcons.js +23 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/bundleAnalyzer.js +44 -22
- package/dist/esm/customHooks/storageInspector.d.ts +67 -0
- package/dist/esm/customHooks/storageInspector.js +469 -0
- package/dist/esm/i18n/locales/en.json +8 -2
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/storage.d.ts +5 -0
- package/dist/esm/storage.js +5 -0
- package/dist/esm/types/enums.d.ts +5 -0
- package/dist/esm/types/enums.js +5 -0
- package/package.json +8 -1
- package/src/components/AnalyticsDetail.tsx +6 -1
- package/src/components/AnalyticsEventCard.tsx +2 -1
- package/src/components/DiffViewer.tsx +1 -1
- package/src/components/Inspector/BundleTab.tsx +29 -0
- package/src/components/Inspector/DeviceInfoTab.tsx +1204 -0
- package/src/components/Inspector/InspectorHeader.tsx +13 -14
- package/src/components/Inspector/LogDetail.tsx +15 -11
- package/src/components/Inspector/MainScreen.tsx +7 -3
- package/src/components/Inspector/NetworkTab.tsx +104 -16
- package/src/components/Inspector/PerformanceTab.tsx +46 -12
- package/src/components/Inspector/SettingsPanel.tsx +570 -304
- package/src/components/Inspector/StorageTab.tsx +1048 -0
- package/src/components/Inspector/TabBar.tsx +20 -0
- package/src/components/Inspector/TelemetryConsentModal.tsx +26 -2
- package/src/components/Inspector/UpdateAvailableModal.tsx +13 -1
- package/src/components/NetworkIcons.tsx +103 -0
- package/src/constants/version.ts +1 -1
- package/src/customHooks/bundleAnalyzer.ts +47 -22
- package/src/customHooks/storageInspector.ts +509 -0
- package/src/i18n/locales/en.json +8 -2
- package/src/index.tsx +21 -1
- package/src/storage.ts +18 -0
- package/src/types/enums.ts +5 -0
|
@@ -18,10 +18,11 @@ 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, SunIcon, MoonIcon, ScreenIcon, MotionIcon, LayersIcon, EyeIcon, CheckIcon, TrashIcon, PackageIcon, ReduxIcon, PerformanceIcon, CrashIcon, ShieldAlertIcon, ForwardChevronIcon, ChevronDownIcon, NpmIcon, BoltIcon, BrainIcon, SmartphoneIcon, DatabaseIcon, } from '../NetworkIcons';
|
|
22
22
|
import { LIB_VERSION } from '../../constants';
|
|
23
23
|
import { copyToClipboard } from '../../helpers';
|
|
24
24
|
import { showToast } from '../../helpers/toast';
|
|
25
|
+
import { pruneAllLogs } from '../../helpers/memoryManager';
|
|
25
26
|
const SettingsPanel = () => {
|
|
26
27
|
const { t } = useTranslation();
|
|
27
28
|
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();
|
|
@@ -98,6 +99,20 @@ const SettingsPanel = () => {
|
|
|
98
99
|
icon: 'redux',
|
|
99
100
|
desc: 'Store state diffing, action history & reducer timeline',
|
|
100
101
|
},
|
|
102
|
+
{
|
|
103
|
+
key: 'device',
|
|
104
|
+
label: 'Device Info',
|
|
105
|
+
category: 'diagnostic',
|
|
106
|
+
icon: 'device',
|
|
107
|
+
desc: 'Hardware specs, IP address, screen metrics, UDID & runtime stats',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
key: 'storage',
|
|
111
|
+
label: 'Storage Inspector',
|
|
112
|
+
category: 'telemetry',
|
|
113
|
+
icon: 'storage',
|
|
114
|
+
desc: 'AsyncStorage & MMKV key-value store viewer with full CRUD support',
|
|
115
|
+
},
|
|
101
116
|
];
|
|
102
117
|
// Staged selection state for checkboxes before clicking "Save Changes"
|
|
103
118
|
const [stagedTabVisibility, setStagedTabVisibility] = useState(() => ({
|
|
@@ -108,6 +123,8 @@ const SettingsPanel = () => {
|
|
|
108
123
|
bundle: Boolean(tabVisibility?.bundle),
|
|
109
124
|
performance: Boolean(tabVisibility?.performance),
|
|
110
125
|
crash: Boolean(tabVisibility?.crash),
|
|
126
|
+
device: Boolean(tabVisibility?.device ?? true),
|
|
127
|
+
storage: Boolean(tabVisibility?.storage ?? true),
|
|
111
128
|
}));
|
|
112
129
|
// Synchronize staged state with tabVisibility when tabVisibility updates
|
|
113
130
|
useEffect(() => {
|
|
@@ -119,6 +136,8 @@ const SettingsPanel = () => {
|
|
|
119
136
|
bundle: Boolean(tabVisibility?.bundle),
|
|
120
137
|
performance: Boolean(tabVisibility?.performance),
|
|
121
138
|
crash: Boolean(tabVisibility?.crash),
|
|
139
|
+
device: Boolean(tabVisibility?.device ?? true),
|
|
140
|
+
storage: Boolean(tabVisibility?.storage ?? true),
|
|
122
141
|
});
|
|
123
142
|
}, [tabVisibility]);
|
|
124
143
|
const hasUnsavedChanges = useMemo(() => {
|
|
@@ -326,7 +345,7 @@ const SettingsPanel = () => {
|
|
|
326
345
|
flexDirection: 'row',
|
|
327
346
|
alignItems: 'center',
|
|
328
347
|
justifyContent: 'center',
|
|
329
|
-
gap:
|
|
348
|
+
gap: 5,
|
|
330
349
|
borderRadius: 9,
|
|
331
350
|
backgroundColor: settingsActiveSubTab === 'ui'
|
|
332
351
|
? AppColors.purple
|
|
@@ -335,9 +354,9 @@ const SettingsPanel = () => {
|
|
|
335
354
|
<ScreenIcon color={settingsActiveSubTab === 'ui'
|
|
336
355
|
? AppColors.white
|
|
337
356
|
: AppColors.grayText} size={13}/>
|
|
338
|
-
<Text style={{
|
|
357
|
+
<Text numberOfLines={1} style={{
|
|
339
358
|
fontFamily: AppFonts.interBold,
|
|
340
|
-
fontSize: 12
|
|
359
|
+
fontSize: 12,
|
|
341
360
|
lineHeight: 16,
|
|
342
361
|
color: settingsActiveSubTab === 'ui'
|
|
343
362
|
? AppColors.white
|
|
@@ -346,9 +365,39 @@ const SettingsPanel = () => {
|
|
|
346
365
|
{t('settings.uiPreferences')}
|
|
347
366
|
</Text>
|
|
348
367
|
</TouchableScale>
|
|
368
|
+
|
|
369
|
+
<TouchableScale accessible={true} accessibilityRole="tab" accessibilityLabel={t('settings.ramLimits')} accessibilityState={{ selected: settingsActiveSubTab === 'limits' }} onPress={() => {
|
|
370
|
+
animateNextLayout();
|
|
371
|
+
setSettingsActiveSubTab('limits');
|
|
372
|
+
}} style={{
|
|
373
|
+
flex: 1,
|
|
374
|
+
paddingVertical: 9,
|
|
375
|
+
flexDirection: 'row',
|
|
376
|
+
alignItems: 'center',
|
|
377
|
+
justifyContent: 'center',
|
|
378
|
+
gap: 5,
|
|
379
|
+
borderRadius: 9,
|
|
380
|
+
backgroundColor: settingsActiveSubTab === 'limits'
|
|
381
|
+
? AppColors.purple
|
|
382
|
+
: 'transparent',
|
|
383
|
+
}}>
|
|
384
|
+
<BrainIcon color={settingsActiveSubTab === 'limits'
|
|
385
|
+
? AppColors.white
|
|
386
|
+
: AppColors.grayText} size={13}/>
|
|
387
|
+
<Text numberOfLines={1} style={{
|
|
388
|
+
fontFamily: AppFonts.interBold,
|
|
389
|
+
fontSize: 12,
|
|
390
|
+
lineHeight: 16,
|
|
391
|
+
color: settingsActiveSubTab === 'limits'
|
|
392
|
+
? AppColors.white
|
|
393
|
+
: AppColors.grayText,
|
|
394
|
+
}}>
|
|
395
|
+
{t('settings.ramLimits')}
|
|
396
|
+
</Text>
|
|
397
|
+
</TouchableScale>
|
|
349
398
|
</View>
|
|
350
399
|
|
|
351
|
-
{settingsActiveSubTab === 'module'
|
|
400
|
+
{settingsActiveSubTab === 'module' && (<View style={{ gap: 12 }}>
|
|
352
401
|
{/* Individual Module Cards with Left Checkboxes */}
|
|
353
402
|
<View style={{ gap: 10 }}>
|
|
354
403
|
{allModules.map(moduleItem => {
|
|
@@ -486,6 +535,12 @@ const SettingsPanel = () => {
|
|
|
486
535
|
{moduleItem.icon === 'redux' && (<ReduxIcon color={isChecked
|
|
487
536
|
? AppColors.purple
|
|
488
537
|
: AppColors.grayTextWeak} size={16}/>)}
|
|
538
|
+
{moduleItem.icon === 'device' && (<SmartphoneIcon color={isChecked
|
|
539
|
+
? AppColors.purple
|
|
540
|
+
: AppColors.grayTextWeak} size={16}/>)}
|
|
541
|
+
{moduleItem.icon === 'storage' && (<DatabaseIcon color={isChecked
|
|
542
|
+
? AppColors.purple
|
|
543
|
+
: AppColors.grayTextWeak} size={16}/>)}
|
|
489
544
|
</View>
|
|
490
545
|
|
|
491
546
|
{/* Titles & Status Pill */}
|
|
@@ -688,231 +743,9 @@ const SettingsPanel = () => {
|
|
|
688
743
|
</View>);
|
|
689
744
|
})}
|
|
690
745
|
</View>
|
|
746
|
+
</View>)}
|
|
691
747
|
|
|
692
|
-
|
|
693
|
-
<View style={{
|
|
694
|
-
backgroundColor: AppColors.primaryLight,
|
|
695
|
-
borderRadius: 14,
|
|
696
|
-
borderWidth: 1,
|
|
697
|
-
borderColor: AppColors.grayBorderSecondary,
|
|
698
|
-
overflow: 'hidden',
|
|
699
|
-
padding: 14,
|
|
700
|
-
gap: 12,
|
|
701
|
-
}}>
|
|
702
|
-
<Text style={{
|
|
703
|
-
fontFamily: AppFonts.interBold,
|
|
704
|
-
fontSize: 11,
|
|
705
|
-
lineHeight: 14,
|
|
706
|
-
color: AppColors.grayTextWeak,
|
|
707
|
-
letterSpacing: 0.8,
|
|
708
|
-
}}>
|
|
709
|
-
RAM-Based Auto Limits
|
|
710
|
-
</Text>
|
|
711
|
-
|
|
712
|
-
{/* Auto RAM Limit Toggle */}
|
|
713
|
-
<View style={{
|
|
714
|
-
flexDirection: 'row',
|
|
715
|
-
alignItems: 'center',
|
|
716
|
-
justifyContent: 'space-between',
|
|
717
|
-
}}>
|
|
718
|
-
<View style={{
|
|
719
|
-
flexDirection: 'row',
|
|
720
|
-
alignItems: 'center',
|
|
721
|
-
gap: 10,
|
|
722
|
-
flex: 1,
|
|
723
|
-
}}>
|
|
724
|
-
<View style={{
|
|
725
|
-
width: 32,
|
|
726
|
-
height: 32,
|
|
727
|
-
borderRadius: 8,
|
|
728
|
-
backgroundColor: AppColors.purpleShade50,
|
|
729
|
-
alignItems: 'center',
|
|
730
|
-
justifyContent: 'center',
|
|
731
|
-
}}>
|
|
732
|
-
<PerformanceIcon color={AppColors.purple} size={15}/>
|
|
733
|
-
</View>
|
|
734
|
-
<View style={{ flex: 1 }}>
|
|
735
|
-
<Text style={{
|
|
736
|
-
fontFamily: AppFonts.interBold,
|
|
737
|
-
fontSize: 13.5,
|
|
738
|
-
lineHeight: 18,
|
|
739
|
-
color: AppColors.primaryBlack,
|
|
740
|
-
}}>
|
|
741
|
-
Auto-Calculate Limits from Device RAM
|
|
742
|
-
</Text>
|
|
743
|
-
<Text style={{
|
|
744
|
-
fontFamily: AppFonts.interRegular,
|
|
745
|
-
fontSize: 11,
|
|
746
|
-
lineHeight: 15,
|
|
747
|
-
color: AppColors.grayText,
|
|
748
|
-
marginTop: 1,
|
|
749
|
-
}}>
|
|
750
|
-
Automatically set API, Logs, Analytics & Crash limits
|
|
751
|
-
based on available memory
|
|
752
|
-
</Text>
|
|
753
|
-
</View>
|
|
754
|
-
</View>
|
|
755
|
-
|
|
756
|
-
<TouchableScale accessible={true} accessibilityRole="switch" accessibilityLabel="Toggle auto RAM limit calculation" accessibilityState={{ checked: isAutoRamLimitEnabled }} onPress={() => setIsAutoRamLimitEnabled(prev => !prev)} style={{
|
|
757
|
-
width: 42,
|
|
758
|
-
height: 24,
|
|
759
|
-
borderRadius: 12,
|
|
760
|
-
backgroundColor: isAutoRamLimitEnabled
|
|
761
|
-
? AppColors.purple
|
|
762
|
-
: AppColors.grayBorderSecondary,
|
|
763
|
-
padding: 2,
|
|
764
|
-
justifyContent: 'center',
|
|
765
|
-
alignItems: isAutoRamLimitEnabled
|
|
766
|
-
? 'flex-end'
|
|
767
|
-
: 'flex-start',
|
|
768
|
-
}}>
|
|
769
|
-
<View style={{
|
|
770
|
-
width: 20,
|
|
771
|
-
height: 20,
|
|
772
|
-
borderRadius: 10,
|
|
773
|
-
backgroundColor: AppColors.white,
|
|
774
|
-
shadowColor: AppColors.black,
|
|
775
|
-
shadowOpacity: 0.18,
|
|
776
|
-
shadowRadius: 2,
|
|
777
|
-
shadowOffset: { width: 0, height: 1 },
|
|
778
|
-
}}/>
|
|
779
|
-
</TouchableScale>
|
|
780
|
-
</View>
|
|
781
|
-
|
|
782
|
-
<View style={{ height: 1, backgroundColor: AppColors.dividerColor }}/>
|
|
783
|
-
|
|
784
|
-
{/* Device Free RAM Display */}
|
|
785
|
-
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 10 }}>
|
|
786
|
-
<View style={{
|
|
787
|
-
width: 32,
|
|
788
|
-
height: 32,
|
|
789
|
-
borderRadius: 8,
|
|
790
|
-
backgroundColor: isAutoRamLimitEnabled
|
|
791
|
-
? `${AppColors.purple}14`
|
|
792
|
-
: AppColors.grayBackground,
|
|
793
|
-
alignItems: 'center',
|
|
794
|
-
justifyContent: 'center',
|
|
795
|
-
}}>
|
|
796
|
-
<SignalIcon color={isAutoRamLimitEnabled
|
|
797
|
-
? AppColors.purple
|
|
798
|
-
: AppColors.grayTextWeak} size={15}/>
|
|
799
|
-
</View>
|
|
800
|
-
<View style={{ flex: 1 }}>
|
|
801
|
-
<Text style={{
|
|
802
|
-
fontFamily: AppFonts.interBold,
|
|
803
|
-
fontSize: 13.5,
|
|
804
|
-
lineHeight: 18,
|
|
805
|
-
color: isAutoRamLimitEnabled
|
|
806
|
-
? AppColors.primaryBlack
|
|
807
|
-
: AppColors.grayText,
|
|
808
|
-
}}>
|
|
809
|
-
Detected Free RAM
|
|
810
|
-
</Text>
|
|
811
|
-
<Text style={{
|
|
812
|
-
fontFamily: AppFonts.interRegular,
|
|
813
|
-
fontSize: 11,
|
|
814
|
-
lineHeight: 15,
|
|
815
|
-
color: AppColors.grayText,
|
|
816
|
-
marginTop: 1,
|
|
817
|
-
}}>
|
|
818
|
-
{deviceFreeRamMb} MB available
|
|
819
|
-
</Text>
|
|
820
|
-
</View>
|
|
821
|
-
<View style={{
|
|
822
|
-
paddingHorizontal: 10,
|
|
823
|
-
paddingVertical: 5,
|
|
824
|
-
borderRadius: 8,
|
|
825
|
-
backgroundColor: isAutoRamLimitEnabled
|
|
826
|
-
? `${AppColors.purple}12`
|
|
827
|
-
: AppColors.grayBackground,
|
|
828
|
-
borderWidth: 1,
|
|
829
|
-
borderColor: isAutoRamLimitEnabled
|
|
830
|
-
? `${AppColors.purple}26`
|
|
831
|
-
: AppColors.dividerColor,
|
|
832
|
-
}}>
|
|
833
|
-
<Text style={{
|
|
834
|
-
fontFamily: AppFonts.interBold,
|
|
835
|
-
fontSize: 12,
|
|
836
|
-
lineHeight: 15,
|
|
837
|
-
color: isAutoRamLimitEnabled
|
|
838
|
-
? AppColors.purple
|
|
839
|
-
: AppColors.grayText,
|
|
840
|
-
}}>
|
|
841
|
-
{deviceFreeRamMb} MB
|
|
842
|
-
</Text>
|
|
843
|
-
</View>
|
|
844
|
-
</View>
|
|
845
|
-
|
|
846
|
-
{/* Current Auto-Calculated Limits Preview */}
|
|
847
|
-
{isAutoRamLimitEnabled && (<View style={{
|
|
848
|
-
marginTop: 8,
|
|
849
|
-
paddingTop: 8,
|
|
850
|
-
borderTopWidth: 1,
|
|
851
|
-
borderTopColor: AppColors.dividerColor,
|
|
852
|
-
gap: 6,
|
|
853
|
-
}}>
|
|
854
|
-
<Text style={{
|
|
855
|
-
fontFamily: AppFonts.interBold,
|
|
856
|
-
fontSize: 11.5,
|
|
857
|
-
lineHeight: 15,
|
|
858
|
-
color: AppColors.purple,
|
|
859
|
-
}}>
|
|
860
|
-
Auto Profile: {autoRamProfile.profileName}
|
|
861
|
-
</Text>
|
|
862
|
-
<View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 8 }}>
|
|
863
|
-
{[
|
|
864
|
-
{
|
|
865
|
-
label: 'APIs',
|
|
866
|
-
value: autoRamProfile.maxNetworkLogs,
|
|
867
|
-
color: AppColors.blue500,
|
|
868
|
-
},
|
|
869
|
-
{
|
|
870
|
-
label: 'Logs',
|
|
871
|
-
value: autoRamProfile.maxConsoleLogs,
|
|
872
|
-
color: AppColors.sky500,
|
|
873
|
-
},
|
|
874
|
-
{
|
|
875
|
-
label: 'Analytics',
|
|
876
|
-
value: autoRamProfile.maxAnalyticsEvents,
|
|
877
|
-
color: AppColors.purple,
|
|
878
|
-
},
|
|
879
|
-
{
|
|
880
|
-
label: 'Crash',
|
|
881
|
-
value: autoRamProfile.maxCrashRecords,
|
|
882
|
-
color: AppColors.errorColor,
|
|
883
|
-
},
|
|
884
|
-
].map(item => (<View key={item.label} style={{
|
|
885
|
-
flexDirection: 'row',
|
|
886
|
-
alignItems: 'center',
|
|
887
|
-
gap: 4,
|
|
888
|
-
paddingHorizontal: 8,
|
|
889
|
-
paddingVertical: 4,
|
|
890
|
-
borderRadius: 6,
|
|
891
|
-
backgroundColor: `${item.color}14`,
|
|
892
|
-
borderWidth: 1,
|
|
893
|
-
borderColor: `${item.color}33`,
|
|
894
|
-
}}>
|
|
895
|
-
<Text style={{
|
|
896
|
-
fontFamily: AppFonts.interBold,
|
|
897
|
-
fontSize: 10.5,
|
|
898
|
-
lineHeight: 14,
|
|
899
|
-
color: item.color,
|
|
900
|
-
}}>
|
|
901
|
-
{item.label}
|
|
902
|
-
</Text>
|
|
903
|
-
<Text style={{
|
|
904
|
-
fontFamily: AppFonts.interBold,
|
|
905
|
-
fontSize: 10.5,
|
|
906
|
-
lineHeight: 14,
|
|
907
|
-
color: item.color,
|
|
908
|
-
}}>
|
|
909
|
-
{item.value}
|
|
910
|
-
</Text>
|
|
911
|
-
</View>))}
|
|
912
|
-
</View>
|
|
913
|
-
</View>)}
|
|
914
|
-
</View>
|
|
915
|
-
</View>) : (<View style={{ gap: 14 }}>
|
|
748
|
+
{settingsActiveSubTab === 'ui' && (<View style={{ gap: 14 }}>
|
|
916
749
|
{/* Section 1: Appearance */}
|
|
917
750
|
<View style={{
|
|
918
751
|
backgroundColor: AppColors.primaryLight,
|
|
@@ -1600,6 +1433,9 @@ const SettingsPanel = () => {
|
|
|
1600
1433
|
v{LIB_VERSION}
|
|
1601
1434
|
</Text>
|
|
1602
1435
|
{updateAvailable ? (<View style={{
|
|
1436
|
+
flexDirection: 'row',
|
|
1437
|
+
alignItems: 'center',
|
|
1438
|
+
gap: 3,
|
|
1603
1439
|
backgroundColor: '#F59E0B20',
|
|
1604
1440
|
paddingHorizontal: 6,
|
|
1605
1441
|
paddingVertical: 1.5,
|
|
@@ -1612,8 +1448,9 @@ const SettingsPanel = () => {
|
|
|
1612
1448
|
fontSize: 9.5,
|
|
1613
1449
|
color: '#D97706',
|
|
1614
1450
|
}}>
|
|
1615
|
-
v{latestNpmVersion} Available
|
|
1451
|
+
v{latestNpmVersion} Available
|
|
1616
1452
|
</Text>
|
|
1453
|
+
<BoltIcon size={9} color="#D97706"/>
|
|
1617
1454
|
</View>) : (<View style={{
|
|
1618
1455
|
backgroundColor: `${AppColors.emerald500}20`,
|
|
1619
1456
|
paddingHorizontal: 6,
|
|
@@ -1665,6 +1502,380 @@ const SettingsPanel = () => {
|
|
|
1665
1502
|
</View>
|
|
1666
1503
|
</View>
|
|
1667
1504
|
</View>)}
|
|
1505
|
+
|
|
1506
|
+
{settingsActiveSubTab === 'limits' && (<View style={{ gap: 14 }}>
|
|
1507
|
+
{/* Section 1: Device RAM & Auto Profile */}
|
|
1508
|
+
<View style={{
|
|
1509
|
+
backgroundColor: AppColors.primaryLight,
|
|
1510
|
+
borderRadius: 14,
|
|
1511
|
+
borderWidth: 1,
|
|
1512
|
+
borderColor: AppColors.grayBorderSecondary,
|
|
1513
|
+
overflow: 'hidden',
|
|
1514
|
+
padding: 14,
|
|
1515
|
+
gap: 12,
|
|
1516
|
+
}}>
|
|
1517
|
+
<Text style={{
|
|
1518
|
+
fontFamily: AppFonts.interBold,
|
|
1519
|
+
fontSize: 11,
|
|
1520
|
+
lineHeight: 14,
|
|
1521
|
+
color: AppColors.grayTextWeak,
|
|
1522
|
+
letterSpacing: 0.8,
|
|
1523
|
+
}}>
|
|
1524
|
+
DEVICE MEMORY & AUTO PROFILES
|
|
1525
|
+
</Text>
|
|
1526
|
+
|
|
1527
|
+
{/* Auto RAM Limit Toggle */}
|
|
1528
|
+
<View style={{
|
|
1529
|
+
flexDirection: 'row',
|
|
1530
|
+
alignItems: 'center',
|
|
1531
|
+
justifyContent: 'space-between',
|
|
1532
|
+
}}>
|
|
1533
|
+
<View style={{
|
|
1534
|
+
flexDirection: 'row',
|
|
1535
|
+
alignItems: 'center',
|
|
1536
|
+
gap: 10,
|
|
1537
|
+
flex: 1,
|
|
1538
|
+
}}>
|
|
1539
|
+
<View style={{
|
|
1540
|
+
width: 32,
|
|
1541
|
+
height: 32,
|
|
1542
|
+
borderRadius: 8,
|
|
1543
|
+
backgroundColor: AppColors.purpleShade50,
|
|
1544
|
+
alignItems: 'center',
|
|
1545
|
+
justifyContent: 'center',
|
|
1546
|
+
}}>
|
|
1547
|
+
<BrainIcon color={AppColors.purple} size={16}/>
|
|
1548
|
+
</View>
|
|
1549
|
+
<View style={{ flex: 1 }}>
|
|
1550
|
+
<Text style={{
|
|
1551
|
+
fontFamily: AppFonts.interBold,
|
|
1552
|
+
fontSize: 13.5,
|
|
1553
|
+
lineHeight: 18,
|
|
1554
|
+
color: AppColors.primaryBlack,
|
|
1555
|
+
}}>
|
|
1556
|
+
Auto-Calculate Limits from RAM
|
|
1557
|
+
</Text>
|
|
1558
|
+
<Text style={{
|
|
1559
|
+
fontFamily: AppFonts.interRegular,
|
|
1560
|
+
fontSize: 11,
|
|
1561
|
+
lineHeight: 15,
|
|
1562
|
+
color: AppColors.grayText,
|
|
1563
|
+
marginTop: 1,
|
|
1564
|
+
}}>
|
|
1565
|
+
Dynamically sets log limits according to available device memory
|
|
1566
|
+
</Text>
|
|
1567
|
+
</View>
|
|
1568
|
+
</View>
|
|
1569
|
+
|
|
1570
|
+
<TouchableScale accessible={true} accessibilityRole="switch" accessibilityLabel="Toggle auto RAM limit calculation" accessibilityState={{ checked: isAutoRamLimitEnabled }} onPress={() => setIsAutoRamLimitEnabled(prev => !prev)} style={{
|
|
1571
|
+
width: 42,
|
|
1572
|
+
height: 24,
|
|
1573
|
+
borderRadius: 12,
|
|
1574
|
+
backgroundColor: isAutoRamLimitEnabled
|
|
1575
|
+
? AppColors.purple
|
|
1576
|
+
: AppColors.grayBorderSecondary,
|
|
1577
|
+
padding: 2,
|
|
1578
|
+
justifyContent: 'center',
|
|
1579
|
+
alignItems: isAutoRamLimitEnabled
|
|
1580
|
+
? 'flex-end'
|
|
1581
|
+
: 'flex-start',
|
|
1582
|
+
}}>
|
|
1583
|
+
<View style={{
|
|
1584
|
+
width: 20,
|
|
1585
|
+
height: 20,
|
|
1586
|
+
borderRadius: 10,
|
|
1587
|
+
backgroundColor: AppColors.white,
|
|
1588
|
+
shadowColor: AppColors.black,
|
|
1589
|
+
shadowOpacity: 0.18,
|
|
1590
|
+
shadowRadius: 2,
|
|
1591
|
+
shadowOffset: { width: 0, height: 1 },
|
|
1592
|
+
}}/>
|
|
1593
|
+
</TouchableScale>
|
|
1594
|
+
</View>
|
|
1595
|
+
|
|
1596
|
+
<View style={{ height: 1, backgroundColor: AppColors.dividerColor }}/>
|
|
1597
|
+
|
|
1598
|
+
{/* Device Free RAM Display */}
|
|
1599
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 10 }}>
|
|
1600
|
+
<View style={{
|
|
1601
|
+
width: 32,
|
|
1602
|
+
height: 32,
|
|
1603
|
+
borderRadius: 8,
|
|
1604
|
+
backgroundColor: isAutoRamLimitEnabled
|
|
1605
|
+
? `${AppColors.purple}14`
|
|
1606
|
+
: AppColors.grayBackground,
|
|
1607
|
+
alignItems: 'center',
|
|
1608
|
+
justifyContent: 'center',
|
|
1609
|
+
}}>
|
|
1610
|
+
<SignalIcon color={isAutoRamLimitEnabled
|
|
1611
|
+
? AppColors.purple
|
|
1612
|
+
: AppColors.grayTextWeak} size={15}/>
|
|
1613
|
+
</View>
|
|
1614
|
+
<View style={{ flex: 1 }}>
|
|
1615
|
+
<Text style={{
|
|
1616
|
+
fontFamily: AppFonts.interBold,
|
|
1617
|
+
fontSize: 13.5,
|
|
1618
|
+
lineHeight: 18,
|
|
1619
|
+
color: isAutoRamLimitEnabled
|
|
1620
|
+
? AppColors.primaryBlack
|
|
1621
|
+
: AppColors.grayText,
|
|
1622
|
+
}}>
|
|
1623
|
+
Detected Available RAM
|
|
1624
|
+
</Text>
|
|
1625
|
+
<Text style={{
|
|
1626
|
+
fontFamily: AppFonts.interRegular,
|
|
1627
|
+
fontSize: 11,
|
|
1628
|
+
lineHeight: 15,
|
|
1629
|
+
color: AppColors.grayText,
|
|
1630
|
+
marginTop: 1,
|
|
1631
|
+
}}>
|
|
1632
|
+
{deviceFreeRamMb} MB available on device
|
|
1633
|
+
</Text>
|
|
1634
|
+
</View>
|
|
1635
|
+
<View style={{
|
|
1636
|
+
paddingHorizontal: 10,
|
|
1637
|
+
paddingVertical: 5,
|
|
1638
|
+
borderRadius: 8,
|
|
1639
|
+
backgroundColor: isAutoRamLimitEnabled
|
|
1640
|
+
? `${AppColors.purple}12`
|
|
1641
|
+
: AppColors.grayBackground,
|
|
1642
|
+
borderWidth: 1,
|
|
1643
|
+
borderColor: isAutoRamLimitEnabled
|
|
1644
|
+
? `${AppColors.purple}26`
|
|
1645
|
+
: AppColors.dividerColor,
|
|
1646
|
+
}}>
|
|
1647
|
+
<Text style={{
|
|
1648
|
+
fontFamily: AppFonts.interBold,
|
|
1649
|
+
fontSize: 12,
|
|
1650
|
+
lineHeight: 15,
|
|
1651
|
+
color: isAutoRamLimitEnabled
|
|
1652
|
+
? AppColors.purple
|
|
1653
|
+
: AppColors.grayText,
|
|
1654
|
+
}}>
|
|
1655
|
+
{deviceFreeRamMb} MB
|
|
1656
|
+
</Text>
|
|
1657
|
+
</View>
|
|
1658
|
+
</View>
|
|
1659
|
+
|
|
1660
|
+
{/* Profile Overview */}
|
|
1661
|
+
<View style={{
|
|
1662
|
+
marginTop: 4,
|
|
1663
|
+
paddingTop: 8,
|
|
1664
|
+
borderTopWidth: 1,
|
|
1665
|
+
borderTopColor: AppColors.dividerColor,
|
|
1666
|
+
gap: 6,
|
|
1667
|
+
}}>
|
|
1668
|
+
<View style={{
|
|
1669
|
+
flexDirection: 'row',
|
|
1670
|
+
alignItems: 'center',
|
|
1671
|
+
justifyContent: 'space-between',
|
|
1672
|
+
}}>
|
|
1673
|
+
<Text style={{
|
|
1674
|
+
fontFamily: AppFonts.interBold,
|
|
1675
|
+
fontSize: 11.5,
|
|
1676
|
+
lineHeight: 15,
|
|
1677
|
+
color: AppColors.purple,
|
|
1678
|
+
}}>
|
|
1679
|
+
Profile: {autoRamProfile.profileName}
|
|
1680
|
+
</Text>
|
|
1681
|
+
<View style={{
|
|
1682
|
+
backgroundColor: isAutoRamLimitEnabled
|
|
1683
|
+
? `${AppColors.emerald500}18`
|
|
1684
|
+
: `${AppColors.purple}18`,
|
|
1685
|
+
paddingHorizontal: 7,
|
|
1686
|
+
paddingVertical: 2.5,
|
|
1687
|
+
borderRadius: 4,
|
|
1688
|
+
}}>
|
|
1689
|
+
<Text style={{
|
|
1690
|
+
fontFamily: AppFonts.interBold,
|
|
1691
|
+
fontSize: 9.5,
|
|
1692
|
+
color: isAutoRamLimitEnabled
|
|
1693
|
+
? AppColors.emerald500
|
|
1694
|
+
: AppColors.purple,
|
|
1695
|
+
}}>
|
|
1696
|
+
{isAutoRamLimitEnabled ? 'AUTO-TUNED' : 'MANUAL'}
|
|
1697
|
+
</Text>
|
|
1698
|
+
</View>
|
|
1699
|
+
</View>
|
|
1700
|
+
|
|
1701
|
+
<View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 8, marginTop: 4 }}>
|
|
1702
|
+
{[
|
|
1703
|
+
{
|
|
1704
|
+
label: 'APIs',
|
|
1705
|
+
value: isAutoRamLimitEnabled
|
|
1706
|
+
? autoRamProfile.maxNetworkLogs
|
|
1707
|
+
: maxNetworkLogs,
|
|
1708
|
+
color: AppColors.blue500,
|
|
1709
|
+
},
|
|
1710
|
+
{
|
|
1711
|
+
label: 'Logs',
|
|
1712
|
+
value: isAutoRamLimitEnabled
|
|
1713
|
+
? autoRamProfile.maxConsoleLogs
|
|
1714
|
+
: maxConsoleLogs,
|
|
1715
|
+
color: AppColors.sky500,
|
|
1716
|
+
},
|
|
1717
|
+
{
|
|
1718
|
+
label: 'Analytics',
|
|
1719
|
+
value: isAutoRamLimitEnabled
|
|
1720
|
+
? autoRamProfile.maxAnalyticsEvents
|
|
1721
|
+
: maxAnalyticsEventsLimit,
|
|
1722
|
+
color: AppColors.purple,
|
|
1723
|
+
},
|
|
1724
|
+
{
|
|
1725
|
+
label: 'Crash',
|
|
1726
|
+
value: isAutoRamLimitEnabled
|
|
1727
|
+
? autoRamProfile.maxCrashRecords
|
|
1728
|
+
: maxCrashLogs,
|
|
1729
|
+
color: AppColors.errorColor,
|
|
1730
|
+
},
|
|
1731
|
+
].map(item => (<View key={item.label} style={{
|
|
1732
|
+
flexDirection: 'row',
|
|
1733
|
+
alignItems: 'center',
|
|
1734
|
+
gap: 4,
|
|
1735
|
+
paddingHorizontal: 8,
|
|
1736
|
+
paddingVertical: 4,
|
|
1737
|
+
borderRadius: 6,
|
|
1738
|
+
backgroundColor: `${item.color}14`,
|
|
1739
|
+
borderWidth: 1,
|
|
1740
|
+
borderColor: `${item.color}33`,
|
|
1741
|
+
}}>
|
|
1742
|
+
<Text style={{
|
|
1743
|
+
fontFamily: AppFonts.interBold,
|
|
1744
|
+
fontSize: 10.5,
|
|
1745
|
+
lineHeight: 14,
|
|
1746
|
+
color: item.color,
|
|
1747
|
+
}}>
|
|
1748
|
+
{item.label}:
|
|
1749
|
+
</Text>
|
|
1750
|
+
<Text style={{
|
|
1751
|
+
fontFamily: AppFonts.interBold,
|
|
1752
|
+
fontSize: 10.5,
|
|
1753
|
+
lineHeight: 14,
|
|
1754
|
+
color: item.color,
|
|
1755
|
+
}}>
|
|
1756
|
+
{item.value} max
|
|
1757
|
+
</Text>
|
|
1758
|
+
</View>))}
|
|
1759
|
+
</View>
|
|
1760
|
+
</View>
|
|
1761
|
+
</View>
|
|
1762
|
+
|
|
1763
|
+
{/* Section 2: Memory-Safe OS Pruning Shield */}
|
|
1764
|
+
<View style={{
|
|
1765
|
+
backgroundColor: AppColors.primaryLight,
|
|
1766
|
+
borderRadius: 14,
|
|
1767
|
+
borderWidth: 1,
|
|
1768
|
+
borderColor: AppColors.grayBorderSecondary,
|
|
1769
|
+
overflow: 'hidden',
|
|
1770
|
+
padding: 14,
|
|
1771
|
+
gap: 12,
|
|
1772
|
+
}}>
|
|
1773
|
+
<Text style={{
|
|
1774
|
+
fontFamily: AppFonts.interBold,
|
|
1775
|
+
fontSize: 11,
|
|
1776
|
+
lineHeight: 14,
|
|
1777
|
+
color: AppColors.grayTextWeak,
|
|
1778
|
+
letterSpacing: 0.8,
|
|
1779
|
+
}}>
|
|
1780
|
+
LOW MEMORY PRESSURE PROTECTION
|
|
1781
|
+
</Text>
|
|
1782
|
+
|
|
1783
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 10 }}>
|
|
1784
|
+
<View style={{
|
|
1785
|
+
width: 32,
|
|
1786
|
+
height: 32,
|
|
1787
|
+
borderRadius: 8,
|
|
1788
|
+
backgroundColor: `${AppColors.emerald500}14`,
|
|
1789
|
+
alignItems: 'center',
|
|
1790
|
+
justifyContent: 'center',
|
|
1791
|
+
}}>
|
|
1792
|
+
<ShieldAlertIcon color={AppColors.emerald500} size={15}/>
|
|
1793
|
+
</View>
|
|
1794
|
+
<View style={{ flex: 1 }}>
|
|
1795
|
+
<Text style={{
|
|
1796
|
+
fontFamily: AppFonts.interBold,
|
|
1797
|
+
fontSize: 13.5,
|
|
1798
|
+
lineHeight: 18,
|
|
1799
|
+
color: AppColors.primaryBlack,
|
|
1800
|
+
}}>
|
|
1801
|
+
OS Memory Warning Guard
|
|
1802
|
+
</Text>
|
|
1803
|
+
<Text style={{
|
|
1804
|
+
fontFamily: AppFonts.interRegular,
|
|
1805
|
+
fontSize: 11,
|
|
1806
|
+
lineHeight: 15,
|
|
1807
|
+
color: AppColors.grayText,
|
|
1808
|
+
marginTop: 1,
|
|
1809
|
+
}}>
|
|
1810
|
+
Automatically prunes in-memory buffers by 50% when the OS signals low memory
|
|
1811
|
+
</Text>
|
|
1812
|
+
</View>
|
|
1813
|
+
<View style={{
|
|
1814
|
+
paddingHorizontal: 8,
|
|
1815
|
+
paddingVertical: 3,
|
|
1816
|
+
borderRadius: 6,
|
|
1817
|
+
backgroundColor: `${AppColors.emerald500}18`,
|
|
1818
|
+
}}>
|
|
1819
|
+
<Text style={{
|
|
1820
|
+
fontFamily: AppFonts.interBold,
|
|
1821
|
+
fontSize: 10,
|
|
1822
|
+
color: AppColors.emerald500,
|
|
1823
|
+
}}>
|
|
1824
|
+
ACTIVE
|
|
1825
|
+
</Text>
|
|
1826
|
+
</View>
|
|
1827
|
+
</View>
|
|
1828
|
+
|
|
1829
|
+
<View style={{ height: 1, backgroundColor: AppColors.dividerColor }}/>
|
|
1830
|
+
|
|
1831
|
+
{/* Instant Prune Button */}
|
|
1832
|
+
<View style={{
|
|
1833
|
+
flexDirection: 'row',
|
|
1834
|
+
alignItems: 'center',
|
|
1835
|
+
justifyContent: 'space-between',
|
|
1836
|
+
gap: 10,
|
|
1837
|
+
}}>
|
|
1838
|
+
<View style={{ flex: 1 }}>
|
|
1839
|
+
<Text style={{
|
|
1840
|
+
fontFamily: AppFonts.interBold,
|
|
1841
|
+
fontSize: 13,
|
|
1842
|
+
color: AppColors.primaryBlack,
|
|
1843
|
+
}}>
|
|
1844
|
+
Manual Memory Cleanup
|
|
1845
|
+
</Text>
|
|
1846
|
+
<Text style={{
|
|
1847
|
+
fontFamily: AppFonts.interRegular,
|
|
1848
|
+
fontSize: 11,
|
|
1849
|
+
color: AppColors.grayText,
|
|
1850
|
+
marginTop: 1,
|
|
1851
|
+
}}>
|
|
1852
|
+
Prune older entries across all log stores and free RAM
|
|
1853
|
+
</Text>
|
|
1854
|
+
</View>
|
|
1855
|
+
<TouchableScale onPress={() => {
|
|
1856
|
+
const summary = pruneAllLogs('manual', 0.5);
|
|
1857
|
+
showToast(`Pruned ${summary.totalPruned} items from memory`);
|
|
1858
|
+
}} style={{
|
|
1859
|
+
backgroundColor: AppColors.purple,
|
|
1860
|
+
paddingHorizontal: 12,
|
|
1861
|
+
paddingVertical: 8,
|
|
1862
|
+
borderRadius: 8,
|
|
1863
|
+
flexDirection: 'row',
|
|
1864
|
+
alignItems: 'center',
|
|
1865
|
+
gap: 5,
|
|
1866
|
+
}}>
|
|
1867
|
+
<TrashIcon size={13} color={AppColors.white}/>
|
|
1868
|
+
<Text style={{
|
|
1869
|
+
fontFamily: AppFonts.interBold,
|
|
1870
|
+
fontSize: 11.5,
|
|
1871
|
+
color: AppColors.white,
|
|
1872
|
+
}}>
|
|
1873
|
+
Prune Now
|
|
1874
|
+
</Text>
|
|
1875
|
+
</TouchableScale>
|
|
1876
|
+
</View>
|
|
1877
|
+
</View>
|
|
1878
|
+
</View>)}
|
|
1668
1879
|
<View style={{ height: 48 }}/>
|
|
1669
1880
|
</ScrollView>
|
|
1670
1881
|
|