react-native-inapp-inspector 2.2.2 → 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.
Files changed (159) hide show
  1. package/dist/commonjs/components/AnalyticsDetail.js +5 -1
  2. package/dist/commonjs/components/AnalyticsEventCard.js +2 -1
  3. package/dist/commonjs/components/DiffViewer.js +1 -1
  4. package/dist/commonjs/components/Inspector/BundleTab.js +22 -0
  5. package/dist/commonjs/components/Inspector/DeviceInfoTab.d.ts +3 -0
  6. package/dist/commonjs/components/Inspector/DeviceInfoTab.js +835 -0
  7. package/dist/commonjs/components/Inspector/InspectorHeader.js +12 -14
  8. package/dist/commonjs/components/Inspector/LogDetail.js +6 -3
  9. package/dist/commonjs/components/Inspector/MainScreen.js +7 -3
  10. package/dist/commonjs/components/Inspector/NetworkTab.js +92 -15
  11. package/dist/commonjs/components/Inspector/PerformanceTab.js +38 -12
  12. package/dist/commonjs/components/Inspector/SettingsPanel.js +440 -229
  13. package/dist/commonjs/components/Inspector/StorageTab.d.ts +3 -0
  14. package/dist/commonjs/components/Inspector/StorageTab.js +892 -0
  15. package/dist/commonjs/components/Inspector/TabBar.js +14 -0
  16. package/dist/commonjs/components/Inspector/TelemetryConsentModal.js +11 -2
  17. package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +4 -1
  18. package/dist/commonjs/components/NetworkIcons.d.ts +6 -0
  19. package/dist/commonjs/components/NetworkIcons.js +30 -1
  20. package/dist/commonjs/constants/version.d.ts +1 -1
  21. package/dist/commonjs/constants/version.js +1 -1
  22. package/dist/commonjs/customHooks/bundleAnalyzer.js +44 -22
  23. package/dist/commonjs/customHooks/storageInspector.d.ts +67 -0
  24. package/dist/commonjs/customHooks/storageInspector.js +486 -0
  25. package/dist/commonjs/i18n/locales/en.json +8 -2
  26. package/dist/commonjs/index.d.ts +1 -0
  27. package/dist/commonjs/index.js +16 -1
  28. package/dist/commonjs/storage.d.ts +5 -0
  29. package/dist/commonjs/storage.js +18 -0
  30. package/dist/commonjs/types/enums.d.ts +5 -0
  31. package/dist/commonjs/types/enums.js +5 -0
  32. package/dist/esm/components/AnalyticsDetail.js +6 -2
  33. package/dist/esm/components/AnalyticsEventCard.js +2 -1
  34. package/dist/esm/components/DiffViewer.js +1 -1
  35. package/dist/esm/components/Inspector/BundleTab.js +22 -0
  36. package/dist/esm/components/Inspector/DeviceInfoTab.d.ts +3 -0
  37. package/dist/esm/components/Inspector/DeviceInfoTab.js +796 -0
  38. package/dist/esm/components/Inspector/InspectorHeader.js +13 -15
  39. package/dist/esm/components/Inspector/LogDetail.js +7 -4
  40. package/dist/esm/components/Inspector/MainScreen.js +7 -3
  41. package/dist/esm/components/Inspector/NetworkTab.js +93 -16
  42. package/dist/esm/components/Inspector/PerformanceTab.js +39 -13
  43. package/dist/esm/components/Inspector/SettingsPanel.js +441 -230
  44. package/dist/esm/components/Inspector/StorageTab.d.ts +3 -0
  45. package/dist/esm/components/Inspector/StorageTab.js +853 -0
  46. package/dist/esm/components/Inspector/TabBar.js +15 -1
  47. package/dist/esm/components/Inspector/TelemetryConsentModal.js +11 -2
  48. package/dist/esm/components/Inspector/UpdateAvailableModal.js +4 -1
  49. package/dist/esm/components/NetworkIcons.d.ts +6 -0
  50. package/dist/esm/components/NetworkIcons.js +23 -0
  51. package/dist/esm/constants/version.d.ts +1 -1
  52. package/dist/esm/constants/version.js +1 -1
  53. package/dist/esm/customHooks/bundleAnalyzer.js +44 -22
  54. package/dist/esm/customHooks/storageInspector.d.ts +67 -0
  55. package/dist/esm/customHooks/storageInspector.js +469 -0
  56. package/dist/esm/i18n/locales/en.json +8 -2
  57. package/dist/esm/index.d.ts +1 -0
  58. package/dist/esm/index.js +5 -0
  59. package/dist/esm/storage.d.ts +5 -0
  60. package/dist/esm/storage.js +5 -0
  61. package/dist/esm/types/enums.d.ts +5 -0
  62. package/dist/esm/types/enums.js +5 -0
  63. package/package.json +9 -1
  64. package/src/analytics.ts +35 -0
  65. package/src/bundle.ts +25 -0
  66. package/src/components/AnalyticsDetail.tsx +870 -0
  67. package/src/components/AnalyticsEventCard.tsx +442 -0
  68. package/src/components/AnalyticsGraph.tsx +583 -0
  69. package/src/components/AnimatedEntrance.tsx +64 -0
  70. package/src/components/AppHeaderLogo.tsx +109 -0
  71. package/src/components/BrandCircleIcon.tsx +144 -0
  72. package/src/components/BrandSquareIcon.tsx +144 -0
  73. package/src/components/CodeSnippet.tsx +725 -0
  74. package/src/components/ConsoleLogCard.tsx +628 -0
  75. package/src/components/CopyButton.tsx +87 -0
  76. package/src/components/DiffViewer.tsx +82 -0
  77. package/src/components/DomainHeader.tsx +237 -0
  78. package/src/components/EmptyState.tsx +73 -0
  79. package/src/components/EndOfListFooter.tsx +100 -0
  80. package/src/components/ErrorBoundary.tsx +688 -0
  81. package/src/components/HeadersSection.tsx +192 -0
  82. package/src/components/HighlightText.tsx +100 -0
  83. package/src/components/Inspector/AnalyticsFilterModal.tsx +1250 -0
  84. package/src/components/Inspector/AnalyticsTab.tsx +1336 -0
  85. package/src/components/Inspector/BundleTab.tsx +4760 -0
  86. package/src/components/Inspector/ConsoleTab.tsx +702 -0
  87. package/src/components/Inspector/CrashDetail.tsx +941 -0
  88. package/src/components/Inspector/CrashFilterModal.tsx +721 -0
  89. package/src/components/Inspector/CrashTab.tsx +871 -0
  90. package/src/components/Inspector/DeviceInfoTab.tsx +1204 -0
  91. package/src/components/Inspector/FabLauncher.tsx +80 -0
  92. package/src/components/Inspector/InspectorContext.tsx +28 -0
  93. package/src/components/Inspector/InspectorHeader.tsx +972 -0
  94. package/src/components/Inspector/LogDetail.tsx +1431 -0
  95. package/src/components/Inspector/MainScreen.tsx +262 -0
  96. package/src/components/Inspector/NavigationTracker.tsx +13 -0
  97. package/src/components/Inspector/NetworkDetail.tsx +794 -0
  98. package/src/components/Inspector/NetworkTab.tsx +1183 -0
  99. package/src/components/Inspector/NpmUpdateToast.tsx +392 -0
  100. package/src/components/Inspector/PerformanceTab.tsx +1928 -0
  101. package/src/components/Inspector/ReduxDetail.tsx +1651 -0
  102. package/src/components/Inspector/ReduxTab.tsx +954 -0
  103. package/src/components/Inspector/SettingsPanel.tsx +3447 -0
  104. package/src/components/Inspector/StorageTab.tsx +1048 -0
  105. package/src/components/Inspector/TabBar.tsx +207 -0
  106. package/src/components/Inspector/TelemetryConsentModal.tsx +416 -0
  107. package/src/components/Inspector/UpdateAvailableModal.tsx +557 -0
  108. package/src/components/JsonViewer.tsx +486 -0
  109. package/src/components/LogCard.tsx +491 -0
  110. package/src/components/LogSyntaxHighlighter.tsx +178 -0
  111. package/src/components/MetaAccordion.tsx +340 -0
  112. package/src/components/MiniBarChart.tsx +42 -0
  113. package/src/components/MiniLineChart.tsx +33 -0
  114. package/src/components/NetworkIcons.tsx +2221 -0
  115. package/src/components/SectionHeader.tsx +113 -0
  116. package/src/components/SegmentedTabs.tsx +83 -0
  117. package/src/components/Slider.tsx +300 -0
  118. package/src/components/SourcePageCard.tsx +148 -0
  119. package/src/components/Toast.tsx +131 -0
  120. package/src/components/TouchableScale.tsx +91 -0
  121. package/src/components/TreeNode.tsx +186 -0
  122. package/src/console.ts +24 -0
  123. package/src/constants/index.ts +38 -0
  124. package/src/constants/version.ts +3 -0
  125. package/src/crash.ts +32 -0
  126. package/src/customHooks/analyticsLogger.ts +336 -0
  127. package/src/customHooks/bundleAnalyzer.ts +1256 -0
  128. package/src/customHooks/consoleLogger.ts +497 -0
  129. package/src/customHooks/crashHandler.ts +944 -0
  130. package/src/customHooks/logFilters.ts +32 -0
  131. package/src/customHooks/networkLogger.ts +419 -0
  132. package/src/customHooks/performanceTracker.ts +1014 -0
  133. package/src/customHooks/reduxLogger.ts +406 -0
  134. package/src/customHooks/storageInspector.ts +509 -0
  135. package/src/customHooks/useAccordion.tsx +60 -0
  136. package/src/decorators/index.ts +184 -0
  137. package/src/helpers/gaAnalyticsRegistry.ts +204 -0
  138. package/src/helpers/index.ts +860 -0
  139. package/src/helpers/memoryManager.ts +138 -0
  140. package/src/helpers/searchQueryParser.ts +283 -0
  141. package/src/helpers/settingsStore.ts +171 -0
  142. package/src/helpers/telemetry.ts +505 -0
  143. package/src/helpers/toast.ts +17 -0
  144. package/src/i18n/index.ts +69 -0
  145. package/src/i18n/locales/en.json +1058 -0
  146. package/src/index.tsx +2356 -0
  147. package/src/native/NativeInspector.ts +397 -0
  148. package/src/native/NativeNetworkInspector.ts +24 -0
  149. package/src/network.ts +22 -0
  150. package/src/performance.ts +38 -0
  151. package/src/redux.ts +23 -0
  152. package/src/storage.ts +18 -0
  153. package/src/styles/AppColors.ts +408 -0
  154. package/src/styles/AppFonts.ts +8 -0
  155. package/src/styles/common.ts +209 -0
  156. package/src/styles/index.ts +1570 -0
  157. package/src/types/enums.ts +199 -0
  158. package/src/types/index.ts +34 -0
  159. package/src/types/interfaces.ts +515 -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: 6,
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.5,
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' ? (<View style={{ gap: 12 }}>
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
- {/* Section 3.5: RAM-Based Auto Limits */}
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