react-native-inapp-inspector 1.1.3 → 1.1.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.
@@ -152,7 +152,9 @@ const NavigationTracker = ({ onStateChange }) => {
152
152
  const animateNextLayout = () => {
153
153
  react_native_1.LayoutAnimation.configureNext(react_native_1.LayoutAnimation.Presets.easeInEaseOut);
154
154
  };
155
- const NetworkInspector = ({ enabled = true, }) => {
155
+ const NetworkInspector = ({ enabled = true, storage, }) => {
156
+ // Set custom storage synchronously during render phase
157
+ (0, settingsStore_1.setCustomStorage)(storage || null);
156
158
  const [isDark, setIsDark] = (0, react_1.useState)(false);
157
159
  const [reduxState, setReduxState] = (0, react_1.useState)(null);
158
160
  // Action timeline + per-reducer last action are kept in component state so the
@@ -234,11 +236,11 @@ const NetworkInspector = ({ enabled = true, }) => {
234
236
  const visibleConsoleLogs = (0, react_1.useMemo)(() => {
235
237
  const filtered = consoleLogs.filter(log => {
236
238
  const type = log.type;
237
- if (type === 'info' && !showConsoleLevels.info)
239
+ if (type === 'info' && !showConsoleLevels?.info)
238
240
  return false;
239
- if (type === 'warn' && !showConsoleLevels.warn)
241
+ if (type === 'warn' && !showConsoleLevels?.warn)
240
242
  return false;
241
- if (type === 'error' && !showConsoleLevels.error)
243
+ if (type === 'error' && !showConsoleLevels?.error)
242
244
  return false;
243
245
  const message = log.message || '';
244
246
  const allPrefixes = [
@@ -268,9 +270,9 @@ const NetworkInspector = ({ enabled = true, }) => {
268
270
  insights: true,
269
271
  apis: true,
270
272
  logs: true,
271
- analytics: true,
272
- webview: true,
273
- redux: true,
273
+ analytics: false,
274
+ webview: false,
275
+ redux: false,
274
276
  });
275
277
  const [maxNetworkLogs, setMaxNetworkLogs] = (0, react_1.useState)(100);
276
278
  const [webViewCaptureCssJs, setWebViewCaptureCssJs] = (0, react_1.useState)(true);
@@ -280,9 +282,36 @@ const NetworkInspector = ({ enabled = true, }) => {
280
282
  const [insightsShowConsoleAlerts, setInsightsShowConsoleAlerts] = (0, react_1.useState)(true);
281
283
  // #6 — tab the inspector opens on. Shown with a DEFAULT badge in Settings.
282
284
  const [defaultTab, setDefaultTab] = (0, react_1.useState)('apis');
283
- // #9 — when false (default), consecutive identical entries in the API and
284
- // Console lists are collapsed into one row with a ×N counter.
285
285
  const [showDuplicateLogs, setShowDuplicateLogs] = (0, react_1.useState)(false);
286
+ const resetToDefaults = async () => {
287
+ await (0, settingsStore_1.clearPersistedSettings)();
288
+ setIsDark(false);
289
+ (0, styles_1.toggleGlobalTheme)(false);
290
+ setModalHeightPercent(90);
291
+ setTabVisibility({
292
+ insights: true,
293
+ apis: true,
294
+ logs: true,
295
+ analytics: false,
296
+ webview: false,
297
+ redux: false,
298
+ });
299
+ setDefaultTab('apis');
300
+ setMaxNetworkLogs(100);
301
+ setMaxConsoleLogs(200);
302
+ setShowConsoleLevels({
303
+ info: true,
304
+ warn: true,
305
+ error: true,
306
+ });
307
+ setWebViewCaptureCssJs(true);
308
+ setReduxAutoRefreshState(true);
309
+ setReduxExpandDepth(1);
310
+ setSlowRequestThreshold(1000);
311
+ setInsightsShowConsoleAlerts(true);
312
+ setShowDuplicateLogs(false);
313
+ react_native_1.Alert.alert('Settings Reset', 'All settings have been reset to default values.');
314
+ };
286
315
  // #5 — hydrate persisted settings once, then auto-save on any change.
287
316
  const settingsHydratedRef = (0, react_1.useRef)(false);
288
317
  (0, react_1.useEffect)(() => {
@@ -329,9 +358,9 @@ const NetworkInspector = ({ enabled = true, }) => {
329
358
  insights: true,
330
359
  apis: true,
331
360
  logs: true,
332
- analytics: true,
333
- webview: true,
334
- redux: true,
361
+ analytics: false,
362
+ webview: false,
363
+ redux: false,
335
364
  },
336
365
  ...(saved.tabVisibility || {}),
337
366
  apis: true,
@@ -658,7 +687,7 @@ const NetworkInspector = ({ enabled = true, }) => {
658
687
  // #6 — every time the inspector is opened, land on the chosen default tab.
659
688
  (0, react_1.useEffect)(() => {
660
689
  if (visible) {
661
- const target = defaultTab === 'apis' || tabVisibility[defaultTab]
690
+ const target = defaultTab === 'apis' || tabVisibility?.[defaultTab]
662
691
  ? defaultTab
663
692
  : 'apis';
664
693
  setActiveTab(target);
@@ -1328,7 +1357,8 @@ const NetworkInspector = ({ enabled = true, }) => {
1328
1357
  return (<react_native_1.View style={{ flex: 1, backgroundColor: AppColors_1.AppColors.grayBackground }}>
1329
1358
  {/* Settings Header with back button */}
1330
1359
  <react_native_linear_gradient_1.default colors={[AppColors_1.AppColors.purple, '#6B4EFF']} start={{ x: 0, y: 0 }} end={{ x: 1, y: 0 }} style={styles_1.default.headerGradient}>
1331
- <react_native_1.View style={[styles_1.default.header, { paddingHorizontal: 16, gap: 12 }]}>
1360
+ <react_native_1.SafeAreaView style={{ width: '100%' }}>
1361
+ <react_native_1.View style={[styles_1.default.header, { paddingHorizontal: 16, gap: 12 }]}>
1332
1362
  <TouchableScale_1.default onPress={() => {
1333
1363
  animateNextLayout();
1334
1364
  setSettingsPage(null);
@@ -1376,7 +1406,8 @@ const NetworkInspector = ({ enabled = true, }) => {
1376
1406
  </react_native_1.Text>
1377
1407
  </react_native_1.View>
1378
1408
  </react_native_1.View>
1379
- </react_native_linear_gradient_1.default>
1409
+ </react_native_1.SafeAreaView>
1410
+ </react_native_linear_gradient_1.default>
1380
1411
 
1381
1412
  <react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 16, gap: 12 }}>
1382
1413
  {/* Tab list */}
@@ -1421,7 +1452,7 @@ const NetworkInspector = ({ enabled = true, }) => {
1421
1452
  </react_native_1.View>
1422
1453
 
1423
1454
  {settingsTabs.map((tab, idx) => {
1424
- const isVisible = tab.key === 'apis' || tabVisibility[tab.key];
1455
+ const isVisible = tab.key === 'apis' || tabVisibility?.[tab.key];
1425
1456
  const isLast = idx === settingsTabs.length - 1;
1426
1457
  const isLocked = tab.key === 'apis';
1427
1458
  return (<react_native_1.View key={tab.key} style={{
@@ -1801,40 +1832,63 @@ const NetworkInspector = ({ enabled = true, }) => {
1801
1832
  </react_native_1.View>
1802
1833
  </react_native_1.View>
1803
1834
 
1804
- {/* Segmented picker only visible tabs are offered */}
1835
+ {/* Grid of Default Tab Cards */}
1805
1836
  <react_native_1.View style={{
1806
1837
  flexDirection: 'row',
1807
1838
  flexWrap: 'wrap',
1808
- backgroundColor: AppColors_1.AppColors.grayBackground,
1809
- borderRadius: 8,
1810
- padding: 2.5,
1811
- marginTop: 10,
1812
- borderWidth: 1,
1813
- borderColor: AppColors_1.AppColors.dividerColor,
1814
- gap: 2,
1839
+ gap: 8,
1840
+ marginTop: 12,
1815
1841
  }}>
1816
1842
  {settingsTabs
1817
- .filter(tab => tab.key === 'apis' || tabVisibility[tab.key])
1843
+ .filter(tab => tab.key === 'apis' || tabVisibility?.[tab.key])
1818
1844
  .map(tab => {
1819
1845
  const isActive = defaultTab === tab.key;
1820
1846
  return (<TouchableScale_1.default key={tab.key} onPress={() => setDefaultTab(tab.key)} style={{
1821
- paddingVertical: 6,
1822
- paddingHorizontal: 10,
1847
+ flexDirection: 'row',
1823
1848
  alignItems: 'center',
1849
+ gap: 8,
1850
+ paddingVertical: 10,
1851
+ paddingHorizontal: 12,
1852
+ borderRadius: 10,
1853
+ borderWidth: 1.5,
1854
+ borderColor: isActive ? AppColors_1.AppColors.purple : AppColors_1.AppColors.grayBorderSecondary,
1855
+ backgroundColor: isActive ? 'rgba(104,75,155,0.06)' : AppColors_1.AppColors.primaryLight,
1856
+ minWidth: '47%',
1857
+ flex: 1,
1858
+ }}>
1859
+ <react_native_1.View style={{
1860
+ width: 22,
1861
+ height: 22,
1824
1862
  borderRadius: 6,
1825
- backgroundColor: isActive
1826
- ? AppColors_1.AppColors.purple
1827
- : 'transparent',
1863
+ backgroundColor: isActive ? AppColors_1.AppColors.purple : AppColors_1.AppColors.purpleShade50,
1864
+ alignItems: 'center',
1865
+ justifyContent: 'center',
1828
1866
  }}>
1867
+ {tab.icon === 'insights' && (<NetworkIcons_1.InsightsIcon color={isActive ? '#FFFFFF' : AppColors_1.AppColors.purple} size={11}/>)}
1868
+ {tab.icon === 'apis' && (<NetworkIcons_1.SignalIcon color={isActive ? '#FFFFFF' : AppColors_1.AppColors.purple} size={11}/>)}
1869
+ {tab.icon === 'logs' && (<NetworkIcons_1.TerminalIcon color={isActive ? '#FFFFFF' : AppColors_1.AppColors.purple} size={11}/>)}
1870
+ {tab.icon === 'analytics' && (<NetworkIcons_1.AnalyticsIcon color={isActive ? '#FFFFFF' : AppColors_1.AppColors.purple} size={11}/>)}
1871
+ {tab.icon === 'webview' && (<NetworkIcons_1.GlobeIcon color={isActive ? '#FFFFFF' : AppColors_1.AppColors.purple} size={11}/>)}
1872
+ {tab.icon === 'redux' && (<NetworkIcons_1.TerminalIcon color={isActive ? '#FFFFFF' : AppColors_1.AppColors.purple} size={11}/>)}
1873
+ </react_native_1.View>
1829
1874
  <react_native_1.Text style={{
1830
1875
  fontFamily: AppFonts_1.AppFonts.interBold,
1831
- fontSize: 11,
1832
- color: isActive
1833
- ? '#FFFFFF'
1834
- : AppColors_1.AppColors.grayText,
1876
+ fontSize: 13,
1877
+ color: isActive ? AppColors_1.AppColors.purple : AppColors_1.AppColors.primaryBlack,
1878
+ flex: 1,
1835
1879
  }}>
1836
- {tab.label}
1880
+ {tab.label}
1837
1881
  </react_native_1.Text>
1882
+ {isActive && (<react_native_1.View style={{
1883
+ width: 14,
1884
+ height: 14,
1885
+ borderRadius: 7,
1886
+ backgroundColor: AppColors_1.AppColors.purple,
1887
+ alignItems: 'center',
1888
+ justifyContent: 'center',
1889
+ }}>
1890
+ <NetworkIcons_1.CheckIcon size={8} color="#FFFFFF"/>
1891
+ </react_native_1.View>)}
1838
1892
  </TouchableScale_1.default>);
1839
1893
  })}
1840
1894
  </react_native_1.View>
@@ -1916,73 +1970,130 @@ const NetworkInspector = ({ enabled = true, }) => {
1916
1970
  }}/>
1917
1971
  </TouchableScale_1.default>
1918
1972
  </react_native_1.View>
1919
- </react_native_1.View>
1920
- </react_native_1.View>
1921
- </react_native_1.ScrollView>
1922
- </react_native_1.View>);
1923
- }
1924
- const goBackToMain = () => {
1925
- animateNextLayout();
1926
- setSettingsPage('main');
1927
- };
1928
- const renderSubHeader = (title, icon, rightInfo) => (<react_native_1.View style={{
1929
- flexDirection: 'row',
1930
- alignItems: 'center',
1931
- gap: 12,
1932
- paddingBottom: 16,
1933
- borderBottomWidth: 1,
1934
- borderBottomColor: AppColors_1.AppColors.dividerColor,
1935
- marginBottom: 16,
1936
- }}>
1937
- <TouchableScale_1.default onPress={goBackToMain} style={{
1938
- width: 36,
1939
- height: 36,
1940
- borderRadius: 10,
1941
- backgroundColor: AppColors_1.AppColors.purpleShade50,
1942
- borderWidth: 1,
1943
- borderColor: 'rgba(104,75,155,0.2)',
1944
- alignItems: 'center',
1945
- justifyContent: 'center',
1946
- }}>
1947
- <NetworkIcons_1.WhiteBackNavigation color={AppColors_1.AppColors.purple} size={16}/>
1948
- </TouchableScale_1.default>
1949
- {icon && (<react_native_1.View style={{
1950
- width: 36,
1951
- height: 36,
1952
- borderRadius: 10,
1953
- backgroundColor: AppColors_1.AppColors.purpleShade50,
1973
+
1974
+ {/* Divider */}
1975
+ <react_native_1.View style={{
1976
+ height: 1,
1977
+ backgroundColor: AppColors_1.AppColors.dividerColor,
1978
+ }}/>
1979
+
1980
+ {/* Reset Settings */}
1981
+ <react_native_1.View style={{
1982
+ flexDirection: 'row',
1983
+ alignItems: 'center',
1984
+ paddingVertical: 12,
1985
+ paddingHorizontal: 14,
1986
+ gap: 12,
1987
+ }}>
1988
+ <react_native_1.View style={{
1989
+ flex: 1,
1990
+ flexDirection: 'row',
1991
+ alignItems: 'center',
1992
+ gap: 8,
1993
+ }}>
1994
+ <react_native_1.View style={{
1995
+ width: 20,
1996
+ height: 20,
1997
+ borderRadius: 6,
1998
+ backgroundColor: 'rgba(239,68,68,0.08)',
1954
1999
  borderWidth: 1,
1955
- borderColor: 'rgba(104,75,155,0.2)',
2000
+ borderColor: 'rgba(239,68,68,0.2)',
1956
2001
  alignItems: 'center',
1957
2002
  justifyContent: 'center',
1958
2003
  }}>
1959
- {icon}
1960
- </react_native_1.View>)}
1961
- <react_native_1.Text style={{
1962
- fontFamily: AppFonts_1.AppFonts.interBold,
1963
- fontSize: 18,
1964
- color: AppColors_1.AppColors.primaryBlack,
1965
- flex: 1,
1966
- }}>
1967
- {title}
1968
- </react_native_1.Text>
1969
- {rightInfo ? (<react_native_1.View style={{
1970
- backgroundColor: 'rgba(104,75,155,0.08)',
2004
+ <NetworkIcons_1.TrashIcon color={AppColors_1.AppColors.errorColor} size={11}/>
2005
+ </react_native_1.View>
2006
+ <react_native_1.View style={{ flex: 1 }}>
2007
+ <react_native_1.Text style={{
2008
+ fontFamily: AppFonts_1.AppFonts.interBold,
2009
+ fontSize: 13,
2010
+ color: AppColors_1.AppColors.primaryBlack,
2011
+ }}>
2012
+ Reset Settings
2013
+ </react_native_1.Text>
2014
+ <react_native_1.Text style={{
2015
+ fontFamily: AppFonts_1.AppFonts.interRegular,
2016
+ fontSize: 11,
2017
+ color: AppColors_1.AppColors.grayText,
2018
+ marginTop: 1,
2019
+ }}>
2020
+ Wipe custom configurations and load package defaults
2021
+ </react_native_1.Text>
2022
+ </react_native_1.View>
2023
+ </react_native_1.View>
2024
+
2025
+ <TouchableScale_1.default onPress={resetToDefaults} style={{
1971
2026
  paddingHorizontal: 10,
1972
2027
  paddingVertical: 5,
1973
- borderRadius: 8,
2028
+ borderRadius: 7,
2029
+ backgroundColor: 'rgba(255,46,87,0.08)',
1974
2030
  borderWidth: 1,
1975
- borderColor: 'rgba(104,75,155,0.15)',
2031
+ borderColor: 'rgba(255,46,87,0.2)',
1976
2032
  }}>
1977
- <react_native_1.Text style={{
2033
+ <react_native_1.Text style={{
1978
2034
  fontFamily: AppFonts_1.AppFonts.interBold,
1979
2035
  fontSize: 11,
1980
- color: AppColors_1.AppColors.purple,
2036
+ color: AppColors_1.AppColors.errorColor,
1981
2037
  }}>
1982
- {rightInfo}
1983
- </react_native_1.Text>
1984
- </react_native_1.View>) : null}
1985
- </react_native_1.View>);
2038
+ Reset
2039
+ </react_native_1.Text>
2040
+ </TouchableScale_1.default>
2041
+ </react_native_1.View>
2042
+ </react_native_1.View>
2043
+ </react_native_1.View>
2044
+
2045
+ {/* Storage Status */}
2046
+ <react_native_1.View style={{
2047
+ backgroundColor: (0, settingsStore_1.isPersistentStorageAvailable)()
2048
+ ? 'rgba(74,222,128,0.08)'
2049
+ : 'rgba(234,179,8,0.08)',
2050
+ borderRadius: 12,
2051
+ borderWidth: 1,
2052
+ borderColor: (0, settingsStore_1.isPersistentStorageAvailable)()
2053
+ ? 'rgba(74,222,128,0.2)'
2054
+ : 'rgba(234,179,8,0.2)',
2055
+ padding: 12,
2056
+ marginTop: 16,
2057
+ flexDirection: 'row',
2058
+ alignItems: 'center',
2059
+ gap: 10,
2060
+ }}>
2061
+ <react_native_1.View style={{
2062
+ width: 8,
2063
+ height: 8,
2064
+ borderRadius: 4,
2065
+ backgroundColor: (0, settingsStore_1.isPersistentStorageAvailable)() ? '#22C55E' : '#EAB308',
2066
+ }}/>
2067
+ <react_native_1.View style={{ flex: 1 }}>
2068
+ <react_native_1.Text style={{
2069
+ fontFamily: AppFonts_1.AppFonts.interBold,
2070
+ fontSize: 12,
2071
+ color: (0, settingsStore_1.isPersistentStorageAvailable)() ? '#15803D' : '#854D0E',
2072
+ }}>
2073
+ {(0, settingsStore_1.isPersistentStorageAvailable)()
2074
+ ? `Storage: Persistent (${storage ? 'Custom' : 'iOS Settings'})`
2075
+ : 'Storage: Temporary (In-Memory)'}
2076
+ </react_native_1.Text>
2077
+ <react_native_1.Text style={{
2078
+ fontFamily: AppFonts_1.AppFonts.interRegular,
2079
+ fontSize: 10.5,
2080
+ color: (0, settingsStore_1.isPersistentStorageAvailable)() ? '#166534' : '#854D0E',
2081
+ marginTop: 2,
2082
+ opacity: 0.8,
2083
+ }}>
2084
+ {(0, settingsStore_1.isPersistentStorageAvailable)()
2085
+ ? 'Your settings are saved across app restarts.'
2086
+ : 'Settings reset when closed. To persist settings, pass a storage object to <NetworkInspector storage={...} />.'}
2087
+ </react_native_1.Text>
2088
+ </react_native_1.View>
2089
+ </react_native_1.View>
2090
+ </react_native_1.ScrollView>
2091
+ </react_native_1.View>);
2092
+ }
2093
+ const goBackToMain = () => {
2094
+ animateNextLayout();
2095
+ setSettingsPage('main');
2096
+ };
1986
2097
  // Helper: settings row with icon + label + optional description
1987
2098
  const renderSettingRow = (opts) => (<react_native_1.View style={{
1988
2099
  paddingVertical: 12,
@@ -2062,9 +2173,15 @@ const NetworkInspector = ({ enabled = true, }) => {
2062
2173
  })}
2063
2174
  </react_native_1.View>)}
2064
2175
  </react_native_1.View>);
2176
+ let content = null;
2177
+ let title = '';
2178
+ let icon = null;
2179
+ let rightInfo = '';
2065
2180
  if (settingsPage === 'apis') {
2066
- return (<react_native_1.ScrollView style={{ flex: 1, backgroundColor: AppColors_1.AppColors.grayBackground }} contentContainerStyle={{ padding: 16 }}>
2067
- {renderSubHeader('APIs Settings', <NetworkIcons_1.SignalIcon color={AppColors_1.AppColors.purple} size={16}/>, `Total: ${logs.length}`)}
2181
+ title = 'APIs Settings';
2182
+ icon = <NetworkIcons_1.SignalIcon color="#FFFFFF" size={16}/>;
2183
+ rightInfo = `Total: ${logs.length}`;
2184
+ content = (<react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 16 }}>
2068
2185
  <react_native_1.View style={{
2069
2186
  backgroundColor: AppColors_1.AppColors.primaryLight,
2070
2187
  padding: 16,
@@ -2124,9 +2241,11 @@ const NetworkInspector = ({ enabled = true, }) => {
2124
2241
  </react_native_1.View>
2125
2242
  </react_native_1.ScrollView>);
2126
2243
  }
2127
- if (settingsPage === 'logs') {
2128
- return (<react_native_1.ScrollView style={{ flex: 1, backgroundColor: AppColors_1.AppColors.grayBackground }} contentContainerStyle={{ padding: 16 }}>
2129
- {renderSubHeader('Logs Settings', <NetworkIcons_1.TerminalIcon color={AppColors_1.AppColors.purple} size={16}/>, `Total: ${consoleLogs.length}`)}
2244
+ else if (settingsPage === 'logs') {
2245
+ title = 'Logs Settings';
2246
+ icon = <NetworkIcons_1.TerminalIcon color="#FFFFFF" size={16}/>;
2247
+ rightInfo = `Total: ${consoleLogs.length}`;
2248
+ content = (<react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 16 }}>
2130
2249
  <react_native_1.View style={{
2131
2250
  backgroundColor: AppColors_1.AppColors.primaryLight,
2132
2251
  padding: 16,
@@ -2155,7 +2274,7 @@ const NetworkInspector = ({ enabled = true, }) => {
2155
2274
  Log Levels
2156
2275
  </react_native_1.Text>
2157
2276
  {['info', 'warn', 'error'].map((level, li) => {
2158
- const isLvlActive = showConsoleLevels[level];
2277
+ const isLvlActive = showConsoleLevels?.[level];
2159
2278
  const levelColor = level === 'error'
2160
2279
  ? AppColors_1.AppColors.errorColor
2161
2280
  : level === 'warn'
@@ -2236,9 +2355,11 @@ const NetworkInspector = ({ enabled = true, }) => {
2236
2355
  </react_native_1.View>
2237
2356
  </react_native_1.ScrollView>);
2238
2357
  }
2239
- if (settingsPage === 'analytics') {
2240
- return (<react_native_1.ScrollView style={{ flex: 1, backgroundColor: AppColors_1.AppColors.grayBackground }} contentContainerStyle={{ padding: 16 }}>
2241
- {renderSubHeader('Analytics Settings', <NetworkIcons_1.AnalyticsIcon color={AppColors_1.AppColors.purple} size={16}/>, `Events: ${analyticsEvents.length}`)}
2358
+ else if (settingsPage === 'analytics') {
2359
+ title = 'Analytics Settings';
2360
+ icon = <NetworkIcons_1.AnalyticsIcon color="#FFFFFF" size={16}/>;
2361
+ rightInfo = `Events: ${analyticsEvents.length}`;
2362
+ content = (<react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 16 }}>
2242
2363
  <react_native_1.View style={{
2243
2364
  backgroundColor: AppColors_1.AppColors.primaryLight,
2244
2365
  padding: 16,
@@ -2292,9 +2413,11 @@ const NetworkInspector = ({ enabled = true, }) => {
2292
2413
  </react_native_1.View>
2293
2414
  </react_native_1.ScrollView>);
2294
2415
  }
2295
- if (settingsPage === 'webview') {
2296
- return (<react_native_1.ScrollView style={{ flex: 1, backgroundColor: AppColors_1.AppColors.grayBackground }} contentContainerStyle={{ padding: 16 }}>
2297
- {renderSubHeader('WebView Settings', <NetworkIcons_1.GlobeIcon color={AppColors_1.AppColors.purple} size={16}/>, `History: ${webViewNavHistory.length}`)}
2416
+ else if (settingsPage === 'webview') {
2417
+ title = 'WebView Settings';
2418
+ icon = <NetworkIcons_1.GlobeIcon color="#FFFFFF" size={16}/>;
2419
+ rightInfo = `History: ${webViewNavHistory.length}`;
2420
+ content = (<react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 16 }}>
2298
2421
  <react_native_1.View style={{
2299
2422
  backgroundColor: AppColors_1.AppColors.primaryLight,
2300
2423
  padding: 16,
@@ -2364,9 +2487,11 @@ const NetworkInspector = ({ enabled = true, }) => {
2364
2487
  </react_native_1.View>
2365
2488
  </react_native_1.ScrollView>);
2366
2489
  }
2367
- if (settingsPage === 'redux') {
2368
- return (<react_native_1.ScrollView style={{ flex: 1, backgroundColor: AppColors_1.AppColors.grayBackground }} contentContainerStyle={{ padding: 16 }}>
2369
- {renderSubHeader('Redux Settings', <NetworkIcons_1.TerminalIcon color={AppColors_1.AppColors.purple} size={16}/>, `Reducers: ${Object.keys(reduxState || {}).length}`)}
2490
+ else if (settingsPage === 'redux') {
2491
+ title = 'Redux Settings';
2492
+ icon = <NetworkIcons_1.TerminalIcon color="#FFFFFF" size={16}/>;
2493
+ rightInfo = `Reducers: ${Object.keys(reduxState || {}).length}`;
2494
+ content = (<react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 16 }}>
2370
2495
  <react_native_1.View style={{
2371
2496
  backgroundColor: AppColors_1.AppColors.primaryLight,
2372
2497
  padding: 16,
@@ -2450,53 +2575,108 @@ const NetworkInspector = ({ enabled = true, }) => {
2450
2575
  </react_native_1.View>
2451
2576
  </react_native_1.ScrollView>);
2452
2577
  }
2453
- // Default return page is Insights settings
2454
- return (<react_native_1.ScrollView style={{ flex: 1, backgroundColor: AppColors_1.AppColors.grayBackground }} contentContainerStyle={{ padding: 16 }}>
2455
- {renderSubHeader('Insights Settings', <NetworkIcons_1.InsightsIcon color={AppColors_1.AppColors.purple} size={16}/>)}
2456
- <react_native_1.View style={{
2457
- backgroundColor: AppColors_1.AppColors.primaryLight,
2458
- padding: 16,
2459
- borderRadius: 12,
2578
+ else {
2579
+ title = 'Insights Settings';
2580
+ icon = <NetworkIcons_1.InsightsIcon color="#FFFFFF" size={16}/>;
2581
+ content = (<react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 16 }}>
2582
+ <react_native_1.View style={{
2583
+ backgroundColor: AppColors_1.AppColors.primaryLight,
2584
+ padding: 16,
2585
+ borderRadius: 12,
2586
+ borderWidth: 1,
2587
+ borderColor: AppColors_1.AppColors.grayBorderSecondary,
2588
+ gap: 4,
2589
+ }}>
2590
+ {renderSettingRow({
2591
+ icon: <NetworkIcons_1.SignalIcon color={AppColors_1.AppColors.purple} size={16}/>,
2592
+ label: 'Slow Latency Warning',
2593
+ description: 'Alert threshold for slow API request duration',
2594
+ picker: {
2595
+ options: [500, 1000, 2000],
2596
+ selectedValue: slowRequestThreshold,
2597
+ onSelect: setSlowRequestThreshold,
2598
+ },
2599
+ })}
2600
+ <react_native_1.View style={{ height: 1, backgroundColor: AppColors_1.AppColors.dividerColor }}/>
2601
+ {renderSettingRow({
2602
+ icon: <NetworkIcons_1.TerminalIcon color={AppColors_1.AppColors.purple} size={16}/>,
2603
+ label: 'Show Console Alerts',
2604
+ description: 'Flags critical warnings or crash events on dashboard',
2605
+ isLast: true,
2606
+ onPress: () => setInsightsShowConsoleAlerts(prev => !prev),
2607
+ right: (<react_native_1.View style={{
2608
+ width: 22,
2609
+ height: 22,
2610
+ borderRadius: 6,
2611
+ borderWidth: 2,
2612
+ borderColor: insightsShowConsoleAlerts
2613
+ ? AppColors_1.AppColors.purple
2614
+ : AppColors_1.AppColors.grayTextWeak,
2615
+ backgroundColor: insightsShowConsoleAlerts
2616
+ ? 'rgba(104, 75, 155, 0.1)'
2617
+ : 'transparent',
2618
+ alignItems: 'center',
2619
+ justifyContent: 'center',
2620
+ }}>
2621
+ {insightsShowConsoleAlerts && (<NetworkIcons_1.CheckIcon size={12} color={AppColors_1.AppColors.purple}/>)}
2622
+ </react_native_1.View>),
2623
+ })}
2624
+ </react_native_1.View>
2625
+ </react_native_1.ScrollView>);
2626
+ }
2627
+ return (<react_native_1.View style={{ flex: 1, backgroundColor: AppColors_1.AppColors.grayBackground }}>
2628
+ <react_native_linear_gradient_1.default colors={[AppColors_1.AppColors.purple, '#6B4EFF']} start={{ x: 0, y: 0 }} end={{ x: 1, y: 0 }} style={styles_1.default.headerGradient}>
2629
+ <react_native_1.SafeAreaView style={{ width: '100%' }}>
2630
+ <react_native_1.View style={[styles_1.default.header, { paddingHorizontal: 16, gap: 12 }]}>
2631
+ <TouchableScale_1.default onPress={goBackToMain} hitSlop={12} style={{
2632
+ padding: 8,
2633
+ borderRadius: 10,
2634
+ backgroundColor: 'rgba(255, 255, 255, 0.15)',
2460
2635
  borderWidth: 1,
2461
- borderColor: AppColors_1.AppColors.grayBorderSecondary,
2462
- gap: 4,
2636
+ borderColor: 'rgba(255, 255, 255, 0.08)',
2463
2637
  }}>
2464
- {renderSettingRow({
2465
- icon: <NetworkIcons_1.SignalIcon color={AppColors_1.AppColors.purple} size={16}/>,
2466
- label: 'Slow Latency Warning',
2467
- description: 'Alert threshold for slow API request duration',
2468
- picker: {
2469
- options: [500, 1000, 2000],
2470
- selectedValue: slowRequestThreshold,
2471
- onSelect: setSlowRequestThreshold,
2472
- },
2473
- })}
2474
- <react_native_1.View style={{ height: 1, backgroundColor: AppColors_1.AppColors.dividerColor }}/>
2475
- {renderSettingRow({
2476
- icon: <NetworkIcons_1.TerminalIcon color={AppColors_1.AppColors.purple} size={16}/>,
2477
- label: 'Show Console Alerts',
2478
- description: 'Flags critical warnings or crash events on dashboard',
2479
- isLast: true,
2480
- onPress: () => setInsightsShowConsoleAlerts(prev => !prev),
2481
- right: (<react_native_1.View style={{
2482
- width: 22,
2483
- height: 22,
2484
- borderRadius: 6,
2485
- borderWidth: 2,
2486
- borderColor: insightsShowConsoleAlerts
2487
- ? AppColors_1.AppColors.purple
2488
- : AppColors_1.AppColors.grayTextWeak,
2489
- backgroundColor: insightsShowConsoleAlerts
2490
- ? 'rgba(104, 75, 155, 0.1)'
2491
- : 'transparent',
2492
- alignItems: 'center',
2493
- justifyContent: 'center',
2494
- }}>
2495
- {insightsShowConsoleAlerts && (<NetworkIcons_1.CheckIcon size={12} color={AppColors_1.AppColors.purple}/>)}
2496
- </react_native_1.View>),
2497
- })}
2498
- </react_native_1.View>
2499
- </react_native_1.ScrollView>);
2638
+ <NetworkIcons_1.WhiteBackNavigation color="#FFFFFF" size={16}/>
2639
+ </TouchableScale_1.default>
2640
+ {icon && (<react_native_1.View style={{
2641
+ width: 30,
2642
+ height: 30,
2643
+ borderRadius: 8,
2644
+ backgroundColor: 'rgba(255, 255, 255, 0.15)',
2645
+ alignItems: 'center',
2646
+ justifyContent: 'center',
2647
+ }}>
2648
+ {icon}
2649
+ </react_native_1.View>)}
2650
+ <react_native_1.View style={{ flex: 1 }}>
2651
+ <react_native_1.Text style={{
2652
+ fontFamily: AppFonts_1.AppFonts.interBold,
2653
+ fontSize: 17,
2654
+ color: '#FFFFFF',
2655
+ }}>
2656
+ {title}
2657
+ </react_native_1.Text>
2658
+ </react_native_1.View>
2659
+ {rightInfo ? (<react_native_1.View style={{
2660
+ backgroundColor: 'rgba(255, 255, 255, 0.15)',
2661
+ paddingHorizontal: 8,
2662
+ paddingVertical: 4,
2663
+ borderRadius: 8,
2664
+ borderWidth: 1,
2665
+ borderColor: 'rgba(255, 255, 255, 0.1)',
2666
+ }}>
2667
+ <react_native_1.Text style={{
2668
+ fontFamily: AppFonts_1.AppFonts.interBold,
2669
+ fontSize: 11,
2670
+ color: '#FFFFFF',
2671
+ }}>
2672
+ {rightInfo}
2673
+ </react_native_1.Text>
2674
+ </react_native_1.View>) : null}
2675
+ </react_native_1.View>
2676
+ </react_native_1.SafeAreaView>
2677
+ </react_native_linear_gradient_1.default>
2678
+ {content}
2679
+ </react_native_1.View>);
2500
2680
  };
2501
2681
  const renderInsightsDashboard = () => {
2502
2682
  const apiTotal = logs.length;
@@ -2532,11 +2712,11 @@ const NetworkInspector = ({ enabled = true, }) => {
2532
2712
  const totalSignals = apiTotal + logTotal + analyticsTotal + webviewTotal;
2533
2713
  const totalIssues = apiErrors + logErrors;
2534
2714
  const activeModules = [
2535
- tabVisibility.apis,
2536
- tabVisibility.logs,
2537
- tabVisibility.analytics,
2538
- tabVisibility.webview,
2539
- tabVisibility.redux,
2715
+ tabVisibility?.apis,
2716
+ tabVisibility?.logs,
2717
+ tabVisibility?.analytics,
2718
+ tabVisibility?.webview,
2719
+ tabVisibility?.redux,
2540
2720
  ].filter(Boolean).length;
2541
2721
  // Composite health score: success rate penalised by error volume and slow requests.
2542
2722
  const healthScore = totalSignals === 0
@@ -2703,7 +2883,7 @@ const NetworkInspector = ({ enabled = true, }) => {
2703
2883
  </react_native_1.View>
2704
2884
 
2705
2885
  {/* Module 1: APIs */}
2706
- {tabVisibility.apis && (<TouchableScale_1.default style={styles_1.default.dashboardModuleCard} onPress={() => switchActiveTab('apis')}>
2886
+ {tabVisibility?.apis && (<TouchableScale_1.default style={styles_1.default.dashboardModuleCard} onPress={() => switchActiveTab('apis')}>
2707
2887
  <react_native_1.View style={styles_1.default.dashboardModuleHeader}>
2708
2888
  <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
2709
2889
  <NetworkIcons_1.SignalIcon color={AppColors_1.AppColors.purple} size={18}/>
@@ -2810,7 +2990,7 @@ const NetworkInspector = ({ enabled = true, }) => {
2810
2990
  </react_native_1.View>)}
2811
2991
  </react_native_1.View>
2812
2992
  </TouchableScale_1.default>)}
2813
- {tabVisibility.logs && (<TouchableScale_1.default style={styles_1.default.dashboardModuleCard} onPress={() => switchActiveTab('logs')}>
2993
+ {tabVisibility?.logs && (<TouchableScale_1.default style={styles_1.default.dashboardModuleCard} onPress={() => switchActiveTab('logs')}>
2814
2994
  <react_native_1.View style={styles_1.default.dashboardModuleHeader}>
2815
2995
  <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
2816
2996
  <NetworkIcons_1.TerminalIcon color="#0D9488" size={18}/>
@@ -2851,7 +3031,7 @@ const NetworkInspector = ({ enabled = true, }) => {
2851
3031
  </TouchableScale_1.default>)}
2852
3032
 
2853
3033
  {/* Module 3: Analytics */}
2854
- {tabVisibility.analytics && (<TouchableScale_1.default style={styles_1.default.dashboardModuleCard} onPress={() => switchActiveTab('analytics')}>
3034
+ {tabVisibility?.analytics && (<TouchableScale_1.default style={styles_1.default.dashboardModuleCard} onPress={() => switchActiveTab('analytics')}>
2855
3035
  <react_native_1.View style={styles_1.default.dashboardModuleHeader}>
2856
3036
  <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
2857
3037
  <NetworkIcons_1.AnalyticsIcon color="#EA580C" size={18}/>
@@ -2888,7 +3068,7 @@ const NetworkInspector = ({ enabled = true, }) => {
2888
3068
  </TouchableScale_1.default>)}
2889
3069
 
2890
3070
  {/* Module 4: WebView */}
2891
- {tabVisibility.webview && (<TouchableScale_1.default style={styles_1.default.dashboardModuleCard} onPress={() => switchActiveTab('webview')}>
3071
+ {tabVisibility?.webview && (<TouchableScale_1.default style={styles_1.default.dashboardModuleCard} onPress={() => switchActiveTab('webview')}>
2892
3072
  <react_native_1.View style={styles_1.default.dashboardModuleHeader}>
2893
3073
  <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
2894
3074
  <NetworkIcons_1.GlobeIcon color="#2563EB" size={18}/>
@@ -2921,7 +3101,7 @@ const NetworkInspector = ({ enabled = true, }) => {
2921
3101
  </TouchableScale_1.default>)}
2922
3102
 
2923
3103
  {/* Module 5: Redux Store */}
2924
- {tabVisibility.redux && (<TouchableScale_1.default style={styles_1.default.dashboardModuleCard} onPress={() => switchActiveTab('redux')}>
3104
+ {tabVisibility?.redux && (<TouchableScale_1.default style={styles_1.default.dashboardModuleCard} onPress={() => switchActiveTab('redux')}>
2925
3105
  <react_native_1.View style={styles_1.default.dashboardModuleHeader}>
2926
3106
  <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
2927
3107
  <NetworkIcons_1.TerminalIcon color={AppColors_1.AppColors.purple} size={18}/>
@@ -3234,7 +3414,8 @@ const NetworkInspector = ({ enabled = true, }) => {
3234
3414
  <react_native_1.StatusBar translucent backgroundColor="transparent" barStyle="light-content"/>
3235
3415
 
3236
3416
  <react_native_linear_gradient_1.default colors={[AppColors_1.AppColors.purple, '#6B4EFF']} style={styles_1.default.headerGradient}>
3237
- <react_native_1.View style={styles_1.default.header}>
3417
+ <react_native_1.SafeAreaView style={{ width: '100%' }}>
3418
+ <react_native_1.View style={styles_1.default.header}>
3238
3419
  <react_native_1.View style={[
3239
3420
  styles_1.default.headerLeft,
3240
3421
  {
@@ -3571,7 +3752,8 @@ const NetworkInspector = ({ enabled = true, }) => {
3571
3752
  </TouchableScale_1.default>
3572
3753
  </react_native_1.View>
3573
3754
  </react_native_1.View>
3574
- </react_native_linear_gradient_1.default>
3755
+ </react_native_1.SafeAreaView>
3756
+ </react_native_linear_gradient_1.default>
3575
3757
 
3576
3758
  {/* ─── Horizontal Scrollable Tab Bar inside Content ─── */}
3577
3759
  {selected == null &&
@@ -3616,7 +3798,7 @@ const NetworkInspector = ({ enabled = true, }) => {
3616
3798
  icon: 'redux',
3617
3799
  },
3618
3800
  ]
3619
- .filter(tab => tabVisibility[tab.key])
3801
+ .filter(tab => tabVisibility?.[tab.key])
3620
3802
  .map(tab => {
3621
3803
  const isActive = activeTab === tab.key;
3622
3804
  const iconColor = isActive
@@ -5118,13 +5300,13 @@ const NetworkInspector = ({ enabled = true, }) => {
5118
5300
  <react_native_1.View style={[
5119
5301
  styles_1.default.methodBadge,
5120
5302
  {
5121
- backgroundColor: `${constants_1.METHOD_COLORS[selected.method] ?? constants_1.METHOD_COLORS.ALL}15`,
5303
+ backgroundColor: constants_1.METHOD_COLORS[selected.method] ?? constants_1.METHOD_COLORS.ALL,
5122
5304
  },
5123
5305
  ]}>
5124
5306
  <react_native_1.Text style={[
5125
5307
  styles_1.default.methodBadgeText,
5126
5308
  {
5127
- color: constants_1.METHOD_COLORS[selected.method] ?? constants_1.METHOD_COLORS.ALL,
5309
+ color: '#FFFFFF',
5128
5310
  },
5129
5311
  ]}>
5130
5312
  {selected.method}