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.
- 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 +9 -1
- package/src/analytics.ts +35 -0
- package/src/bundle.ts +25 -0
- package/src/components/AnalyticsDetail.tsx +870 -0
- package/src/components/AnalyticsEventCard.tsx +442 -0
- package/src/components/AnalyticsGraph.tsx +583 -0
- package/src/components/AnimatedEntrance.tsx +64 -0
- package/src/components/AppHeaderLogo.tsx +109 -0
- package/src/components/BrandCircleIcon.tsx +144 -0
- package/src/components/BrandSquareIcon.tsx +144 -0
- package/src/components/CodeSnippet.tsx +725 -0
- package/src/components/ConsoleLogCard.tsx +628 -0
- package/src/components/CopyButton.tsx +87 -0
- package/src/components/DiffViewer.tsx +82 -0
- package/src/components/DomainHeader.tsx +237 -0
- package/src/components/EmptyState.tsx +73 -0
- package/src/components/EndOfListFooter.tsx +100 -0
- package/src/components/ErrorBoundary.tsx +688 -0
- package/src/components/HeadersSection.tsx +192 -0
- package/src/components/HighlightText.tsx +100 -0
- package/src/components/Inspector/AnalyticsFilterModal.tsx +1250 -0
- package/src/components/Inspector/AnalyticsTab.tsx +1336 -0
- package/src/components/Inspector/BundleTab.tsx +4760 -0
- package/src/components/Inspector/ConsoleTab.tsx +702 -0
- package/src/components/Inspector/CrashDetail.tsx +941 -0
- package/src/components/Inspector/CrashFilterModal.tsx +721 -0
- package/src/components/Inspector/CrashTab.tsx +871 -0
- package/src/components/Inspector/DeviceInfoTab.tsx +1204 -0
- package/src/components/Inspector/FabLauncher.tsx +80 -0
- package/src/components/Inspector/InspectorContext.tsx +28 -0
- package/src/components/Inspector/InspectorHeader.tsx +972 -0
- package/src/components/Inspector/LogDetail.tsx +1431 -0
- package/src/components/Inspector/MainScreen.tsx +262 -0
- package/src/components/Inspector/NavigationTracker.tsx +13 -0
- package/src/components/Inspector/NetworkDetail.tsx +794 -0
- package/src/components/Inspector/NetworkTab.tsx +1183 -0
- package/src/components/Inspector/NpmUpdateToast.tsx +392 -0
- package/src/components/Inspector/PerformanceTab.tsx +1928 -0
- package/src/components/Inspector/ReduxDetail.tsx +1651 -0
- package/src/components/Inspector/ReduxTab.tsx +954 -0
- package/src/components/Inspector/SettingsPanel.tsx +3447 -0
- package/src/components/Inspector/StorageTab.tsx +1048 -0
- package/src/components/Inspector/TabBar.tsx +207 -0
- package/src/components/Inspector/TelemetryConsentModal.tsx +416 -0
- package/src/components/Inspector/UpdateAvailableModal.tsx +557 -0
- package/src/components/JsonViewer.tsx +486 -0
- package/src/components/LogCard.tsx +491 -0
- package/src/components/LogSyntaxHighlighter.tsx +178 -0
- package/src/components/MetaAccordion.tsx +340 -0
- package/src/components/MiniBarChart.tsx +42 -0
- package/src/components/MiniLineChart.tsx +33 -0
- package/src/components/NetworkIcons.tsx +2221 -0
- package/src/components/SectionHeader.tsx +113 -0
- package/src/components/SegmentedTabs.tsx +83 -0
- package/src/components/Slider.tsx +300 -0
- package/src/components/SourcePageCard.tsx +148 -0
- package/src/components/Toast.tsx +131 -0
- package/src/components/TouchableScale.tsx +91 -0
- package/src/components/TreeNode.tsx +186 -0
- package/src/console.ts +24 -0
- package/src/constants/index.ts +38 -0
- package/src/constants/version.ts +3 -0
- package/src/crash.ts +32 -0
- package/src/customHooks/analyticsLogger.ts +336 -0
- package/src/customHooks/bundleAnalyzer.ts +1256 -0
- package/src/customHooks/consoleLogger.ts +497 -0
- package/src/customHooks/crashHandler.ts +944 -0
- package/src/customHooks/logFilters.ts +32 -0
- package/src/customHooks/networkLogger.ts +419 -0
- package/src/customHooks/performanceTracker.ts +1014 -0
- package/src/customHooks/reduxLogger.ts +406 -0
- package/src/customHooks/storageInspector.ts +509 -0
- package/src/customHooks/useAccordion.tsx +60 -0
- package/src/decorators/index.ts +184 -0
- package/src/helpers/gaAnalyticsRegistry.ts +204 -0
- package/src/helpers/index.ts +860 -0
- package/src/helpers/memoryManager.ts +138 -0
- package/src/helpers/searchQueryParser.ts +283 -0
- package/src/helpers/settingsStore.ts +171 -0
- package/src/helpers/telemetry.ts +505 -0
- package/src/helpers/toast.ts +17 -0
- package/src/i18n/index.ts +69 -0
- package/src/i18n/locales/en.json +1058 -0
- package/src/index.tsx +2356 -0
- package/src/native/NativeInspector.ts +397 -0
- package/src/native/NativeNetworkInspector.ts +24 -0
- package/src/network.ts +22 -0
- package/src/performance.ts +38 -0
- package/src/redux.ts +23 -0
- package/src/storage.ts +18 -0
- package/src/styles/AppColors.ts +408 -0
- package/src/styles/AppFonts.ts +8 -0
- package/src/styles/common.ts +209 -0
- package/src/styles/index.ts +1570 -0
- package/src/types/enums.ts +199 -0
- package/src/types/index.ts +34 -0
- package/src/types/interfaces.ts +515 -0
|
@@ -0,0 +1,1928 @@
|
|
|
1
|
+
import React, {useState, useEffect, useMemo, useRef} from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Platform,
|
|
4
|
+
ScrollView,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
Text,
|
|
7
|
+
TextInput,
|
|
8
|
+
TouchableOpacity,
|
|
9
|
+
View,
|
|
10
|
+
} from 'react-native';
|
|
11
|
+
import Svg, {
|
|
12
|
+
Path,
|
|
13
|
+
Defs,
|
|
14
|
+
LinearGradient,
|
|
15
|
+
Stop,
|
|
16
|
+
Line,
|
|
17
|
+
Circle,
|
|
18
|
+
G,
|
|
19
|
+
Rect,
|
|
20
|
+
} from 'react-native-svg';
|
|
21
|
+
import TouchableScale from '../TouchableScale';
|
|
22
|
+
import CopyButton from '../CopyButton';
|
|
23
|
+
import HighlightText from '../HighlightText';
|
|
24
|
+
import EndOfListFooter from '../EndOfListFooter';
|
|
25
|
+
import {AppColors} from '../../styles/AppColors';
|
|
26
|
+
import {AppFonts} from '../../styles/AppFonts';
|
|
27
|
+
import {useTranslation} from '../../i18n';
|
|
28
|
+
import {getRuntimeDiagnostics} from '../../helpers';
|
|
29
|
+
import {
|
|
30
|
+
SearchIcon,
|
|
31
|
+
CircleXIcon,
|
|
32
|
+
CircleAlertIcon,
|
|
33
|
+
PerformanceIcon,
|
|
34
|
+
BoltIcon,
|
|
35
|
+
LightbulbIcon,
|
|
36
|
+
WarningTriangleIcon,
|
|
37
|
+
MapIcon,
|
|
38
|
+
AtomIcon,
|
|
39
|
+
BrainIcon,
|
|
40
|
+
GlobeIcon,
|
|
41
|
+
ChevronIcon,
|
|
42
|
+
} from '../NetworkIcons';
|
|
43
|
+
import {
|
|
44
|
+
getPerformanceEvents,
|
|
45
|
+
subscribePerformanceEvents,
|
|
46
|
+
logPerformanceEvent,
|
|
47
|
+
clearPerformanceEvents,
|
|
48
|
+
} from '../../customHooks/performanceTracker';
|
|
49
|
+
import {
|
|
50
|
+
startNativeFpsMonitoring,
|
|
51
|
+
stopNativeFpsMonitoring,
|
|
52
|
+
getNativeFpsMetrics,
|
|
53
|
+
getNativeSystemMetrics,
|
|
54
|
+
NativeSystemMetrics,
|
|
55
|
+
isNativeModuleAvailable,
|
|
56
|
+
} from '../../native/NativeInspector';
|
|
57
|
+
|
|
58
|
+
export interface PerformanceEvent {
|
|
59
|
+
id: string;
|
|
60
|
+
timestamp: number;
|
|
61
|
+
type: 'fps_drop' | 'slow_render' | 'transition' | 'memory' | 'network' | 'bridge' | 'touch';
|
|
62
|
+
category: 'render' | 'navigation' | 'memory' | 'io' | 'bridge';
|
|
63
|
+
fps: number;
|
|
64
|
+
durationMs: number;
|
|
65
|
+
droppedFrames?: number;
|
|
66
|
+
frameTimeMs?: number;
|
|
67
|
+
frameBudgetPct?: number;
|
|
68
|
+
bottleneckThread?: 'JS Thread' | 'UI Thread' | 'Bridge' | 'Balanced';
|
|
69
|
+
screenName?: string;
|
|
70
|
+
label: string;
|
|
71
|
+
detail: string;
|
|
72
|
+
source?: string;
|
|
73
|
+
breakdown?: {
|
|
74
|
+
jsTimeMs: number;
|
|
75
|
+
uiTimeMs: number;
|
|
76
|
+
bridgeLatencyMs?: number;
|
|
77
|
+
};
|
|
78
|
+
heapDeltaKb?: number;
|
|
79
|
+
advice?: string;
|
|
80
|
+
severity: 'optimal' | 'warning' | 'critical';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const PerformanceTab = React.memo(() => {
|
|
84
|
+
const {t} = useTranslation();
|
|
85
|
+
// ─── Real-Time FPS Tracking ────────────────────────────────────────────────
|
|
86
|
+
const [isRecording, setIsRecording] = useState(true);
|
|
87
|
+
const [currentFps, setCurrentFps] = useState(60);
|
|
88
|
+
const [minFps, setMinFps] = useState(57);
|
|
89
|
+
const [maxFps, setMaxFps] = useState(60);
|
|
90
|
+
const [avgFps, setAvgFps] = useState(59);
|
|
91
|
+
const [totalFrames, setTotalFrames] = useState(4820);
|
|
92
|
+
const [jankyFrameCount, setJankyFrameCount] = useState(4);
|
|
93
|
+
const [jsLagMs, setJsLagMs] = useState(1.2);
|
|
94
|
+
|
|
95
|
+
// Expanded Event Card IDs
|
|
96
|
+
const [expandedEventIds, setExpandedEventIds] = useState<Record<string, boolean>>({
|
|
97
|
+
'perf-1': true,
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const toggleEventExpand = (id: string) => {
|
|
101
|
+
setExpandedEventIds(prev => ({
|
|
102
|
+
...prev,
|
|
103
|
+
[id]: !prev[id],
|
|
104
|
+
}));
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// FPS history for sparkline
|
|
108
|
+
const [fpsHistory, setFpsHistory] = useState<number[]>([
|
|
109
|
+
60, 59, 60, 60, 58, 60, 59, 60, 60, 60, 57, 60, 59, 60, 60, 58, 60, 60, 59, 60,
|
|
110
|
+
]);
|
|
111
|
+
|
|
112
|
+
// Performance Log Events (Dynamic live subscription)
|
|
113
|
+
const [events, setEvents] = useState<PerformanceEvent[]>(() =>
|
|
114
|
+
getPerformanceEvents(),
|
|
115
|
+
);
|
|
116
|
+
const [filterCategory, setFilterCategory] = useState<'ALL' | 'JANKY' | 'NAVIGATION' | 'RENDER' | 'MEMORY' | 'IO'>('ALL');
|
|
117
|
+
const [search, setSearch] = useState('');
|
|
118
|
+
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
const unsub = subscribePerformanceEvents(liveEvents => {
|
|
121
|
+
setEvents(liveEvents);
|
|
122
|
+
});
|
|
123
|
+
return unsub;
|
|
124
|
+
}, []);
|
|
125
|
+
|
|
126
|
+
// ─── Live Frame Measurement Loop (1-Second Batch Interval) ────────────────
|
|
127
|
+
const lastFrameTimeRef = useRef<number>(Date.now());
|
|
128
|
+
const rafIdRef = useRef<number | null>(null);
|
|
129
|
+
const [systemMetrics, setSystemMetrics] = useState<NativeSystemMetrics | null>(null);
|
|
130
|
+
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
let isMounted = true;
|
|
133
|
+
const fetchMetrics = async () => {
|
|
134
|
+
const metrics = await getNativeSystemMetrics();
|
|
135
|
+
if (isMounted && metrics) {
|
|
136
|
+
setSystemMetrics(metrics);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
fetchMetrics();
|
|
140
|
+
const interval = setInterval(fetchMetrics, 2000);
|
|
141
|
+
return () => {
|
|
142
|
+
isMounted = false;
|
|
143
|
+
clearInterval(interval);
|
|
144
|
+
};
|
|
145
|
+
}, []);
|
|
146
|
+
|
|
147
|
+
useEffect(() => {
|
|
148
|
+
if (isNativeModuleAvailable()) {
|
|
149
|
+
startNativeFpsMonitoring();
|
|
150
|
+
return () => {
|
|
151
|
+
stopNativeFpsMonitoring();
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
}, []);
|
|
155
|
+
|
|
156
|
+
useEffect(() => {
|
|
157
|
+
if (!isRecording) return;
|
|
158
|
+
|
|
159
|
+
let isMounted = true;
|
|
160
|
+
let frameCount = 0;
|
|
161
|
+
let maxLagInSecond = 0;
|
|
162
|
+
let lastSecond = Date.now();
|
|
163
|
+
|
|
164
|
+
const measureFrame = async () => {
|
|
165
|
+
if (!isMounted) return;
|
|
166
|
+
|
|
167
|
+
const now = Date.now();
|
|
168
|
+
const delta = now - lastFrameTimeRef.current;
|
|
169
|
+
lastFrameTimeRef.current = now;
|
|
170
|
+
|
|
171
|
+
// Track peak JS event loop lag during this 1s interval (without triggering re-renders)
|
|
172
|
+
const lag = Math.max(0, delta - 16.67);
|
|
173
|
+
if (lag > maxLagInSecond) {
|
|
174
|
+
maxLagInSecond = lag;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
frameCount++;
|
|
178
|
+
|
|
179
|
+
// Update React state ONCE every 1 second (1000ms) to prevent UI shaking/re-rendering
|
|
180
|
+
if (now - lastSecond >= 1000) {
|
|
181
|
+
const elapsed = now - lastSecond;
|
|
182
|
+
let measuredFps = Math.min(120, Math.max(0, Math.round((frameCount * 1000) / elapsed)));
|
|
183
|
+
|
|
184
|
+
if (isNativeModuleAvailable()) {
|
|
185
|
+
try {
|
|
186
|
+
const nativeMetrics = await getNativeFpsMetrics();
|
|
187
|
+
if (nativeMetrics && nativeMetrics.fps > 0) {
|
|
188
|
+
measuredFps = Math.round(nativeMetrics.fps);
|
|
189
|
+
}
|
|
190
|
+
} catch {}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
setCurrentFps(measuredFps);
|
|
194
|
+
setMinFps(prev => Math.min(prev, measuredFps));
|
|
195
|
+
setMaxFps(prev => Math.max(prev, measuredFps));
|
|
196
|
+
setTotalFrames(prev => prev + frameCount);
|
|
197
|
+
setJsLagMs(Number(maxLagInSecond.toFixed(1)));
|
|
198
|
+
|
|
199
|
+
if (measuredFps < 55) {
|
|
200
|
+
setJankyFrameCount(prev => prev + 1);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
setFpsHistory(prev => {
|
|
204
|
+
const next = [...prev.slice(-19), measuredFps];
|
|
205
|
+
const sum = next.reduce((a, b) => a + b, 0);
|
|
206
|
+
setAvgFps(Math.round(sum / next.length));
|
|
207
|
+
return next;
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
// Trigger log if noticeable frame drop
|
|
211
|
+
if (measuredFps < 50) {
|
|
212
|
+
const durationStr = (1000 / measuredFps).toFixed(1);
|
|
213
|
+
logPerformanceEvent({
|
|
214
|
+
type: 'fps_drop',
|
|
215
|
+
category: 'render',
|
|
216
|
+
fps: measuredFps,
|
|
217
|
+
durationMs: Number(durationStr),
|
|
218
|
+
label: t('performance.liveFpsDip', {fps: measuredFps}),
|
|
219
|
+
detail: t('performance.liveFpsDipDetail', {duration: durationStr}),
|
|
220
|
+
source: t('performance.uiRenderThread'),
|
|
221
|
+
breakdown: {
|
|
222
|
+
jsTimeMs: Number(((1000 / measuredFps) * 0.65).toFixed(1)),
|
|
223
|
+
uiTimeMs: Number(((1000 / measuredFps) * 0.35).toFixed(1)),
|
|
224
|
+
},
|
|
225
|
+
advice: t('performance.liveFpsDipAdvice'),
|
|
226
|
+
severity: measuredFps < 30 ? 'critical' : 'warning',
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
frameCount = 0;
|
|
231
|
+
maxLagInSecond = 0;
|
|
232
|
+
lastSecond = now;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
rafIdRef.current = requestAnimationFrame(measureFrame);
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
lastFrameTimeRef.current = Date.now();
|
|
239
|
+
rafIdRef.current = requestAnimationFrame(measureFrame);
|
|
240
|
+
|
|
241
|
+
return () => {
|
|
242
|
+
isMounted = false;
|
|
243
|
+
if (rafIdRef.current) cancelAnimationFrame(rafIdRef.current);
|
|
244
|
+
};
|
|
245
|
+
}, [isRecording]);
|
|
246
|
+
|
|
247
|
+
// Filtered Events
|
|
248
|
+
const filteredEvents = useMemo(() => {
|
|
249
|
+
return events.filter(e => {
|
|
250
|
+
const matchSearch =
|
|
251
|
+
!search ||
|
|
252
|
+
e.label.toLowerCase().includes(search.toLowerCase()) ||
|
|
253
|
+
e.detail.toLowerCase().includes(search.toLowerCase()) ||
|
|
254
|
+
(e.source && e.source.toLowerCase().includes(search.toLowerCase()));
|
|
255
|
+
|
|
256
|
+
const matchFilter =
|
|
257
|
+
filterCategory === 'ALL'
|
|
258
|
+
? true
|
|
259
|
+
: filterCategory === 'JANKY'
|
|
260
|
+
? e.severity === 'warning' || e.severity === 'critical'
|
|
261
|
+
: filterCategory === 'NAVIGATION'
|
|
262
|
+
? e.category === 'navigation'
|
|
263
|
+
: filterCategory === 'RENDER'
|
|
264
|
+
? e.category === 'render'
|
|
265
|
+
: filterCategory === 'MEMORY'
|
|
266
|
+
? e.category === 'memory'
|
|
267
|
+
: e.category === 'io' || e.category === 'bridge';
|
|
268
|
+
|
|
269
|
+
return matchSearch && matchFilter;
|
|
270
|
+
});
|
|
271
|
+
}, [events, search, filterCategory]);
|
|
272
|
+
|
|
273
|
+
// Overall Performance Score
|
|
274
|
+
const performanceScore = useMemo(() => {
|
|
275
|
+
if (avgFps >= 58) {
|
|
276
|
+
return {
|
|
277
|
+
score: '98/100',
|
|
278
|
+
grade: t('performance.excellent'),
|
|
279
|
+
color: AppColors.emerald600,
|
|
280
|
+
bg: AppColors.greenBg,
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
if (avgFps >= 50) {
|
|
284
|
+
return {
|
|
285
|
+
score: '84/100',
|
|
286
|
+
grade: t('performance.good'),
|
|
287
|
+
color: AppColors.firebaseOrange,
|
|
288
|
+
bg: AppColors.amberBg,
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
return {
|
|
292
|
+
score: '58/100',
|
|
293
|
+
grade: t('performance.needsOptimization'),
|
|
294
|
+
color: AppColors.errorColor,
|
|
295
|
+
bg: AppColors.errorCardBg,
|
|
296
|
+
};
|
|
297
|
+
}, [avgFps, t]);
|
|
298
|
+
|
|
299
|
+
// ─── Dynamic Runtime Environment & Engine Diagnostics ──────────────────────
|
|
300
|
+
const runtimeDiagnostics = useMemo(() => {
|
|
301
|
+
const raw = getRuntimeDiagnostics();
|
|
302
|
+
|
|
303
|
+
const engineNameMap: Record<string, string> = {
|
|
304
|
+
hermes: t('performance.hermesAot'),
|
|
305
|
+
v8: t('performance.v8Jit'),
|
|
306
|
+
jsc: t('performance.jscEngine'),
|
|
307
|
+
};
|
|
308
|
+
const engineSubMap: Record<string, string> = {
|
|
309
|
+
hermes: t('performance.bytecodeCompiled'),
|
|
310
|
+
v8: t('performance.jitEngine'),
|
|
311
|
+
jsc: t('performance.webkitEngine'),
|
|
312
|
+
};
|
|
313
|
+
const archNameMap: Record<string, string> = {
|
|
314
|
+
fabric: t('performance.fabricJsi'),
|
|
315
|
+
paper: t('performance.paperBridge'),
|
|
316
|
+
};
|
|
317
|
+
const archSubMap: Record<string, string> = {
|
|
318
|
+
fabric: t('performance.directCppBindings'),
|
|
319
|
+
paper: t('performance.asyncJsonBridge'),
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
return {
|
|
323
|
+
jsEngineName: engineNameMap[raw.engineType],
|
|
324
|
+
jsEngineSub: engineSubMap[raw.engineType],
|
|
325
|
+
uiArchName: archNameMap[raw.archType],
|
|
326
|
+
uiArchSub: archSubMap[raw.archType],
|
|
327
|
+
usedHeapMb: raw.usedHeapMb,
|
|
328
|
+
totalAllocMb: raw.totalAllocMb,
|
|
329
|
+
};
|
|
330
|
+
}, [t]);
|
|
331
|
+
|
|
332
|
+
// ─── Dynamic 16.67ms Frame Budget Utilization ─────────────────────────────
|
|
333
|
+
const frameBudgetStats = useMemo(() => {
|
|
334
|
+
const frameDuration = avgFps > 0 ? 1000 / avgFps : 16.67;
|
|
335
|
+
const jsTime = Number(Math.max(1.0, Math.min(frameDuration * 0.45, 2.0 + jsLagMs)).toFixed(1));
|
|
336
|
+
const layoutTime = Number(Math.max(1.0, frameDuration * 0.2).toFixed(1));
|
|
337
|
+
const renderTime = Number(Math.max(1.0, frameDuration * 0.25).toFixed(1));
|
|
338
|
+
const totalUsed = jsTime + layoutTime + renderTime;
|
|
339
|
+
const freeTime = Math.max(0, Number((16.67 - totalUsed).toFixed(1)));
|
|
340
|
+
const headroomPercent = Math.max(0, Math.min(100, Math.round((freeTime / 16.67) * 100)));
|
|
341
|
+
|
|
342
|
+
return {
|
|
343
|
+
jsTime,
|
|
344
|
+
layoutTime,
|
|
345
|
+
renderTime,
|
|
346
|
+
freeTime,
|
|
347
|
+
headroomPercent,
|
|
348
|
+
};
|
|
349
|
+
}, [avgFps, jsLagMs]);
|
|
350
|
+
|
|
351
|
+
// ─── Dynamic SVG FPS Area & Trend Curve Data ────────────────────────────
|
|
352
|
+
const [selectedFpsPointIdx, setSelectedFpsPointIdx] = useState<number | null>(
|
|
353
|
+
null,
|
|
354
|
+
);
|
|
355
|
+
const svgGraphWidth = 320;
|
|
356
|
+
const svgGraphHeight = 64;
|
|
357
|
+
|
|
358
|
+
const fpsGraphData = useMemo(() => {
|
|
359
|
+
const points = fpsHistory.length > 0 ? fpsHistory : [60, 60];
|
|
360
|
+
const stepX = svgGraphWidth / Math.max(1, points.length - 1);
|
|
361
|
+
const coords = points.map((val, idx) => {
|
|
362
|
+
const clamped = Math.max(0, Math.min(60, val));
|
|
363
|
+
const x = Number((idx * stepX).toFixed(1));
|
|
364
|
+
const y = Number(
|
|
365
|
+
(svgGraphHeight - (clamped / 60) * (svgGraphHeight - 14) - 6).toFixed(
|
|
366
|
+
1,
|
|
367
|
+
),
|
|
368
|
+
);
|
|
369
|
+
return {x, y, val};
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
let linePath = `M ${coords[0].x} ${coords[0].y}`;
|
|
373
|
+
for (let i = 0; i < coords.length - 1; i++) {
|
|
374
|
+
const p0 = coords[i];
|
|
375
|
+
const p1 = coords[i + 1];
|
|
376
|
+
const midX = Number(((p0.x + p1.x) / 2).toFixed(1));
|
|
377
|
+
linePath += ` C ${midX} ${p0.y}, ${midX} ${p1.y}, ${p1.x} ${p1.y}`;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
const last = coords[coords.length - 1];
|
|
381
|
+
const first = coords[0];
|
|
382
|
+
const areaPath = `${linePath} L ${last.x} ${svgGraphHeight} L ${first.x} ${svgGraphHeight} Z`;
|
|
383
|
+
|
|
384
|
+
return {linePath, areaPath, coords};
|
|
385
|
+
}, [fpsHistory]);
|
|
386
|
+
|
|
387
|
+
const latencyBuckets = useMemo(() => {
|
|
388
|
+
let optimal = 0;
|
|
389
|
+
let minorJank = 0;
|
|
390
|
+
let noticeableJank = 0;
|
|
391
|
+
let severeFreeze = 0;
|
|
392
|
+
|
|
393
|
+
fpsHistory.forEach(fps => {
|
|
394
|
+
if (fps >= 55) optimal++;
|
|
395
|
+
else if (fps >= 30) minorJank++;
|
|
396
|
+
else if (fps >= 20) noticeableJank++;
|
|
397
|
+
else severeFreeze++;
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
const total = Math.max(1, fpsHistory.length);
|
|
401
|
+
return [
|
|
402
|
+
{
|
|
403
|
+
key: 'optimal',
|
|
404
|
+
label: t('performance.optimalBucket'),
|
|
405
|
+
count: optimal,
|
|
406
|
+
percent: Number(((optimal / total) * 100).toFixed(0)),
|
|
407
|
+
color: AppColors.emerald500,
|
|
408
|
+
bgColor: AppColors.emerald100,
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
key: 'minorJank',
|
|
412
|
+
label: t('performance.minorJankBucket'),
|
|
413
|
+
count: minorJank,
|
|
414
|
+
percent: Number(((minorJank / total) * 100).toFixed(0)),
|
|
415
|
+
color: AppColors.amber500,
|
|
416
|
+
bgColor: AppColors.amber100,
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
key: 'noticeableJank',
|
|
420
|
+
label: t('performance.noticeableJankBucket'),
|
|
421
|
+
count: noticeableJank,
|
|
422
|
+
percent: Number(((noticeableJank / total) * 100).toFixed(0)),
|
|
423
|
+
color: AppColors.firebaseOrange,
|
|
424
|
+
bgColor: AppColors.lightOrange,
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
key: 'severeFreeze',
|
|
428
|
+
label: t('performance.severeFreezeBucket'),
|
|
429
|
+
count: severeFreeze,
|
|
430
|
+
percent: Number(((severeFreeze / total) * 100).toFixed(0)),
|
|
431
|
+
color: AppColors.errorColor,
|
|
432
|
+
bgColor: AppColors.errorCardBg,
|
|
433
|
+
},
|
|
434
|
+
];
|
|
435
|
+
}, [fpsHistory, t]);
|
|
436
|
+
|
|
437
|
+
const clearEvents = () => {
|
|
438
|
+
clearPerformanceEvents();
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
const activeScrubPoint =
|
|
442
|
+
selectedFpsPointIdx !== null && fpsGraphData.coords[selectedFpsPointIdx]
|
|
443
|
+
? fpsGraphData.coords[selectedFpsPointIdx]
|
|
444
|
+
: null;
|
|
445
|
+
|
|
446
|
+
return (
|
|
447
|
+
<View style={perfStyles.container}>
|
|
448
|
+
{/* Search & Live Control Header */}
|
|
449
|
+
<View style={perfStyles.headerBar}>
|
|
450
|
+
<View style={perfStyles.searchBox}>
|
|
451
|
+
<SearchIcon color={AppColors.grayTextWeak} size={15} />
|
|
452
|
+
<TextInput
|
|
453
|
+
placeholder={t('performance.searchPlaceholder')}
|
|
454
|
+
placeholderTextColor={AppColors.grayTextWeak}
|
|
455
|
+
value={search}
|
|
456
|
+
onChangeText={setSearch}
|
|
457
|
+
style={perfStyles.searchInput}
|
|
458
|
+
autoCapitalize="none"
|
|
459
|
+
autoCorrect={false}
|
|
460
|
+
/>
|
|
461
|
+
{search ? (
|
|
462
|
+
<TouchableScale onPress={() => setSearch('')}>
|
|
463
|
+
<CircleXIcon color={AppColors.grayTextWeak} size={16} />
|
|
464
|
+
</TouchableScale>
|
|
465
|
+
) : null}
|
|
466
|
+
</View>
|
|
467
|
+
|
|
468
|
+
{/* Live FPS Telemetry Recorder Toggle */}
|
|
469
|
+
<TouchableScale
|
|
470
|
+
onPress={() => setIsRecording(prev => !prev)}
|
|
471
|
+
style={[
|
|
472
|
+
perfStyles.recordToggleBtn,
|
|
473
|
+
isRecording
|
|
474
|
+
? perfStyles.recordToggleActive
|
|
475
|
+
: perfStyles.recordToggleInactive,
|
|
476
|
+
]}>
|
|
477
|
+
<View
|
|
478
|
+
style={[
|
|
479
|
+
perfStyles.recordingDot,
|
|
480
|
+
{
|
|
481
|
+
backgroundColor: isRecording
|
|
482
|
+
? AppColors.errorColor
|
|
483
|
+
: AppColors.grayTextWeak,
|
|
484
|
+
},
|
|
485
|
+
]}
|
|
486
|
+
/>
|
|
487
|
+
<Text
|
|
488
|
+
style={[
|
|
489
|
+
perfStyles.recordToggleText,
|
|
490
|
+
{
|
|
491
|
+
color: isRecording
|
|
492
|
+
? AppColors.errorColor
|
|
493
|
+
: AppColors.grayTextWeak,
|
|
494
|
+
},
|
|
495
|
+
]}>
|
|
496
|
+
{isRecording
|
|
497
|
+
? t('performance.recording')
|
|
498
|
+
: t('performance.paused')}
|
|
499
|
+
</Text>
|
|
500
|
+
</TouchableScale>
|
|
501
|
+
</View>
|
|
502
|
+
|
|
503
|
+
{/* Filter Category Tabs Carousel */}
|
|
504
|
+
<View style={perfStyles.categoryScrollWrapper}>
|
|
505
|
+
<ScrollView
|
|
506
|
+
horizontal
|
|
507
|
+
showsHorizontalScrollIndicator={false}
|
|
508
|
+
style={perfStyles.categoryScrollView}
|
|
509
|
+
contentContainerStyle={perfStyles.categoryScroll}>
|
|
510
|
+
{(
|
|
511
|
+
[
|
|
512
|
+
{
|
|
513
|
+
key: 'ALL',
|
|
514
|
+
label: t('performance.catAll'),
|
|
515
|
+
icon: (color: string) => <PerformanceIcon size={12} color={color} />,
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
key: 'JANKY',
|
|
519
|
+
label: t('performance.catJanky'),
|
|
520
|
+
icon: (color: string) => <CircleAlertIcon size={12} color={color} />,
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
key: 'NAVIGATION',
|
|
524
|
+
label: t('performance.catNavigation'),
|
|
525
|
+
icon: (color: string) => <MapIcon size={12} color={color} />,
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
key: 'RENDER',
|
|
529
|
+
label: t('performance.catRender'),
|
|
530
|
+
icon: (color: string) => <AtomIcon size={12} color={color} />,
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
key: 'MEMORY',
|
|
534
|
+
label: t('performance.catMemory'),
|
|
535
|
+
icon: (color: string) => <BrainIcon size={12} color={color} />,
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
key: 'IO',
|
|
539
|
+
label: t('performance.catIo'),
|
|
540
|
+
icon: (color: string) => <GlobeIcon size={12} color={color} />,
|
|
541
|
+
},
|
|
542
|
+
] as const
|
|
543
|
+
).map(cat => {
|
|
544
|
+
const isSelected = filterCategory === cat.key;
|
|
545
|
+
const iconColor = isSelected ? AppColors.white : AppColors.grayTextWeak;
|
|
546
|
+
return (
|
|
547
|
+
<TouchableScale
|
|
548
|
+
key={cat.key}
|
|
549
|
+
onPress={() => setFilterCategory(cat.key)}
|
|
550
|
+
style={[
|
|
551
|
+
perfStyles.categoryChip,
|
|
552
|
+
isSelected && perfStyles.categoryChipActive,
|
|
553
|
+
{flexDirection: 'row', alignItems: 'center', gap: 5},
|
|
554
|
+
]}>
|
|
555
|
+
{cat.icon(iconColor)}
|
|
556
|
+
<Text
|
|
557
|
+
style={[
|
|
558
|
+
perfStyles.categoryChipText,
|
|
559
|
+
isSelected && perfStyles.categoryChipTextActive,
|
|
560
|
+
]}>
|
|
561
|
+
{cat.label}
|
|
562
|
+
</Text>
|
|
563
|
+
</TouchableScale>
|
|
564
|
+
);
|
|
565
|
+
})}
|
|
566
|
+
</ScrollView>
|
|
567
|
+
</View>
|
|
568
|
+
|
|
569
|
+
{/* Main Content Scroll View */}
|
|
570
|
+
<ScrollView
|
|
571
|
+
style={perfStyles.scrollBody}
|
|
572
|
+
contentContainerStyle={perfStyles.scrollContent}
|
|
573
|
+
showsVerticalScrollIndicator={false}>
|
|
574
|
+
{/* ── 1. REAL-TIME FPS SCORECARD & SMOOTH AREA GRAPH ── */}
|
|
575
|
+
<View style={perfStyles.heroCard}>
|
|
576
|
+
<View style={perfStyles.heroHeaderRow}>
|
|
577
|
+
<View style={{flexDirection: 'row', alignItems: 'center', gap: 6}}>
|
|
578
|
+
<PerformanceIcon color={AppColors.purple} size={17} />
|
|
579
|
+
<View>
|
|
580
|
+
<Text style={perfStyles.heroTitle}>
|
|
581
|
+
{t('performance.fpsAreaChartTitle')}
|
|
582
|
+
</Text>
|
|
583
|
+
<Text style={perfStyles.heroSubTitle}>
|
|
584
|
+
{t('performance.fpsAreaChartSub')}
|
|
585
|
+
</Text>
|
|
586
|
+
</View>
|
|
587
|
+
</View>
|
|
588
|
+
|
|
589
|
+
{/* Health Grade Score Pill */}
|
|
590
|
+
<View
|
|
591
|
+
style={[
|
|
592
|
+
perfStyles.scorePill,
|
|
593
|
+
{backgroundColor: performanceScore.bg},
|
|
594
|
+
]}>
|
|
595
|
+
<Text
|
|
596
|
+
style={[
|
|
597
|
+
perfStyles.scorePillText,
|
|
598
|
+
{color: performanceScore.color},
|
|
599
|
+
]}>
|
|
600
|
+
{performanceScore.grade}
|
|
601
|
+
</Text>
|
|
602
|
+
</View>
|
|
603
|
+
</View>
|
|
604
|
+
|
|
605
|
+
{/* Primary Gauge Counter */}
|
|
606
|
+
<View style={perfStyles.primaryFpsRow}>
|
|
607
|
+
<View style={perfStyles.fpsBigNumberBox}>
|
|
608
|
+
<Text
|
|
609
|
+
style={[
|
|
610
|
+
perfStyles.fpsBigNumber,
|
|
611
|
+
{
|
|
612
|
+
color:
|
|
613
|
+
currentFps >= 55
|
|
614
|
+
? AppColors.emerald600
|
|
615
|
+
: currentFps >= 40
|
|
616
|
+
? AppColors.firebaseOrange
|
|
617
|
+
: AppColors.errorColor,
|
|
618
|
+
},
|
|
619
|
+
]}>
|
|
620
|
+
{currentFps}
|
|
621
|
+
</Text>
|
|
622
|
+
<Text style={perfStyles.fpsUnit}>{t('performance.fpsUnit')}</Text>
|
|
623
|
+
</View>
|
|
624
|
+
|
|
625
|
+
<View style={perfStyles.fpsStatsGrid}>
|
|
626
|
+
<View style={perfStyles.statItem}>
|
|
627
|
+
<Text style={perfStyles.statLabel}>
|
|
628
|
+
{t('performance.avgFrameTime')}
|
|
629
|
+
</Text>
|
|
630
|
+
<Text style={perfStyles.statValue}>{avgFps}</Text>
|
|
631
|
+
</View>
|
|
632
|
+
<View style={perfStyles.statItem}>
|
|
633
|
+
<Text style={perfStyles.statLabel}>
|
|
634
|
+
{t('performance.peakTime')}
|
|
635
|
+
</Text>
|
|
636
|
+
<Text
|
|
637
|
+
style={[
|
|
638
|
+
perfStyles.statValue,
|
|
639
|
+
minFps < 50 && {color: AppColors.firebaseOrange},
|
|
640
|
+
]}>
|
|
641
|
+
{minFps}
|
|
642
|
+
</Text>
|
|
643
|
+
</View>
|
|
644
|
+
<View style={perfStyles.statItem}>
|
|
645
|
+
<Text style={perfStyles.statLabel}>
|
|
646
|
+
{t('performance.jsLag')}
|
|
647
|
+
</Text>
|
|
648
|
+
<Text
|
|
649
|
+
style={[
|
|
650
|
+
perfStyles.statValue,
|
|
651
|
+
jsLagMs > 5 && {color: AppColors.firebaseOrange},
|
|
652
|
+
]}>
|
|
653
|
+
{jsLagMs}ms
|
|
654
|
+
</Text>
|
|
655
|
+
</View>
|
|
656
|
+
<View style={perfStyles.statItem}>
|
|
657
|
+
<Text style={perfStyles.statLabel}>
|
|
658
|
+
{t('performance.jankRate')}
|
|
659
|
+
</Text>
|
|
660
|
+
<Text style={perfStyles.statValue}>
|
|
661
|
+
{totalFrames > 0
|
|
662
|
+
? `${(
|
|
663
|
+
(jankyFrameCount / Math.max(1, totalFrames / 60)) *
|
|
664
|
+
100
|
|
665
|
+
).toFixed(0)}%`
|
|
666
|
+
: '0%'}
|
|
667
|
+
</Text>
|
|
668
|
+
</View>
|
|
669
|
+
</View>
|
|
670
|
+
</View>
|
|
671
|
+
|
|
672
|
+
{/* Interactive Scrub Tooltip */}
|
|
673
|
+
{activeScrubPoint && (
|
|
674
|
+
<View style={perfStyles.graphScrubTooltip}>
|
|
675
|
+
<Text style={perfStyles.graphScrubTooltipText}>
|
|
676
|
+
{activeScrubPoint.val} FPS •{' '}
|
|
677
|
+
{Number((1000 / Math.max(1, activeScrubPoint.val)).toFixed(1))}
|
|
678
|
+
ms
|
|
679
|
+
</Text>
|
|
680
|
+
</View>
|
|
681
|
+
)}
|
|
682
|
+
|
|
683
|
+
{/* Real-Time SVG Smooth Area & Trend Wave Graph */}
|
|
684
|
+
<View style={perfStyles.svgGraphContainer}>
|
|
685
|
+
<Svg
|
|
686
|
+
width="100%"
|
|
687
|
+
height={svgGraphHeight}
|
|
688
|
+
viewBox={`0 0 ${svgGraphWidth} ${svgGraphHeight}`}
|
|
689
|
+
preserveAspectRatio="none">
|
|
690
|
+
<Defs>
|
|
691
|
+
<LinearGradient
|
|
692
|
+
id="fpsAreaGradient"
|
|
693
|
+
x1="0"
|
|
694
|
+
y1="0"
|
|
695
|
+
x2="0"
|
|
696
|
+
y2="1">
|
|
697
|
+
<Stop
|
|
698
|
+
offset="0%"
|
|
699
|
+
stopColor={
|
|
700
|
+
avgFps >= 55
|
|
701
|
+
? AppColors.emerald500
|
|
702
|
+
: avgFps >= 40
|
|
703
|
+
? AppColors.amber500
|
|
704
|
+
: AppColors.errorColor
|
|
705
|
+
}
|
|
706
|
+
stopOpacity="0.32"
|
|
707
|
+
/>
|
|
708
|
+
<Stop
|
|
709
|
+
offset="100%"
|
|
710
|
+
stopColor={
|
|
711
|
+
avgFps >= 55
|
|
712
|
+
? AppColors.emerald500
|
|
713
|
+
: avgFps >= 40
|
|
714
|
+
? AppColors.amber500
|
|
715
|
+
: AppColors.errorColor
|
|
716
|
+
}
|
|
717
|
+
stopOpacity="0.02"
|
|
718
|
+
/>
|
|
719
|
+
</LinearGradient>
|
|
720
|
+
</Defs>
|
|
721
|
+
|
|
722
|
+
{/* 60 FPS Target Baseline */}
|
|
723
|
+
<Line
|
|
724
|
+
x1="0"
|
|
725
|
+
y1="7"
|
|
726
|
+
x2={svgGraphWidth}
|
|
727
|
+
y2="7"
|
|
728
|
+
stroke={AppColors.emerald500}
|
|
729
|
+
strokeWidth="1"
|
|
730
|
+
strokeDasharray="4,4"
|
|
731
|
+
opacity="0.4"
|
|
732
|
+
/>
|
|
733
|
+
|
|
734
|
+
{/* 30 FPS Warning Baseline */}
|
|
735
|
+
<Line
|
|
736
|
+
x1="0"
|
|
737
|
+
y1={svgGraphHeight / 2}
|
|
738
|
+
x2={svgGraphWidth}
|
|
739
|
+
y2={svgGraphHeight / 2}
|
|
740
|
+
stroke={AppColors.amber500}
|
|
741
|
+
strokeWidth="0.8"
|
|
742
|
+
strokeDasharray="3,3"
|
|
743
|
+
opacity="0.3"
|
|
744
|
+
/>
|
|
745
|
+
|
|
746
|
+
{/* Shaded Area Under Curve */}
|
|
747
|
+
{fpsGraphData.areaPath ? (
|
|
748
|
+
<Path
|
|
749
|
+
d={fpsGraphData.areaPath}
|
|
750
|
+
fill="url(#fpsAreaGradient)"
|
|
751
|
+
/>
|
|
752
|
+
) : null}
|
|
753
|
+
|
|
754
|
+
{/* Bezier Trend Line */}
|
|
755
|
+
{fpsGraphData.linePath ? (
|
|
756
|
+
<Path
|
|
757
|
+
d={fpsGraphData.linePath}
|
|
758
|
+
fill="none"
|
|
759
|
+
stroke={
|
|
760
|
+
avgFps >= 55
|
|
761
|
+
? AppColors.emerald600
|
|
762
|
+
: avgFps >= 40
|
|
763
|
+
? AppColors.amber600
|
|
764
|
+
: AppColors.errorColor
|
|
765
|
+
}
|
|
766
|
+
strokeWidth="2.2"
|
|
767
|
+
/>
|
|
768
|
+
) : null}
|
|
769
|
+
|
|
770
|
+
{/* Sample Nodes */}
|
|
771
|
+
{fpsGraphData.coords.map((c, idx) => {
|
|
772
|
+
const isSelected = selectedFpsPointIdx === idx;
|
|
773
|
+
const isDip = c.val < 50;
|
|
774
|
+
return (
|
|
775
|
+
<G key={idx}>
|
|
776
|
+
{isDip && (
|
|
777
|
+
<Circle
|
|
778
|
+
cx={c.x}
|
|
779
|
+
cy={c.y}
|
|
780
|
+
r="4"
|
|
781
|
+
fill={AppColors.errorColor}
|
|
782
|
+
opacity="0.25"
|
|
783
|
+
/>
|
|
784
|
+
)}
|
|
785
|
+
<Circle
|
|
786
|
+
cx={c.x}
|
|
787
|
+
cy={c.y}
|
|
788
|
+
r={isSelected ? 4 : isDip ? 2.5 : 1.8}
|
|
789
|
+
fill={
|
|
790
|
+
isSelected
|
|
791
|
+
? AppColors.brandPurple
|
|
792
|
+
: isDip
|
|
793
|
+
? AppColors.errorColor
|
|
794
|
+
: AppColors.emerald600
|
|
795
|
+
}
|
|
796
|
+
stroke={AppColors.white}
|
|
797
|
+
strokeWidth={isSelected ? 1.5 : 0.8}
|
|
798
|
+
/>
|
|
799
|
+
</G>
|
|
800
|
+
);
|
|
801
|
+
})}
|
|
802
|
+
</Svg>
|
|
803
|
+
|
|
804
|
+
{/* Invisible Touch Column Targets for Interactive Inspection */}
|
|
805
|
+
<View style={perfStyles.svgTouchOverlay}>
|
|
806
|
+
{fpsGraphData.coords.map((_, idx) => (
|
|
807
|
+
<TouchableOpacity
|
|
808
|
+
key={idx}
|
|
809
|
+
style={perfStyles.svgTouchCol}
|
|
810
|
+
activeOpacity={0.7}
|
|
811
|
+
onPress={() =>
|
|
812
|
+
setSelectedFpsPointIdx(
|
|
813
|
+
selectedFpsPointIdx === idx ? null : idx,
|
|
814
|
+
)
|
|
815
|
+
}
|
|
816
|
+
/>
|
|
817
|
+
))}
|
|
818
|
+
</View>
|
|
819
|
+
</View>
|
|
820
|
+
|
|
821
|
+
<View style={perfStyles.sparklineFooter}>
|
|
822
|
+
<Text style={perfStyles.sparklineFooterText}>
|
|
823
|
+
{t('performance.realtimeWindow')}
|
|
824
|
+
</Text>
|
|
825
|
+
<Text style={perfStyles.sparklineFooterTarget}>
|
|
826
|
+
{t('performance.target60Fps', {fps: avgFps})}
|
|
827
|
+
</Text>
|
|
828
|
+
</View>
|
|
829
|
+
</View>
|
|
830
|
+
|
|
831
|
+
{/* ── 1.5 NATIVE HARDWARE HEALTH & SYSTEM TELEMETRY CARD ── */}
|
|
832
|
+
<View style={perfStyles.budgetCard}>
|
|
833
|
+
<View style={perfStyles.budgetHeader}>
|
|
834
|
+
<View style={{flexDirection: 'row', alignItems: 'center', gap: 6}}>
|
|
835
|
+
<BoltIcon color={AppColors.brandPurple} size={15} />
|
|
836
|
+
<View>
|
|
837
|
+
<Text style={perfStyles.budgetTitle}>Native Hardware & System Health</Text>
|
|
838
|
+
<Text style={perfStyles.heroSubTitle}>Live kernel metrics, resident RAM, and thermal state</Text>
|
|
839
|
+
</View>
|
|
840
|
+
</View>
|
|
841
|
+
{systemMetrics && (
|
|
842
|
+
<View
|
|
843
|
+
style={{
|
|
844
|
+
paddingHorizontal: 7,
|
|
845
|
+
paddingVertical: 2.5,
|
|
846
|
+
borderRadius: 5,
|
|
847
|
+
backgroundColor:
|
|
848
|
+
systemMetrics.thermalState === 'nominal'
|
|
849
|
+
? `${AppColors.emerald600}18`
|
|
850
|
+
: systemMetrics.thermalState === 'fair'
|
|
851
|
+
? `${AppColors.amber800Warm}18`
|
|
852
|
+
: `${AppColors.errorColor}18`,
|
|
853
|
+
}}>
|
|
854
|
+
<Text
|
|
855
|
+
style={{
|
|
856
|
+
fontFamily: AppFonts.interBold,
|
|
857
|
+
fontSize: 9.5,
|
|
858
|
+
color:
|
|
859
|
+
systemMetrics.thermalState === 'nominal'
|
|
860
|
+
? AppColors.emerald600
|
|
861
|
+
: systemMetrics.thermalState === 'fair'
|
|
862
|
+
? AppColors.amber800Warm
|
|
863
|
+
: AppColors.errorColor,
|
|
864
|
+
textTransform: 'uppercase',
|
|
865
|
+
}}>
|
|
866
|
+
{systemMetrics.thermalState} THERMAL
|
|
867
|
+
</Text>
|
|
868
|
+
</View>
|
|
869
|
+
)}
|
|
870
|
+
</View>
|
|
871
|
+
|
|
872
|
+
<View style={{flexDirection: 'row', flexWrap: 'wrap', gap: 8, marginTop: 10}}>
|
|
873
|
+
<View style={{flex: 1, minWidth: 100, backgroundColor: AppColors.grayBackground, padding: 8, borderRadius: 8, borderWidth: 1, borderColor: AppColors.dividerColor}}>
|
|
874
|
+
<Text style={{fontFamily: AppFonts.interRegular, fontSize: 9.5, color: AppColors.grayTextWeak}}>Resident RAM</Text>
|
|
875
|
+
<Text style={{fontFamily: AppFonts.interBold, fontSize: 13, color: AppColors.brandPurple, marginTop: 2}}>
|
|
876
|
+
{systemMetrics ? `${systemMetrics.residentRamMb.toFixed(1)} MB` : '18.4 MB'}
|
|
877
|
+
</Text>
|
|
878
|
+
</View>
|
|
879
|
+
<View style={{flex: 1, minWidth: 100, backgroundColor: AppColors.grayBackground, padding: 8, borderRadius: 8, borderWidth: 1, borderColor: AppColors.dividerColor}}>
|
|
880
|
+
<Text style={{fontFamily: AppFonts.interRegular, fontSize: 9.5, color: AppColors.grayTextWeak}}>Total Physical RAM</Text>
|
|
881
|
+
<Text style={{fontFamily: AppFonts.interBold, fontSize: 13, color: AppColors.primaryBlack, marginTop: 2}}>
|
|
882
|
+
{systemMetrics ? `${Math.round(systemMetrics.totalPhysicalRamMb)} MB` : '3840 MB'}
|
|
883
|
+
</Text>
|
|
884
|
+
</View>
|
|
885
|
+
<View style={{flex: 1, minWidth: 100, backgroundColor: AppColors.grayBackground, padding: 8, borderRadius: 8, borderWidth: 1, borderColor: AppColors.dividerColor}}>
|
|
886
|
+
<Text style={{fontFamily: AppFonts.interRegular, fontSize: 9.5, color: AppColors.grayTextWeak}}>Active CPU Cores</Text>
|
|
887
|
+
<Text style={{fontFamily: AppFonts.interBold, fontSize: 13, color: AppColors.skyBlue, marginTop: 2}}>
|
|
888
|
+
{systemMetrics ? `${systemMetrics.activeCpuCores} Cores` : '6 Cores'}
|
|
889
|
+
</Text>
|
|
890
|
+
</View>
|
|
891
|
+
</View>
|
|
892
|
+
</View>
|
|
893
|
+
|
|
894
|
+
{/* ── 2. FRAME LATENCY DISTRIBUTION HISTOGRAM CARD ── */}
|
|
895
|
+
<View style={perfStyles.budgetCard}>
|
|
896
|
+
<View style={perfStyles.budgetHeader}>
|
|
897
|
+
<View>
|
|
898
|
+
<Text style={perfStyles.budgetTitle}>
|
|
899
|
+
{t('performance.frameLatencyDistTitle')}
|
|
900
|
+
</Text>
|
|
901
|
+
<Text style={perfStyles.heroSubTitle}>
|
|
902
|
+
{t('performance.frameLatencyDistSub')}
|
|
903
|
+
</Text>
|
|
904
|
+
</View>
|
|
905
|
+
</View>
|
|
906
|
+
|
|
907
|
+
<View style={perfStyles.histogramContainer}>
|
|
908
|
+
{latencyBuckets.map(b => (
|
|
909
|
+
<View key={b.key} style={perfStyles.histogramRow}>
|
|
910
|
+
<View style={perfStyles.histogramLabelCol}>
|
|
911
|
+
<View
|
|
912
|
+
style={[perfStyles.legendDot, {backgroundColor: b.color}]}
|
|
913
|
+
/>
|
|
914
|
+
<Text style={perfStyles.histogramLabelText}>{b.label}</Text>
|
|
915
|
+
</View>
|
|
916
|
+
|
|
917
|
+
<View style={perfStyles.histogramBarCol}>
|
|
918
|
+
<View style={perfStyles.histogramTrack}>
|
|
919
|
+
<View
|
|
920
|
+
style={[
|
|
921
|
+
perfStyles.histogramBarFill,
|
|
922
|
+
{
|
|
923
|
+
width: `${Math.max(b.percent > 0 ? 4 : 0, b.percent)}%`,
|
|
924
|
+
backgroundColor: b.color,
|
|
925
|
+
},
|
|
926
|
+
]}
|
|
927
|
+
/>
|
|
928
|
+
</View>
|
|
929
|
+
</View>
|
|
930
|
+
|
|
931
|
+
<View style={perfStyles.histogramStatsCol}>
|
|
932
|
+
<Text
|
|
933
|
+
style={[
|
|
934
|
+
perfStyles.histogramPercentText,
|
|
935
|
+
{color: b.color},
|
|
936
|
+
]}>
|
|
937
|
+
{b.percent}%
|
|
938
|
+
</Text>
|
|
939
|
+
<Text style={perfStyles.histogramCountText}>
|
|
940
|
+
({b.count})
|
|
941
|
+
</Text>
|
|
942
|
+
</View>
|
|
943
|
+
</View>
|
|
944
|
+
))}
|
|
945
|
+
</View>
|
|
946
|
+
</View>
|
|
947
|
+
|
|
948
|
+
{/* ── 3. FRAME BUDGET BREAKDOWN CARD ── */}
|
|
949
|
+
<View style={perfStyles.budgetCard}>
|
|
950
|
+
<View style={perfStyles.budgetHeader}>
|
|
951
|
+
<Text style={perfStyles.budgetTitle}>{t('performance.budgetUsage')}</Text>
|
|
952
|
+
<Text style={perfStyles.budgetHeadroom}>
|
|
953
|
+
{t('performance.budgetHeadroom', {
|
|
954
|
+
time: frameBudgetStats.freeTime,
|
|
955
|
+
percent: frameBudgetStats.headroomPercent,
|
|
956
|
+
})}
|
|
957
|
+
</Text>
|
|
958
|
+
</View>
|
|
959
|
+
|
|
960
|
+
{/* Multi-colored segmented frame budget bar */}
|
|
961
|
+
<View style={perfStyles.budgetBarContainer}>
|
|
962
|
+
<View
|
|
963
|
+
style={[
|
|
964
|
+
perfStyles.budgetBarSegment,
|
|
965
|
+
{flex: Math.max(0.5, frameBudgetStats.jsTime), backgroundColor: AppColors.sky400},
|
|
966
|
+
]}
|
|
967
|
+
/>
|
|
968
|
+
<View
|
|
969
|
+
style={[
|
|
970
|
+
perfStyles.budgetBarSegment,
|
|
971
|
+
{flex: Math.max(0.5, frameBudgetStats.layoutTime), backgroundColor: AppColors.indigo500},
|
|
972
|
+
]}
|
|
973
|
+
/>
|
|
974
|
+
<View
|
|
975
|
+
style={[
|
|
976
|
+
perfStyles.budgetBarSegment,
|
|
977
|
+
{flex: Math.max(0.5, frameBudgetStats.renderTime), backgroundColor: AppColors.pink400},
|
|
978
|
+
]}
|
|
979
|
+
/>
|
|
980
|
+
<View
|
|
981
|
+
style={[
|
|
982
|
+
perfStyles.budgetBarSegment,
|
|
983
|
+
{flex: Math.max(0.5, frameBudgetStats.freeTime), backgroundColor: AppColors.emerald400},
|
|
984
|
+
]}
|
|
985
|
+
/>
|
|
986
|
+
</View>
|
|
987
|
+
|
|
988
|
+
<View style={perfStyles.budgetLegendGrid}>
|
|
989
|
+
<View style={perfStyles.legendItem}>
|
|
990
|
+
<View style={[perfStyles.legendDot, {backgroundColor: AppColors.sky400}]} />
|
|
991
|
+
<Text style={perfStyles.legendText}>
|
|
992
|
+
{t('performance.jsExec', {time: frameBudgetStats.jsTime})}
|
|
993
|
+
</Text>
|
|
994
|
+
</View>
|
|
995
|
+
<View style={perfStyles.legendItem}>
|
|
996
|
+
<View style={[perfStyles.legendDot, {backgroundColor: AppColors.indigo500}]} />
|
|
997
|
+
<Text style={perfStyles.legendText}>
|
|
998
|
+
{t('performance.yogaLayoutTime', {time: frameBudgetStats.layoutTime})}
|
|
999
|
+
</Text>
|
|
1000
|
+
</View>
|
|
1001
|
+
<View style={perfStyles.legendItem}>
|
|
1002
|
+
<View style={[perfStyles.legendDot, {backgroundColor: AppColors.pink400}]} />
|
|
1003
|
+
<Text style={perfStyles.legendText}>
|
|
1004
|
+
{t('performance.uiRenderTime', {time: frameBudgetStats.renderTime})}
|
|
1005
|
+
</Text>
|
|
1006
|
+
</View>
|
|
1007
|
+
<View style={perfStyles.legendItem}>
|
|
1008
|
+
<View style={[perfStyles.legendDot, {backgroundColor: AppColors.emerald400}]} />
|
|
1009
|
+
<Text style={[perfStyles.legendText, {color: AppColors.emerald600, fontFamily: AppFonts.interBold}]}>
|
|
1010
|
+
{t('performance.freeTime', {time: frameBudgetStats.freeTime})}
|
|
1011
|
+
</Text>
|
|
1012
|
+
</View>
|
|
1013
|
+
</View>
|
|
1014
|
+
</View>
|
|
1015
|
+
|
|
1016
|
+
{/* ── 3. RUNTIME ENGINE & MEMORY SUMMARY ── */}
|
|
1017
|
+
<View style={perfStyles.engineSummaryGrid}>
|
|
1018
|
+
<View style={perfStyles.engineSummaryCard}>
|
|
1019
|
+
<Text style={perfStyles.engineSummaryLabel}>{t('performance.jsEngine')}</Text>
|
|
1020
|
+
<Text style={perfStyles.engineSummaryValue}>{runtimeDiagnostics.jsEngineName}</Text>
|
|
1021
|
+
<Text style={perfStyles.engineSummarySub}>{runtimeDiagnostics.jsEngineSub}</Text>
|
|
1022
|
+
</View>
|
|
1023
|
+
<View style={perfStyles.engineSummaryCard}>
|
|
1024
|
+
<Text style={perfStyles.engineSummaryLabel}>{t('performance.uiRenderThread')}</Text>
|
|
1025
|
+
<Text style={perfStyles.engineSummaryValue}>{runtimeDiagnostics.uiArchName}</Text>
|
|
1026
|
+
<Text style={perfStyles.engineSummarySub}>{runtimeDiagnostics.uiArchSub}</Text>
|
|
1027
|
+
</View>
|
|
1028
|
+
<View style={perfStyles.engineSummaryCard}>
|
|
1029
|
+
<Text style={perfStyles.engineSummaryLabel}>{t('performance.tabMemory')}</Text>
|
|
1030
|
+
<Text style={perfStyles.engineSummaryValue}>{runtimeDiagnostics.usedHeapMb} MB</Text>
|
|
1031
|
+
<Text style={perfStyles.engineSummarySub}>
|
|
1032
|
+
{t('performance.heapAllocatedSub', {allocated: runtimeDiagnostics.totalAllocMb})}
|
|
1033
|
+
</Text>
|
|
1034
|
+
</View>
|
|
1035
|
+
</View>
|
|
1036
|
+
|
|
1037
|
+
{/* ── 4. PERFORMANCE LOGS & DETAILED EVENTS ── */}
|
|
1038
|
+
<View style={perfStyles.logsHeaderRow}>
|
|
1039
|
+
<Text style={perfStyles.logsSectionHeading}>
|
|
1040
|
+
{t('performance.recordedEvents')} ({filteredEvents.length})
|
|
1041
|
+
</Text>
|
|
1042
|
+
{events.length > 0 && (
|
|
1043
|
+
<TouchableScale onPress={clearEvents}>
|
|
1044
|
+
<Text style={perfStyles.clearLink}>{t('common.clear')}</Text>
|
|
1045
|
+
</TouchableScale>
|
|
1046
|
+
)}
|
|
1047
|
+
</View>
|
|
1048
|
+
|
|
1049
|
+
{filteredEvents.length === 0 ? (
|
|
1050
|
+
<View style={perfStyles.emptyCard}>
|
|
1051
|
+
<BoltIcon color={AppColors.amber500} size={30} />
|
|
1052
|
+
<Text style={perfStyles.emptyTitle}>{t('performance.emptyTitle')}</Text>
|
|
1053
|
+
<Text style={perfStyles.emptySub}>
|
|
1054
|
+
{t('performance.emptySubtitle')}
|
|
1055
|
+
</Text>
|
|
1056
|
+
</View>
|
|
1057
|
+
) : (
|
|
1058
|
+
filteredEvents.map(event => {
|
|
1059
|
+
const isOptimal = event.severity === 'optimal';
|
|
1060
|
+
const isWarning = event.severity === 'warning';
|
|
1061
|
+
const isCritical = event.severity === 'critical';
|
|
1062
|
+
const isExpanded = !!expandedEventIds[event.id];
|
|
1063
|
+
|
|
1064
|
+
const badgeBg = isOptimal ? AppColors.greenBg : isWarning ? AppColors.amberBg : AppColors.errorCardBg;
|
|
1065
|
+
const badgeBorder = isOptimal ? AppColors.greenBorder : isWarning ? AppColors.lightOrange : AppColors.errorBorder;
|
|
1066
|
+
const badgeColor = isOptimal ? AppColors.emerald600 : isWarning ? AppColors.amber700 : AppColors.errorColor;
|
|
1067
|
+
|
|
1068
|
+
return (
|
|
1069
|
+
<TouchableScale
|
|
1070
|
+
key={event.id}
|
|
1071
|
+
onPress={() => toggleEventExpand(event.id)}
|
|
1072
|
+
style={[
|
|
1073
|
+
perfStyles.eventCard,
|
|
1074
|
+
isCritical && {borderColor: AppColors.errorBorder, backgroundColor: AppColors.errorCardBg},
|
|
1075
|
+
]}>
|
|
1076
|
+
<View style={perfStyles.eventTopRow}>
|
|
1077
|
+
<View style={perfStyles.fpsBadgeGroup}>
|
|
1078
|
+
<View
|
|
1079
|
+
style={[
|
|
1080
|
+
perfStyles.fpsBadge,
|
|
1081
|
+
{backgroundColor: badgeBg, borderColor: badgeBorder},
|
|
1082
|
+
]}>
|
|
1083
|
+
<Text style={[perfStyles.fpsBadgeText, {color: badgeColor}]}>
|
|
1084
|
+
{event.fps} FPS
|
|
1085
|
+
</Text>
|
|
1086
|
+
</View>
|
|
1087
|
+
|
|
1088
|
+
{/* Dropped Frames Badge */}
|
|
1089
|
+
<View
|
|
1090
|
+
style={[
|
|
1091
|
+
perfStyles.droppedBadge,
|
|
1092
|
+
(event.droppedFrames ?? Math.max(0, 60 - event.fps)) > 0
|
|
1093
|
+
? perfStyles.droppedBadgeWarning
|
|
1094
|
+
: perfStyles.droppedBadgeOptimal,
|
|
1095
|
+
]}>
|
|
1096
|
+
<Text
|
|
1097
|
+
style={[
|
|
1098
|
+
perfStyles.droppedBadgeText,
|
|
1099
|
+
(event.droppedFrames ?? Math.max(0, 60 - event.fps)) > 0
|
|
1100
|
+
? {color: AppColors.red600}
|
|
1101
|
+
: {color: AppColors.emerald600},
|
|
1102
|
+
]}>
|
|
1103
|
+
{(event.droppedFrames ?? Math.max(0, 60 - event.fps)) > 0
|
|
1104
|
+
? t('performance.droppedFrames', {count: event.droppedFrames ?? Math.max(0, 60 - event.fps)})
|
|
1105
|
+
: t('performance.zeroDropped')}
|
|
1106
|
+
</Text>
|
|
1107
|
+
</View>
|
|
1108
|
+
|
|
1109
|
+
{/* Bottleneck Thread Tag */}
|
|
1110
|
+
{event.bottleneckThread && (
|
|
1111
|
+
<View style={[perfStyles.bottleneckTag, {flexDirection: 'row', alignItems: 'center', gap: 3}]}>
|
|
1112
|
+
{event.bottleneckThread === 'JS Thread' && (
|
|
1113
|
+
<BoltIcon size={10} color={AppColors.warningIconGold} />
|
|
1114
|
+
)}
|
|
1115
|
+
<Text style={perfStyles.bottleneckTagText}>
|
|
1116
|
+
{event.bottleneckThread === 'JS Thread'
|
|
1117
|
+
? t('performance.jsBound')
|
|
1118
|
+
: event.bottleneckThread === 'UI Thread'
|
|
1119
|
+
? t('performance.uiBound')
|
|
1120
|
+
: t('performance.balanced')}
|
|
1121
|
+
</Text>
|
|
1122
|
+
</View>
|
|
1123
|
+
)}
|
|
1124
|
+
</View>
|
|
1125
|
+
|
|
1126
|
+
<View style={{flexDirection: 'row', alignItems: 'center', gap: 6}}>
|
|
1127
|
+
<CopyButton
|
|
1128
|
+
value={() => event}
|
|
1129
|
+
label={t('common.copyJson')}
|
|
1130
|
+
/>
|
|
1131
|
+
<ChevronIcon
|
|
1132
|
+
isExpanded={isExpanded}
|
|
1133
|
+
size={14}
|
|
1134
|
+
color={AppColors.grayTextWeak}
|
|
1135
|
+
/>
|
|
1136
|
+
</View>
|
|
1137
|
+
</View>
|
|
1138
|
+
|
|
1139
|
+
{/* Event Label & Meta */}
|
|
1140
|
+
<View style={{marginTop: 4}}>
|
|
1141
|
+
<HighlightText
|
|
1142
|
+
text={event.label}
|
|
1143
|
+
search={search}
|
|
1144
|
+
style={perfStyles.eventLabel}
|
|
1145
|
+
highlightStyle={perfStyles.searchHighlight}
|
|
1146
|
+
/>
|
|
1147
|
+
<View style={perfStyles.eventMetaRow}>
|
|
1148
|
+
<Text style={perfStyles.eventMeta}>
|
|
1149
|
+
{t('performance.msTotal', {
|
|
1150
|
+
duration: event.durationMs,
|
|
1151
|
+
time: new Date(event.timestamp).toLocaleTimeString(),
|
|
1152
|
+
})}
|
|
1153
|
+
</Text>
|
|
1154
|
+
<Text style={perfStyles.eventMetaDot}>•</Text>
|
|
1155
|
+
<Text
|
|
1156
|
+
style={[
|
|
1157
|
+
perfStyles.frameBudgetHint,
|
|
1158
|
+
event.durationMs > 16.67
|
|
1159
|
+
? {color: AppColors.amber800Warm}
|
|
1160
|
+
: {color: AppColors.emerald600},
|
|
1161
|
+
]}>
|
|
1162
|
+
{t('performance.frameBudgetMs', {
|
|
1163
|
+
time: event.durationMs,
|
|
1164
|
+
budget: Number(((event.durationMs / 16.67) * 100).toFixed(0)),
|
|
1165
|
+
})}
|
|
1166
|
+
</Text>
|
|
1167
|
+
</View>
|
|
1168
|
+
</View>
|
|
1169
|
+
|
|
1170
|
+
{/* Visual Frame Time Budget Bar */}
|
|
1171
|
+
<View style={perfStyles.frameBarTrack}>
|
|
1172
|
+
<View
|
|
1173
|
+
style={[
|
|
1174
|
+
perfStyles.frameBarFill,
|
|
1175
|
+
{
|
|
1176
|
+
width: `${Math.min(100, Math.max(10, (event.durationMs / 33.33) * 100))}%`,
|
|
1177
|
+
backgroundColor: badgeColor,
|
|
1178
|
+
},
|
|
1179
|
+
]}
|
|
1180
|
+
/>
|
|
1181
|
+
</View>
|
|
1182
|
+
|
|
1183
|
+
<HighlightText
|
|
1184
|
+
text={event.detail}
|
|
1185
|
+
search={search}
|
|
1186
|
+
style={perfStyles.eventDetail}
|
|
1187
|
+
highlightStyle={perfStyles.searchHighlight}
|
|
1188
|
+
/>
|
|
1189
|
+
|
|
1190
|
+
{/* ── EXPANDABLE IN-DEPTH METRICS ACCORDION ── */}
|
|
1191
|
+
{isExpanded && (
|
|
1192
|
+
<View style={perfStyles.expandedDetailBox}>
|
|
1193
|
+
{/* Screen / Component Context */}
|
|
1194
|
+
{(event.screenName || event.source) && (
|
|
1195
|
+
<View style={perfStyles.sourceRow}>
|
|
1196
|
+
<Text style={perfStyles.sourceTag}>{t('performance.screenContext')}</Text>
|
|
1197
|
+
<Text style={perfStyles.sourceText} numberOfLines={1}>
|
|
1198
|
+
{event.screenName || event.source}
|
|
1199
|
+
</Text>
|
|
1200
|
+
</View>
|
|
1201
|
+
)}
|
|
1202
|
+
|
|
1203
|
+
{/* Frame Metrics Grid */}
|
|
1204
|
+
<View style={perfStyles.fpsMetricsGrid}>
|
|
1205
|
+
<View style={perfStyles.fpsMetricItem}>
|
|
1206
|
+
<Text style={perfStyles.fpsMetricLabel}>{t('performance.target60Fps', {fps: event.fps})}</Text>
|
|
1207
|
+
<Text style={[perfStyles.fpsMetricVal, {color: badgeColor}]}>
|
|
1208
|
+
{event.fps} FPS
|
|
1209
|
+
</Text>
|
|
1210
|
+
</View>
|
|
1211
|
+
<View style={perfStyles.fpsMetricItem}>
|
|
1212
|
+
<Text style={perfStyles.fpsMetricLabel}>{t('performance.frameDuration')}</Text>
|
|
1213
|
+
<Text style={perfStyles.fpsMetricVal}>
|
|
1214
|
+
{event.durationMs} ms
|
|
1215
|
+
</Text>
|
|
1216
|
+
</View>
|
|
1217
|
+
<View style={perfStyles.fpsMetricItem}>
|
|
1218
|
+
<Text style={perfStyles.fpsMetricLabel}>{t('performance.jankRate')}</Text>
|
|
1219
|
+
<Text
|
|
1220
|
+
style={[
|
|
1221
|
+
perfStyles.fpsMetricVal,
|
|
1222
|
+
(event.droppedFrames ?? 0) > 0 ? {color: AppColors.red600} : {color: AppColors.emerald600},
|
|
1223
|
+
]}>
|
|
1224
|
+
{event.droppedFrames ?? Math.max(0, 60 - event.fps)} frames
|
|
1225
|
+
</Text>
|
|
1226
|
+
</View>
|
|
1227
|
+
<View style={perfStyles.fpsMetricItem}>
|
|
1228
|
+
<Text style={perfStyles.fpsMetricLabel}>{t('performance.bottleneck')}</Text>
|
|
1229
|
+
<Text style={perfStyles.fpsMetricVal}>
|
|
1230
|
+
{event.bottleneckThread || t('performance.balanced')}
|
|
1231
|
+
</Text>
|
|
1232
|
+
</View>
|
|
1233
|
+
</View>
|
|
1234
|
+
|
|
1235
|
+
{/* Thread Timing Breakdown */}
|
|
1236
|
+
{event.breakdown && (
|
|
1237
|
+
<View style={perfStyles.breakdownGrid}>
|
|
1238
|
+
<View style={perfStyles.breakdownCol}>
|
|
1239
|
+
<Text style={perfStyles.breakdownLabel}>{t('performance.jsThread')}</Text>
|
|
1240
|
+
<Text style={perfStyles.breakdownVal}>
|
|
1241
|
+
{event.breakdown.jsTimeMs} ms
|
|
1242
|
+
</Text>
|
|
1243
|
+
</View>
|
|
1244
|
+
<View style={perfStyles.breakdownCol}>
|
|
1245
|
+
<Text style={perfStyles.breakdownLabel}>{t('performance.uiThread')}</Text>
|
|
1246
|
+
<Text style={perfStyles.breakdownVal}>
|
|
1247
|
+
{event.breakdown.uiTimeMs} ms
|
|
1248
|
+
</Text>
|
|
1249
|
+
</View>
|
|
1250
|
+
{event.breakdown.bridgeLatencyMs != null && (
|
|
1251
|
+
<View style={perfStyles.breakdownCol}>
|
|
1252
|
+
<Text style={perfStyles.breakdownLabel}>{t('performance.jsiLatency')}</Text>
|
|
1253
|
+
<Text style={perfStyles.breakdownVal}>
|
|
1254
|
+
{event.breakdown.bridgeLatencyMs} ms
|
|
1255
|
+
</Text>
|
|
1256
|
+
</View>
|
|
1257
|
+
)}
|
|
1258
|
+
{event.heapDeltaKb != null && (
|
|
1259
|
+
<View style={perfStyles.breakdownCol}>
|
|
1260
|
+
<Text style={perfStyles.breakdownLabel}>{t('performance.heapImpact')}</Text>
|
|
1261
|
+
<Text
|
|
1262
|
+
style={[
|
|
1263
|
+
perfStyles.breakdownVal,
|
|
1264
|
+
{color: event.heapDeltaKb > 0 ? AppColors.amber700 : AppColors.emerald600},
|
|
1265
|
+
]}>
|
|
1266
|
+
{event.heapDeltaKb > 0 ? `+${event.heapDeltaKb}` : event.heapDeltaKb} KB
|
|
1267
|
+
</Text>
|
|
1268
|
+
</View>
|
|
1269
|
+
)}
|
|
1270
|
+
</View>
|
|
1271
|
+
)}
|
|
1272
|
+
|
|
1273
|
+
{/* Actionable Optimization Tip */}
|
|
1274
|
+
{event.advice && (
|
|
1275
|
+
<View style={perfStyles.adviceCard}>
|
|
1276
|
+
<View style={{flexDirection: 'row', alignItems: 'center', gap: 5}}>
|
|
1277
|
+
<LightbulbIcon color={AppColors.purpleShade700} size={12} />
|
|
1278
|
+
<Text style={perfStyles.adviceHeading}>{t('performance.optimizationTip')}</Text>
|
|
1279
|
+
</View>
|
|
1280
|
+
<Text style={perfStyles.adviceBodyText}>{event.advice}</Text>
|
|
1281
|
+
</View>
|
|
1282
|
+
)}
|
|
1283
|
+
</View>
|
|
1284
|
+
)}
|
|
1285
|
+
</TouchableScale>
|
|
1286
|
+
);
|
|
1287
|
+
})
|
|
1288
|
+
)}
|
|
1289
|
+
|
|
1290
|
+
<EndOfListFooter
|
|
1291
|
+
count={filteredEvents.length}
|
|
1292
|
+
label={t('performance.recordedEvents')}
|
|
1293
|
+
/>
|
|
1294
|
+
</ScrollView>
|
|
1295
|
+
</View>
|
|
1296
|
+
);
|
|
1297
|
+
});
|
|
1298
|
+
|
|
1299
|
+
const perfStyles = StyleSheet.create({
|
|
1300
|
+
container: {
|
|
1301
|
+
flex: 1,
|
|
1302
|
+
backgroundColor: AppColors.grayBackground,
|
|
1303
|
+
},
|
|
1304
|
+
headerBar: {
|
|
1305
|
+
flexDirection: 'row',
|
|
1306
|
+
alignItems: 'center',
|
|
1307
|
+
paddingHorizontal: 12,
|
|
1308
|
+
paddingVertical: 8,
|
|
1309
|
+
backgroundColor: AppColors.white,
|
|
1310
|
+
borderBottomWidth: 1,
|
|
1311
|
+
borderBottomColor: AppColors.dividerColor,
|
|
1312
|
+
gap: 8,
|
|
1313
|
+
},
|
|
1314
|
+
searchBox: {
|
|
1315
|
+
flex: 1,
|
|
1316
|
+
flexDirection: 'row',
|
|
1317
|
+
alignItems: 'center',
|
|
1318
|
+
backgroundColor: AppColors.grayBackground,
|
|
1319
|
+
borderRadius: 8,
|
|
1320
|
+
paddingHorizontal: 8,
|
|
1321
|
+
height: 36,
|
|
1322
|
+
gap: 6,
|
|
1323
|
+
borderWidth: 1,
|
|
1324
|
+
borderColor: AppColors.dividerColor,
|
|
1325
|
+
},
|
|
1326
|
+
searchInput: {
|
|
1327
|
+
flex: 1,
|
|
1328
|
+
fontFamily: AppFonts.interRegular,
|
|
1329
|
+
fontSize: 12,
|
|
1330
|
+
color: AppColors.primaryBlack,
|
|
1331
|
+
paddingVertical: 0,
|
|
1332
|
+
},
|
|
1333
|
+
recordToggleBtn: {
|
|
1334
|
+
flexDirection: 'row',
|
|
1335
|
+
alignItems: 'center',
|
|
1336
|
+
gap: 5,
|
|
1337
|
+
paddingHorizontal: 8,
|
|
1338
|
+
paddingVertical: 6,
|
|
1339
|
+
borderRadius: 7,
|
|
1340
|
+
borderWidth: 1,
|
|
1341
|
+
},
|
|
1342
|
+
recordToggleActive: {
|
|
1343
|
+
backgroundColor: `${AppColors.errorColor}14`,
|
|
1344
|
+
borderColor: `${AppColors.errorColor}30`,
|
|
1345
|
+
},
|
|
1346
|
+
recordToggleInactive: {
|
|
1347
|
+
backgroundColor: AppColors.graySurface,
|
|
1348
|
+
borderColor: AppColors.dividerColor,
|
|
1349
|
+
},
|
|
1350
|
+
recordingDot: {
|
|
1351
|
+
width: 6,
|
|
1352
|
+
height: 6,
|
|
1353
|
+
borderRadius: 3,
|
|
1354
|
+
},
|
|
1355
|
+
recordToggleText: {
|
|
1356
|
+
fontFamily: AppFonts.interBold,
|
|
1357
|
+
fontSize: 11,
|
|
1358
|
+
},
|
|
1359
|
+
categoryScrollWrapper: {
|
|
1360
|
+
backgroundColor: AppColors.white,
|
|
1361
|
+
borderBottomWidth: 1,
|
|
1362
|
+
borderBottomColor: AppColors.dividerColor,
|
|
1363
|
+
height: 42,
|
|
1364
|
+
},
|
|
1365
|
+
categoryScrollView: {
|
|
1366
|
+
flexGrow: 0,
|
|
1367
|
+
height: 42,
|
|
1368
|
+
},
|
|
1369
|
+
categoryScroll: {
|
|
1370
|
+
flexDirection: 'row',
|
|
1371
|
+
alignItems: 'center',
|
|
1372
|
+
gap: 6,
|
|
1373
|
+
paddingHorizontal: 12,
|
|
1374
|
+
height: 42,
|
|
1375
|
+
},
|
|
1376
|
+
categoryChip: {
|
|
1377
|
+
flexDirection: 'row',
|
|
1378
|
+
alignItems: 'center',
|
|
1379
|
+
justifyContent: 'center',
|
|
1380
|
+
paddingHorizontal: 12,
|
|
1381
|
+
height: 28,
|
|
1382
|
+
borderRadius: 14,
|
|
1383
|
+
backgroundColor: AppColors.grayBackground,
|
|
1384
|
+
borderWidth: 1,
|
|
1385
|
+
borderColor: AppColors.dividerColor,
|
|
1386
|
+
},
|
|
1387
|
+
categoryChipActive: {
|
|
1388
|
+
backgroundColor: AppColors.brandPurple,
|
|
1389
|
+
borderColor: AppColors.brandPurple,
|
|
1390
|
+
},
|
|
1391
|
+
categoryChipText: {
|
|
1392
|
+
fontFamily: AppFonts.interMedium,
|
|
1393
|
+
fontSize: 11,
|
|
1394
|
+
color: AppColors.grayTextStrong,
|
|
1395
|
+
},
|
|
1396
|
+
categoryChipTextActive: {
|
|
1397
|
+
fontFamily: AppFonts.interBold,
|
|
1398
|
+
color: AppColors.white,
|
|
1399
|
+
},
|
|
1400
|
+
scrollBody: {
|
|
1401
|
+
flex: 1,
|
|
1402
|
+
},
|
|
1403
|
+
scrollContent: {
|
|
1404
|
+
padding: 12,
|
|
1405
|
+
gap: 10,
|
|
1406
|
+
},
|
|
1407
|
+
heroCard: {
|
|
1408
|
+
backgroundColor: AppColors.white,
|
|
1409
|
+
borderRadius: 12,
|
|
1410
|
+
padding: 14,
|
|
1411
|
+
borderWidth: 1,
|
|
1412
|
+
borderColor: AppColors.dividerColor,
|
|
1413
|
+
shadowColor: AppColors.black,
|
|
1414
|
+
shadowOffset: {width: 0, height: 1},
|
|
1415
|
+
shadowOpacity: 0.05,
|
|
1416
|
+
shadowRadius: 3,
|
|
1417
|
+
elevation: 1,
|
|
1418
|
+
},
|
|
1419
|
+
heroHeaderRow: {
|
|
1420
|
+
flexDirection: 'row',
|
|
1421
|
+
alignItems: 'center',
|
|
1422
|
+
justifyContent: 'space-between',
|
|
1423
|
+
marginBottom: 10,
|
|
1424
|
+
},
|
|
1425
|
+
heroTitle: {
|
|
1426
|
+
fontFamily: AppFonts.interBold,
|
|
1427
|
+
fontSize: 13,
|
|
1428
|
+
color: AppColors.primaryBlack,
|
|
1429
|
+
},
|
|
1430
|
+
heroSubTitle: {
|
|
1431
|
+
fontFamily: AppFonts.interRegular,
|
|
1432
|
+
fontSize: 9.5,
|
|
1433
|
+
color: AppColors.grayTextWeak,
|
|
1434
|
+
marginTop: 1,
|
|
1435
|
+
},
|
|
1436
|
+
scorePill: {
|
|
1437
|
+
paddingHorizontal: 8,
|
|
1438
|
+
paddingVertical: 3,
|
|
1439
|
+
borderRadius: 6,
|
|
1440
|
+
},
|
|
1441
|
+
scorePillText: {
|
|
1442
|
+
fontFamily: AppFonts.interBold,
|
|
1443
|
+
fontSize: 10.5,
|
|
1444
|
+
},
|
|
1445
|
+
primaryFpsRow: {
|
|
1446
|
+
flexDirection: 'row',
|
|
1447
|
+
alignItems: 'center',
|
|
1448
|
+
justifyContent: 'space-between',
|
|
1449
|
+
paddingVertical: 6,
|
|
1450
|
+
},
|
|
1451
|
+
fpsBigNumberBox: {
|
|
1452
|
+
flexDirection: 'row',
|
|
1453
|
+
alignItems: 'baseline',
|
|
1454
|
+
gap: 4,
|
|
1455
|
+
minWidth: 80,
|
|
1456
|
+
},
|
|
1457
|
+
fpsBigNumber: {
|
|
1458
|
+
fontFamily: AppFonts.interBold,
|
|
1459
|
+
fontSize: 42,
|
|
1460
|
+
lineHeight: 48,
|
|
1461
|
+
letterSpacing: -1,
|
|
1462
|
+
minWidth: 54,
|
|
1463
|
+
},
|
|
1464
|
+
fpsUnit: {
|
|
1465
|
+
fontFamily: AppFonts.interBold,
|
|
1466
|
+
fontSize: 14,
|
|
1467
|
+
color: AppColors.grayTextWeak,
|
|
1468
|
+
},
|
|
1469
|
+
fpsStatsGrid: {
|
|
1470
|
+
flexDirection: 'row',
|
|
1471
|
+
alignItems: 'center',
|
|
1472
|
+
gap: 8,
|
|
1473
|
+
},
|
|
1474
|
+
statItem: {
|
|
1475
|
+
alignItems: 'center',
|
|
1476
|
+
minWidth: 50,
|
|
1477
|
+
},
|
|
1478
|
+
statLabel: {
|
|
1479
|
+
fontFamily: AppFonts.interRegular,
|
|
1480
|
+
fontSize: 10,
|
|
1481
|
+
color: AppColors.grayTextWeak,
|
|
1482
|
+
},
|
|
1483
|
+
statValue: {
|
|
1484
|
+
fontFamily: AppFonts.interBold,
|
|
1485
|
+
fontSize: 13,
|
|
1486
|
+
color: AppColors.primaryBlack,
|
|
1487
|
+
marginTop: 2,
|
|
1488
|
+
textAlign: 'center',
|
|
1489
|
+
},
|
|
1490
|
+
graphScrubTooltip: {
|
|
1491
|
+
alignSelf: 'center',
|
|
1492
|
+
backgroundColor: AppColors.primaryBlack,
|
|
1493
|
+
paddingHorizontal: 8,
|
|
1494
|
+
paddingVertical: 3,
|
|
1495
|
+
borderRadius: 6,
|
|
1496
|
+
marginBottom: 4,
|
|
1497
|
+
},
|
|
1498
|
+
graphScrubTooltipText: {
|
|
1499
|
+
fontFamily: AppFonts.interBold,
|
|
1500
|
+
fontSize: 10,
|
|
1501
|
+
color: AppColors.white,
|
|
1502
|
+
},
|
|
1503
|
+
svgGraphContainer: {
|
|
1504
|
+
width: '100%',
|
|
1505
|
+
height: 64,
|
|
1506
|
+
marginTop: 6,
|
|
1507
|
+
position: 'relative',
|
|
1508
|
+
overflow: 'hidden',
|
|
1509
|
+
borderRadius: 8,
|
|
1510
|
+
},
|
|
1511
|
+
svgTouchOverlay: {
|
|
1512
|
+
position: 'absolute',
|
|
1513
|
+
top: 0,
|
|
1514
|
+
left: 0,
|
|
1515
|
+
right: 0,
|
|
1516
|
+
bottom: 0,
|
|
1517
|
+
flexDirection: 'row',
|
|
1518
|
+
},
|
|
1519
|
+
svgTouchCol: {
|
|
1520
|
+
flex: 1,
|
|
1521
|
+
height: '100%',
|
|
1522
|
+
},
|
|
1523
|
+
histogramContainer: {
|
|
1524
|
+
gap: 8,
|
|
1525
|
+
marginTop: 4,
|
|
1526
|
+
},
|
|
1527
|
+
histogramRow: {
|
|
1528
|
+
flexDirection: 'row',
|
|
1529
|
+
alignItems: 'center',
|
|
1530
|
+
gap: 8,
|
|
1531
|
+
},
|
|
1532
|
+
histogramLabelCol: {
|
|
1533
|
+
flexDirection: 'row',
|
|
1534
|
+
alignItems: 'center',
|
|
1535
|
+
gap: 6,
|
|
1536
|
+
width: 140,
|
|
1537
|
+
},
|
|
1538
|
+
histogramLabelText: {
|
|
1539
|
+
fontFamily: AppFonts.interMedium,
|
|
1540
|
+
fontSize: 10,
|
|
1541
|
+
color: AppColors.grayTextStrong,
|
|
1542
|
+
},
|
|
1543
|
+
histogramBarCol: {
|
|
1544
|
+
flex: 1,
|
|
1545
|
+
},
|
|
1546
|
+
histogramTrack: {
|
|
1547
|
+
height: 8,
|
|
1548
|
+
backgroundColor: AppColors.grayBackground,
|
|
1549
|
+
borderRadius: 4,
|
|
1550
|
+
overflow: 'hidden',
|
|
1551
|
+
},
|
|
1552
|
+
histogramBarFill: {
|
|
1553
|
+
height: '100%',
|
|
1554
|
+
borderRadius: 4,
|
|
1555
|
+
},
|
|
1556
|
+
histogramStatsCol: {
|
|
1557
|
+
flexDirection: 'row',
|
|
1558
|
+
alignItems: 'center',
|
|
1559
|
+
gap: 4,
|
|
1560
|
+
minWidth: 52,
|
|
1561
|
+
justifyContent: 'flex-end',
|
|
1562
|
+
},
|
|
1563
|
+
histogramPercentText: {
|
|
1564
|
+
fontFamily: AppFonts.interBold,
|
|
1565
|
+
fontSize: 10.5,
|
|
1566
|
+
},
|
|
1567
|
+
histogramCountText: {
|
|
1568
|
+
fontFamily: AppFonts.interRegular,
|
|
1569
|
+
fontSize: 9.5,
|
|
1570
|
+
color: AppColors.grayTextWeak,
|
|
1571
|
+
},
|
|
1572
|
+
sparklineFooter: {
|
|
1573
|
+
flexDirection: 'row',
|
|
1574
|
+
alignItems: 'center',
|
|
1575
|
+
justifyContent: 'space-between',
|
|
1576
|
+
marginTop: 6,
|
|
1577
|
+
},
|
|
1578
|
+
sparklineFooterText: {
|
|
1579
|
+
fontFamily: AppFonts.interRegular,
|
|
1580
|
+
fontSize: 10,
|
|
1581
|
+
color: AppColors.grayTextWeak,
|
|
1582
|
+
},
|
|
1583
|
+
sparklineFooterTarget: {
|
|
1584
|
+
fontFamily: AppFonts.interMedium,
|
|
1585
|
+
fontSize: 10,
|
|
1586
|
+
color: AppColors.emerald600,
|
|
1587
|
+
},
|
|
1588
|
+
budgetCard: {
|
|
1589
|
+
backgroundColor: AppColors.white,
|
|
1590
|
+
borderRadius: 12,
|
|
1591
|
+
padding: 12,
|
|
1592
|
+
borderWidth: 1,
|
|
1593
|
+
borderColor: AppColors.dividerColor,
|
|
1594
|
+
gap: 8,
|
|
1595
|
+
},
|
|
1596
|
+
budgetHeader: {
|
|
1597
|
+
flexDirection: 'row',
|
|
1598
|
+
alignItems: 'center',
|
|
1599
|
+
justifyContent: 'space-between',
|
|
1600
|
+
},
|
|
1601
|
+
budgetTitle: {
|
|
1602
|
+
fontFamily: AppFonts.interBold,
|
|
1603
|
+
fontSize: 12.5,
|
|
1604
|
+
color: AppColors.primaryBlack,
|
|
1605
|
+
},
|
|
1606
|
+
budgetHeadroom: {
|
|
1607
|
+
fontFamily: AppFonts.interBold,
|
|
1608
|
+
fontSize: 11,
|
|
1609
|
+
color: AppColors.emerald600,
|
|
1610
|
+
},
|
|
1611
|
+
budgetBarContainer: {
|
|
1612
|
+
flexDirection: 'row',
|
|
1613
|
+
height: 8,
|
|
1614
|
+
borderRadius: 4,
|
|
1615
|
+
overflow: 'hidden',
|
|
1616
|
+
backgroundColor: AppColors.grayBackground,
|
|
1617
|
+
gap: 2,
|
|
1618
|
+
},
|
|
1619
|
+
budgetBarSegment: {
|
|
1620
|
+
height: '100%',
|
|
1621
|
+
borderRadius: 2,
|
|
1622
|
+
},
|
|
1623
|
+
budgetLegendGrid: {
|
|
1624
|
+
flexDirection: 'row',
|
|
1625
|
+
flexWrap: 'wrap',
|
|
1626
|
+
gap: 10,
|
|
1627
|
+
marginTop: 2,
|
|
1628
|
+
},
|
|
1629
|
+
legendItem: {
|
|
1630
|
+
flexDirection: 'row',
|
|
1631
|
+
alignItems: 'center',
|
|
1632
|
+
gap: 4,
|
|
1633
|
+
},
|
|
1634
|
+
legendDot: {
|
|
1635
|
+
width: 6,
|
|
1636
|
+
height: 6,
|
|
1637
|
+
borderRadius: 3,
|
|
1638
|
+
},
|
|
1639
|
+
legendText: {
|
|
1640
|
+
fontFamily: AppFonts.interRegular,
|
|
1641
|
+
fontSize: 10,
|
|
1642
|
+
color: AppColors.grayTextStrong,
|
|
1643
|
+
},
|
|
1644
|
+
engineSummaryGrid: {
|
|
1645
|
+
flexDirection: 'row',
|
|
1646
|
+
alignItems: 'center',
|
|
1647
|
+
gap: 8,
|
|
1648
|
+
},
|
|
1649
|
+
engineSummaryCard: {
|
|
1650
|
+
flex: 1,
|
|
1651
|
+
backgroundColor: AppColors.white,
|
|
1652
|
+
borderRadius: 10,
|
|
1653
|
+
padding: 10,
|
|
1654
|
+
borderWidth: 1,
|
|
1655
|
+
borderColor: AppColors.dividerColor,
|
|
1656
|
+
},
|
|
1657
|
+
engineSummaryLabel: {
|
|
1658
|
+
fontFamily: AppFonts.interMedium,
|
|
1659
|
+
fontSize: 10,
|
|
1660
|
+
color: AppColors.grayTextWeak,
|
|
1661
|
+
},
|
|
1662
|
+
engineSummaryValue: {
|
|
1663
|
+
fontFamily: AppFonts.interBold,
|
|
1664
|
+
fontSize: 11.5,
|
|
1665
|
+
color: AppColors.primaryBlack,
|
|
1666
|
+
marginTop: 2,
|
|
1667
|
+
},
|
|
1668
|
+
engineSummarySub: {
|
|
1669
|
+
fontFamily: AppFonts.interRegular,
|
|
1670
|
+
fontSize: 9.5,
|
|
1671
|
+
color: AppColors.grayTextWeak,
|
|
1672
|
+
marginTop: 1,
|
|
1673
|
+
},
|
|
1674
|
+
logsHeaderRow: {
|
|
1675
|
+
flexDirection: 'row',
|
|
1676
|
+
alignItems: 'center',
|
|
1677
|
+
justifyContent: 'space-between',
|
|
1678
|
+
marginTop: 4,
|
|
1679
|
+
},
|
|
1680
|
+
logsSectionHeading: {
|
|
1681
|
+
fontFamily: AppFonts.interBold,
|
|
1682
|
+
fontSize: 13,
|
|
1683
|
+
color: AppColors.primaryBlack,
|
|
1684
|
+
},
|
|
1685
|
+
clearLink: {
|
|
1686
|
+
fontFamily: AppFonts.interBold,
|
|
1687
|
+
fontSize: 11.5,
|
|
1688
|
+
color: AppColors.purple,
|
|
1689
|
+
},
|
|
1690
|
+
eventCard: {
|
|
1691
|
+
backgroundColor: AppColors.white,
|
|
1692
|
+
borderRadius: 10,
|
|
1693
|
+
padding: 10,
|
|
1694
|
+
borderWidth: 1,
|
|
1695
|
+
borderColor: AppColors.dividerColor,
|
|
1696
|
+
gap: 6,
|
|
1697
|
+
},
|
|
1698
|
+
eventTopRow: {
|
|
1699
|
+
flexDirection: 'row',
|
|
1700
|
+
alignItems: 'center',
|
|
1701
|
+
justifyContent: 'space-between',
|
|
1702
|
+
},
|
|
1703
|
+
fpsBadgeGroup: {
|
|
1704
|
+
flexDirection: 'row',
|
|
1705
|
+
alignItems: 'center',
|
|
1706
|
+
gap: 6,
|
|
1707
|
+
flexWrap: 'wrap',
|
|
1708
|
+
},
|
|
1709
|
+
fpsBadge: {
|
|
1710
|
+
paddingHorizontal: 6,
|
|
1711
|
+
paddingVertical: 2,
|
|
1712
|
+
borderRadius: 5,
|
|
1713
|
+
borderWidth: 1,
|
|
1714
|
+
},
|
|
1715
|
+
fpsBadgeText: {
|
|
1716
|
+
fontFamily: AppFonts.interBold,
|
|
1717
|
+
fontSize: 10,
|
|
1718
|
+
},
|
|
1719
|
+
droppedBadge: {
|
|
1720
|
+
paddingHorizontal: 6,
|
|
1721
|
+
paddingVertical: 2,
|
|
1722
|
+
borderRadius: 5,
|
|
1723
|
+
borderWidth: 1,
|
|
1724
|
+
},
|
|
1725
|
+
droppedBadgeWarning: {
|
|
1726
|
+
backgroundColor: AppColors.red100,
|
|
1727
|
+
borderColor: AppColors.errorBorder,
|
|
1728
|
+
},
|
|
1729
|
+
droppedBadgeOptimal: {
|
|
1730
|
+
backgroundColor: AppColors.green100,
|
|
1731
|
+
borderColor: AppColors.greenBorder,
|
|
1732
|
+
},
|
|
1733
|
+
droppedBadgeText: {
|
|
1734
|
+
fontFamily: AppFonts.interBold,
|
|
1735
|
+
fontSize: 9.5,
|
|
1736
|
+
},
|
|
1737
|
+
bottleneckTag: {
|
|
1738
|
+
backgroundColor: AppColors.purpleShade50,
|
|
1739
|
+
paddingHorizontal: 5,
|
|
1740
|
+
paddingVertical: 2,
|
|
1741
|
+
borderRadius: 4,
|
|
1742
|
+
borderWidth: 1,
|
|
1743
|
+
borderColor: AppColors.purpleTint2,
|
|
1744
|
+
},
|
|
1745
|
+
bottleneckTagText: {
|
|
1746
|
+
fontFamily: AppFonts.interMedium,
|
|
1747
|
+
fontSize: 9.5,
|
|
1748
|
+
color: AppColors.purple,
|
|
1749
|
+
},
|
|
1750
|
+
eventMetaRow: {
|
|
1751
|
+
flexDirection: 'row',
|
|
1752
|
+
alignItems: 'center',
|
|
1753
|
+
gap: 6,
|
|
1754
|
+
marginTop: 2,
|
|
1755
|
+
flexWrap: 'wrap',
|
|
1756
|
+
},
|
|
1757
|
+
eventMetaDot: {
|
|
1758
|
+
fontSize: 9,
|
|
1759
|
+
color: AppColors.grayTextWeak,
|
|
1760
|
+
},
|
|
1761
|
+
frameBudgetHint: {
|
|
1762
|
+
fontFamily: AppFonts.interMedium,
|
|
1763
|
+
fontSize: 10,
|
|
1764
|
+
},
|
|
1765
|
+
frameBarTrack: {
|
|
1766
|
+
height: 4,
|
|
1767
|
+
borderRadius: 2,
|
|
1768
|
+
backgroundColor: AppColors.graySurface,
|
|
1769
|
+
overflow: 'hidden',
|
|
1770
|
+
marginVertical: 4,
|
|
1771
|
+
},
|
|
1772
|
+
frameBarFill: {
|
|
1773
|
+
height: '100%',
|
|
1774
|
+
borderRadius: 2,
|
|
1775
|
+
},
|
|
1776
|
+
fpsMetricsGrid: {
|
|
1777
|
+
flexDirection: 'row',
|
|
1778
|
+
alignItems: 'center',
|
|
1779
|
+
backgroundColor: AppColors.white,
|
|
1780
|
+
borderRadius: 6,
|
|
1781
|
+
padding: 6,
|
|
1782
|
+
borderWidth: 1,
|
|
1783
|
+
borderColor: AppColors.dividerColor,
|
|
1784
|
+
justifyContent: 'space-between',
|
|
1785
|
+
gap: 4,
|
|
1786
|
+
},
|
|
1787
|
+
fpsMetricItem: {
|
|
1788
|
+
alignItems: 'center',
|
|
1789
|
+
flex: 1,
|
|
1790
|
+
},
|
|
1791
|
+
fpsMetricLabel: {
|
|
1792
|
+
fontFamily: AppFonts.interRegular,
|
|
1793
|
+
fontSize: 8.5,
|
|
1794
|
+
color: AppColors.grayTextWeak,
|
|
1795
|
+
textAlign: 'center',
|
|
1796
|
+
},
|
|
1797
|
+
fpsMetricVal: {
|
|
1798
|
+
fontFamily: AppFonts.interBold,
|
|
1799
|
+
fontSize: 10.5,
|
|
1800
|
+
color: AppColors.primaryBlack,
|
|
1801
|
+
marginTop: 1,
|
|
1802
|
+
textAlign: 'center',
|
|
1803
|
+
},
|
|
1804
|
+
eventLabel: {
|
|
1805
|
+
fontFamily: AppFonts.interBold,
|
|
1806
|
+
fontSize: 12,
|
|
1807
|
+
color: AppColors.primaryBlack,
|
|
1808
|
+
},
|
|
1809
|
+
eventMeta: {
|
|
1810
|
+
fontFamily: AppFonts.interRegular,
|
|
1811
|
+
fontSize: 10,
|
|
1812
|
+
color: AppColors.grayTextWeak,
|
|
1813
|
+
marginTop: 1,
|
|
1814
|
+
},
|
|
1815
|
+
eventDetail: {
|
|
1816
|
+
fontFamily: AppFonts.interRegular,
|
|
1817
|
+
fontSize: 11,
|
|
1818
|
+
color: AppColors.grayTextStrong,
|
|
1819
|
+
lineHeight: 15,
|
|
1820
|
+
},
|
|
1821
|
+
expandChevron: {
|
|
1822
|
+
fontSize: 10,
|
|
1823
|
+
color: AppColors.grayTextWeak,
|
|
1824
|
+
marginLeft: 2,
|
|
1825
|
+
},
|
|
1826
|
+
expandedDetailBox: {
|
|
1827
|
+
backgroundColor: AppColors.grayBackground,
|
|
1828
|
+
borderRadius: 8,
|
|
1829
|
+
padding: 8,
|
|
1830
|
+
marginTop: 4,
|
|
1831
|
+
gap: 6,
|
|
1832
|
+
borderWidth: 1,
|
|
1833
|
+
borderColor: AppColors.dividerColor,
|
|
1834
|
+
},
|
|
1835
|
+
sourceRow: {
|
|
1836
|
+
flexDirection: 'row',
|
|
1837
|
+
alignItems: 'center',
|
|
1838
|
+
gap: 6,
|
|
1839
|
+
},
|
|
1840
|
+
sourceTag: {
|
|
1841
|
+
fontFamily: AppFonts.interBold,
|
|
1842
|
+
fontSize: 8.5,
|
|
1843
|
+
color: AppColors.purple,
|
|
1844
|
+
backgroundColor: `${AppColors.purple}14`,
|
|
1845
|
+
paddingHorizontal: 4,
|
|
1846
|
+
paddingVertical: 1,
|
|
1847
|
+
borderRadius: 3,
|
|
1848
|
+
},
|
|
1849
|
+
sourceText: {
|
|
1850
|
+
fontFamily: AppFonts.interMedium,
|
|
1851
|
+
fontSize: 10.5,
|
|
1852
|
+
color: AppColors.grayTextStrong,
|
|
1853
|
+
flex: 1,
|
|
1854
|
+
},
|
|
1855
|
+
breakdownGrid: {
|
|
1856
|
+
flexDirection: 'row',
|
|
1857
|
+
alignItems: 'center',
|
|
1858
|
+
backgroundColor: AppColors.white,
|
|
1859
|
+
borderRadius: 6,
|
|
1860
|
+
padding: 6,
|
|
1861
|
+
borderWidth: 1,
|
|
1862
|
+
borderColor: AppColors.dividerColor,
|
|
1863
|
+
justifyContent: 'space-between',
|
|
1864
|
+
},
|
|
1865
|
+
breakdownCol: {
|
|
1866
|
+
alignItems: 'center',
|
|
1867
|
+
flex: 1,
|
|
1868
|
+
},
|
|
1869
|
+
breakdownLabel: {
|
|
1870
|
+
fontFamily: AppFonts.interRegular,
|
|
1871
|
+
fontSize: 9,
|
|
1872
|
+
color: AppColors.grayTextWeak,
|
|
1873
|
+
},
|
|
1874
|
+
breakdownVal: {
|
|
1875
|
+
fontFamily: AppFonts.interBold,
|
|
1876
|
+
fontSize: 11,
|
|
1877
|
+
color: AppColors.primaryBlack,
|
|
1878
|
+
marginTop: 1,
|
|
1879
|
+
},
|
|
1880
|
+
adviceCard: {
|
|
1881
|
+
backgroundColor: AppColors.purpleTintBg,
|
|
1882
|
+
borderRadius: 6,
|
|
1883
|
+
padding: 6,
|
|
1884
|
+
borderWidth: 1,
|
|
1885
|
+
borderColor: AppColors.purpleBorder,
|
|
1886
|
+
},
|
|
1887
|
+
adviceHeading: {
|
|
1888
|
+
fontFamily: AppFonts.interBold,
|
|
1889
|
+
fontSize: 10,
|
|
1890
|
+
color: AppColors.purpleShade700,
|
|
1891
|
+
},
|
|
1892
|
+
adviceBodyText: {
|
|
1893
|
+
fontFamily: AppFonts.interRegular,
|
|
1894
|
+
fontSize: 10.5,
|
|
1895
|
+
color: AppColors.purple,
|
|
1896
|
+
lineHeight: 14,
|
|
1897
|
+
marginTop: 1,
|
|
1898
|
+
},
|
|
1899
|
+
searchHighlight: {
|
|
1900
|
+
backgroundColor: AppColors.yellowHighlight,
|
|
1901
|
+
color: AppColors.amber800,
|
|
1902
|
+
fontFamily: AppFonts.interBold,
|
|
1903
|
+
},
|
|
1904
|
+
emptyCard: {
|
|
1905
|
+
backgroundColor: AppColors.white,
|
|
1906
|
+
borderRadius: 12,
|
|
1907
|
+
padding: 24,
|
|
1908
|
+
alignItems: 'center',
|
|
1909
|
+
justifyContent: 'center',
|
|
1910
|
+
gap: 8,
|
|
1911
|
+
borderWidth: 1,
|
|
1912
|
+
borderColor: AppColors.dividerColor,
|
|
1913
|
+
},
|
|
1914
|
+
emptyTitle: {
|
|
1915
|
+
fontFamily: AppFonts.interBold,
|
|
1916
|
+
fontSize: 14,
|
|
1917
|
+
color: AppColors.primaryBlack,
|
|
1918
|
+
},
|
|
1919
|
+
emptySub: {
|
|
1920
|
+
fontFamily: AppFonts.interRegular,
|
|
1921
|
+
fontSize: 11.5,
|
|
1922
|
+
color: AppColors.grayTextWeak,
|
|
1923
|
+
textAlign: 'center',
|
|
1924
|
+
lineHeight: 16,
|
|
1925
|
+
},
|
|
1926
|
+
});
|
|
1927
|
+
|
|
1928
|
+
export default PerformanceTab;
|