@buoy-gg/highlight-updates 3.0.0 → 3.0.2
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/lib/commonjs/highlight-updates/HighlightUpdatesOverlay.js +285 -1
- package/lib/commonjs/highlight-updates/components/HighlightFilterView.js +1371 -1
- package/lib/commonjs/highlight-updates/components/HighlightUpdatesModal.js +564 -1
- package/lib/commonjs/highlight-updates/components/IdentifierBadge.js +267 -1
- package/lib/commonjs/highlight-updates/components/IsolatedRenderList.js +178 -1
- package/lib/commonjs/highlight-updates/components/ModalHeaderContent.js +309 -1
- package/lib/commonjs/highlight-updates/components/RenderCauseBadge.js +500 -1
- package/lib/commonjs/highlight-updates/components/RenderDetailView.js +803 -1
- package/lib/commonjs/highlight-updates/components/RenderHistoryViewer.js +894 -1
- package/lib/commonjs/highlight-updates/components/RenderListItem.js +220 -1
- package/lib/commonjs/highlight-updates/components/RendersCopySettingsView.js +562 -1
- package/lib/commonjs/highlight-updates/components/StatsDisplay.js +70 -1
- package/lib/commonjs/highlight-updates/components/index.js +97 -1
- package/lib/commonjs/highlight-updates/types/copySettings.js +107 -1
- package/lib/commonjs/highlight-updates/utils/HighlightUpdatesController.js +1819 -1
- package/lib/commonjs/highlight-updates/utils/PerformanceLogger.js +359 -1
- package/lib/commonjs/highlight-updates/utils/ProfilerInterceptor.js +371 -1
- package/lib/commonjs/highlight-updates/utils/RenderCauseDetector.js +1828 -1
- package/lib/commonjs/highlight-updates/utils/RenderTracker.js +919 -1
- package/lib/commonjs/highlight-updates/utils/ViewTypeMapper.js +264 -1
- package/lib/commonjs/highlight-updates/utils/copySettingsStorage.js +49 -1
- package/lib/commonjs/highlight-updates/utils/renderExportFormatter.js +58 -1
- package/lib/commonjs/highlight-updates/utils/rendersExportFormatter.js +485 -1
- package/lib/commonjs/index.js +320 -1
- package/lib/commonjs/preset.js +278 -1
- package/lib/commonjs/sync/highlightUpdatesSyncAdapter.js +83 -0
- package/lib/module/highlight-updates/HighlightUpdatesOverlay.js +278 -1
- package/lib/module/highlight-updates/components/HighlightFilterView.js +1365 -1
- package/lib/module/highlight-updates/components/HighlightUpdatesModal.js +558 -1
- package/lib/module/highlight-updates/components/IdentifierBadge.js +259 -1
- package/lib/module/highlight-updates/components/IsolatedRenderList.js +174 -1
- package/lib/module/highlight-updates/components/ModalHeaderContent.js +304 -1
- package/lib/module/highlight-updates/components/RenderCauseBadge.js +491 -1
- package/lib/module/highlight-updates/components/RenderDetailView.js +797 -1
- package/lib/module/highlight-updates/components/RenderHistoryViewer.js +888 -1
- package/lib/module/highlight-updates/components/RenderListItem.js +215 -1
- package/lib/module/highlight-updates/components/RendersCopySettingsView.js +558 -1
- package/lib/module/highlight-updates/components/StatsDisplay.js +67 -1
- package/lib/module/highlight-updates/components/index.js +16 -1
- package/lib/module/highlight-updates/types/copySettings.js +102 -1
- package/lib/module/highlight-updates/utils/HighlightUpdatesController.js +1815 -1
- package/lib/module/highlight-updates/utils/PerformanceLogger.js +353 -1
- package/lib/module/highlight-updates/utils/ProfilerInterceptor.js +358 -1
- package/lib/module/highlight-updates/utils/RenderCauseDetector.js +1818 -1
- package/lib/module/highlight-updates/utils/RenderTracker.js +916 -1
- package/lib/module/highlight-updates/utils/ViewTypeMapper.js +255 -1
- package/lib/module/highlight-updates/utils/copySettingsStorage.js +43 -1
- package/lib/module/highlight-updates/utils/renderExportFormatter.js +54 -1
- package/lib/module/highlight-updates/utils/rendersExportFormatter.js +478 -1
- package/lib/module/index.js +74 -1
- package/lib/module/preset.js +272 -1
- package/lib/module/sync/highlightUpdatesSyncAdapter.js +78 -0
- package/lib/typescript/highlight-updates/HighlightUpdatesOverlay.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/HighlightFilterView.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/HighlightUpdatesModal.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/IdentifierBadge.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/IsolatedRenderList.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/ModalHeaderContent.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RenderCauseBadge.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RenderDetailView.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RenderHistoryViewer.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RenderListItem.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RendersCopySettingsView.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/StatsDisplay.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/index.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/types/copySettings.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts +90 -0
- package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/PerformanceLogger.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/ProfilerInterceptor.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/RenderCauseDetector.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/RenderTracker.d.ts +10 -0
- package/lib/typescript/highlight-updates/utils/RenderTracker.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/ViewTypeMapper.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/copySettingsStorage.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/renderExportFormatter.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/rendersExportFormatter.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/preset.d.ts.map +1 -0
- package/lib/typescript/sync/highlightUpdatesSyncAdapter.d.ts +36 -0
- package/lib/typescript/sync/highlightUpdatesSyncAdapter.d.ts.map +1 -0
- package/package.json +7 -7
|
@@ -1 +1,558 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* RendersCopySettingsView
|
|
5
|
+
*
|
|
6
|
+
* Settings UI for configuring render report export.
|
|
7
|
+
* Mirrors EventsCopySettingsView but with renders-specific options.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
11
|
+
import { Text, StyleSheet, ScrollView, View, TouchableOpacity } from "react-native";
|
|
12
|
+
import { DynamicFilterView, macOSColors, FileText, FileCode, Zap, Settings, Eye, ChevronDown, ChevronUp, AlertTriangle, Layers, ToolbarCopyButton } from "@buoy-gg/shared-ui";
|
|
13
|
+
import { DEFAULT_COPY_SETTINGS, COPY_PRESETS, PRESET_METADATA, detectActivePreset } from "../types/copySettings";
|
|
14
|
+
import { generateExport, estimateExportSize, getExportSummary } from "../utils/rendersExportFormatter";
|
|
15
|
+
import { loadCopySettings, saveCopySettings } from "../utils/copySettingsStorage";
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
+
const SIZE_WARNING_THRESHOLD = 50 * 1024;
|
|
18
|
+
const SIZE_DANGER_THRESHOLD = 200 * 1024;
|
|
19
|
+
const CAUSE_OPTIONS = [{
|
|
20
|
+
value: "mount",
|
|
21
|
+
label: "Mount"
|
|
22
|
+
}, {
|
|
23
|
+
value: "props",
|
|
24
|
+
label: "Props"
|
|
25
|
+
}, {
|
|
26
|
+
value: "hooks",
|
|
27
|
+
label: "Hooks"
|
|
28
|
+
}, {
|
|
29
|
+
value: "state",
|
|
30
|
+
label: "State"
|
|
31
|
+
}, {
|
|
32
|
+
value: "parent",
|
|
33
|
+
label: "Parent"
|
|
34
|
+
}, {
|
|
35
|
+
value: "context",
|
|
36
|
+
label: "Context"
|
|
37
|
+
}, {
|
|
38
|
+
value: "unknown",
|
|
39
|
+
label: "Unknown"
|
|
40
|
+
}];
|
|
41
|
+
function formatBytes(bytes) {
|
|
42
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
43
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
44
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
45
|
+
}
|
|
46
|
+
function createMockRenders() {
|
|
47
|
+
const now = Date.now();
|
|
48
|
+
return [{
|
|
49
|
+
id: "1",
|
|
50
|
+
nativeTag: 1,
|
|
51
|
+
viewType: "RCTView",
|
|
52
|
+
displayName: "View",
|
|
53
|
+
componentName: "PokemonListItem",
|
|
54
|
+
renderCount: 30,
|
|
55
|
+
firstRenderTime: now - 5000,
|
|
56
|
+
lastRenderTime: now,
|
|
57
|
+
color: "#10B981",
|
|
58
|
+
lastRenderCause: {
|
|
59
|
+
type: "parent",
|
|
60
|
+
timestamp: now,
|
|
61
|
+
componentCause: "parent"
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
id: "2",
|
|
65
|
+
nativeTag: 2,
|
|
66
|
+
viewType: "RCTView",
|
|
67
|
+
displayName: "View",
|
|
68
|
+
componentName: "CartHeader",
|
|
69
|
+
renderCount: 12,
|
|
70
|
+
firstRenderTime: now - 4000,
|
|
71
|
+
lastRenderTime: now,
|
|
72
|
+
color: "#3B82F6",
|
|
73
|
+
lastRenderCause: {
|
|
74
|
+
type: "hooks",
|
|
75
|
+
timestamp: now,
|
|
76
|
+
componentCause: "state",
|
|
77
|
+
hookChanges: [{
|
|
78
|
+
type: "useState",
|
|
79
|
+
index: 2,
|
|
80
|
+
previousValue: 4,
|
|
81
|
+
currentValue: 5
|
|
82
|
+
}]
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
85
|
+
id: "3",
|
|
86
|
+
nativeTag: 3,
|
|
87
|
+
viewType: "RCTView",
|
|
88
|
+
displayName: "View",
|
|
89
|
+
componentName: "SearchBar",
|
|
90
|
+
renderCount: 8,
|
|
91
|
+
firstRenderTime: now - 3000,
|
|
92
|
+
lastRenderTime: now,
|
|
93
|
+
color: "#F59E0B",
|
|
94
|
+
lastRenderCause: {
|
|
95
|
+
type: "props",
|
|
96
|
+
timestamp: now,
|
|
97
|
+
componentCause: "props",
|
|
98
|
+
changedKeys: ["query", "onChange"]
|
|
99
|
+
}
|
|
100
|
+
}];
|
|
101
|
+
}
|
|
102
|
+
export function RendersCopySettingsView({
|
|
103
|
+
renders
|
|
104
|
+
}) {
|
|
105
|
+
const [settings, setSettings] = useState(DEFAULT_COPY_SETTINGS);
|
|
106
|
+
const [isPreviewExpanded, setIsPreviewExpanded] = useState(false);
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
let mounted = true;
|
|
109
|
+
loadCopySettings().then(saved => {
|
|
110
|
+
if (mounted && saved) setSettings(saved);
|
|
111
|
+
});
|
|
112
|
+
return () => {
|
|
113
|
+
mounted = false;
|
|
114
|
+
};
|
|
115
|
+
}, []);
|
|
116
|
+
const updateSettings = useCallback(next => {
|
|
117
|
+
setSettings(next);
|
|
118
|
+
saveCopySettings(next);
|
|
119
|
+
}, []);
|
|
120
|
+
const hasLiveData = renders.length > 0;
|
|
121
|
+
const previewRenders = hasLiveData ? renders : createMockRenders();
|
|
122
|
+
const activePreset = useMemo(() => detectActivePreset(settings), [settings]);
|
|
123
|
+
const estimatedSize = useMemo(() => estimateExportSize(previewRenders, settings), [previewRenders, settings]);
|
|
124
|
+
const sizeWarningLevel = useMemo(() => {
|
|
125
|
+
if (estimatedSize >= SIZE_DANGER_THRESHOLD) return "danger";
|
|
126
|
+
if (estimatedSize >= SIZE_WARNING_THRESHOLD) return "warning";
|
|
127
|
+
return "none";
|
|
128
|
+
}, [estimatedSize]);
|
|
129
|
+
const generateCopyText = useCallback(() => generateExport(previewRenders, settings), [previewRenders, settings]);
|
|
130
|
+
const applyPreset = useCallback(name => {
|
|
131
|
+
const preset = COPY_PRESETS[name];
|
|
132
|
+
updateSettings({
|
|
133
|
+
...preset,
|
|
134
|
+
filterCauses: [...preset.filterCauses]
|
|
135
|
+
});
|
|
136
|
+
}, [updateSettings]);
|
|
137
|
+
const handleOptionChange = useCallback((optionId, value) => {
|
|
138
|
+
const [group, key] = optionId.split("::");
|
|
139
|
+
if (group === "preset") {
|
|
140
|
+
applyPreset(key);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (group === "format") {
|
|
144
|
+
updateSettings({
|
|
145
|
+
...settings,
|
|
146
|
+
format: value
|
|
147
|
+
});
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (group === "sort") {
|
|
151
|
+
updateSettings({
|
|
152
|
+
...settings,
|
|
153
|
+
sortBy: value
|
|
154
|
+
});
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
if (group === "topN") {
|
|
158
|
+
updateSettings({
|
|
159
|
+
...settings,
|
|
160
|
+
topN: value
|
|
161
|
+
});
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (group === "minRenders") {
|
|
165
|
+
updateSettings({
|
|
166
|
+
...settings,
|
|
167
|
+
minRenders: value
|
|
168
|
+
});
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (group === "cause") {
|
|
172
|
+
const cause = value;
|
|
173
|
+
const has = settings.filterCauses.includes(cause);
|
|
174
|
+
updateSettings({
|
|
175
|
+
...settings,
|
|
176
|
+
filterCauses: has ? settings.filterCauses.filter(c => c !== cause) : [...settings.filterCauses, cause]
|
|
177
|
+
});
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
if (group === "signal") {
|
|
181
|
+
const k = key;
|
|
182
|
+
updateSettings({
|
|
183
|
+
...settings,
|
|
184
|
+
[k]: !settings[k]
|
|
185
|
+
});
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
}, [settings, updateSettings, applyPreset]);
|
|
189
|
+
const renderPreviewContent = useCallback(() => {
|
|
190
|
+
const {
|
|
191
|
+
totalComponents,
|
|
192
|
+
totalRenders
|
|
193
|
+
} = getExportSummary(previewRenders);
|
|
194
|
+
if (!isPreviewExpanded) {
|
|
195
|
+
const warningColor = sizeWarningLevel === "danger" ? macOSColors.semantic.error : sizeWarningLevel === "warning" ? macOSColors.semantic.warning : macOSColors.text.secondary;
|
|
196
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
197
|
+
style: styles.collapsedPreview,
|
|
198
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
199
|
+
style: styles.expandButton,
|
|
200
|
+
onPress: () => setIsPreviewExpanded(true),
|
|
201
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
202
|
+
style: styles.expandButtonContent,
|
|
203
|
+
children: [/*#__PURE__*/_jsx(Eye, {
|
|
204
|
+
size: 16,
|
|
205
|
+
color: macOSColors.semantic.info
|
|
206
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
207
|
+
style: styles.expandButtonTextContainer,
|
|
208
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
209
|
+
style: styles.expandButtonTitle,
|
|
210
|
+
children: "Show Preview"
|
|
211
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
|
212
|
+
style: styles.expandButtonSubtitle,
|
|
213
|
+
children: [totalComponents, " component", totalComponents !== 1 ? "s" : "", " \xB7 ", totalRenders, " renders \xB7 ~", formatBytes(estimatedSize), !hasLiveData ? " (mock data)" : ""]
|
|
214
|
+
})]
|
|
215
|
+
}), /*#__PURE__*/_jsx(ChevronDown, {
|
|
216
|
+
size: 16,
|
|
217
|
+
color: macOSColors.text.muted
|
|
218
|
+
})]
|
|
219
|
+
})
|
|
220
|
+
}), sizeWarningLevel !== "none" && /*#__PURE__*/_jsxs(View, {
|
|
221
|
+
style: [styles.sizeWarning, sizeWarningLevel === "danger" && styles.sizeWarningDanger],
|
|
222
|
+
children: [/*#__PURE__*/_jsx(AlertTriangle, {
|
|
223
|
+
size: 12,
|
|
224
|
+
color: warningColor
|
|
225
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
226
|
+
style: [styles.sizeWarningText, {
|
|
227
|
+
color: warningColor
|
|
228
|
+
}],
|
|
229
|
+
children: sizeWarningLevel === "danger" ? "Very large payload — try a smaller topN or turn off history" : "Large payload — preview may be slow"
|
|
230
|
+
})]
|
|
231
|
+
})]
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
const exportText = generateCopyText();
|
|
235
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
236
|
+
children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
237
|
+
style: styles.collapseButton,
|
|
238
|
+
onPress: () => setIsPreviewExpanded(false),
|
|
239
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
240
|
+
style: styles.collapseButtonText,
|
|
241
|
+
children: "Hide Preview"
|
|
242
|
+
}), /*#__PURE__*/_jsx(ChevronUp, {
|
|
243
|
+
size: 14,
|
|
244
|
+
color: macOSColors.text.secondary
|
|
245
|
+
})]
|
|
246
|
+
}), /*#__PURE__*/_jsx(ScrollView, {
|
|
247
|
+
style: styles.previewScroll,
|
|
248
|
+
nestedScrollEnabled: true,
|
|
249
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
250
|
+
style: styles.previewText,
|
|
251
|
+
selectable: true,
|
|
252
|
+
children: exportText
|
|
253
|
+
})
|
|
254
|
+
})]
|
|
255
|
+
});
|
|
256
|
+
}, [isPreviewExpanded, previewRenders, estimatedSize, sizeWarningLevel, hasLiveData, generateCopyText]);
|
|
257
|
+
const renderPreviewHeaderActions = useCallback(() => {
|
|
258
|
+
const {
|
|
259
|
+
totalComponents
|
|
260
|
+
} = getExportSummary(previewRenders);
|
|
261
|
+
const statusLabel = hasLiveData ? `${totalComponents} components` : "Mock data (no renders captured)";
|
|
262
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
263
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
264
|
+
style: styles.statusLabel,
|
|
265
|
+
children: statusLabel
|
|
266
|
+
}), /*#__PURE__*/_jsx(ToolbarCopyButton, {
|
|
267
|
+
value: generateCopyText
|
|
268
|
+
})]
|
|
269
|
+
});
|
|
270
|
+
}, [hasLiveData, previewRenders, generateCopyText]);
|
|
271
|
+
const dynamicFilterConfig = useMemo(() => ({
|
|
272
|
+
sections: [{
|
|
273
|
+
id: "presets",
|
|
274
|
+
title: "Presets",
|
|
275
|
+
type: "custom",
|
|
276
|
+
data: [{
|
|
277
|
+
id: "preset::llm",
|
|
278
|
+
label: PRESET_METADATA.llm.label,
|
|
279
|
+
icon: Zap,
|
|
280
|
+
color: PRESET_METADATA.llm.color,
|
|
281
|
+
value: "llm",
|
|
282
|
+
isActive: activePreset === "llm",
|
|
283
|
+
description: PRESET_METADATA.llm.description
|
|
284
|
+
}, {
|
|
285
|
+
id: "preset::table",
|
|
286
|
+
label: PRESET_METADATA.table.label,
|
|
287
|
+
icon: FileText,
|
|
288
|
+
color: PRESET_METADATA.table.color,
|
|
289
|
+
value: "table",
|
|
290
|
+
isActive: activePreset === "table",
|
|
291
|
+
description: PRESET_METADATA.table.description
|
|
292
|
+
}, {
|
|
293
|
+
id: "preset::json",
|
|
294
|
+
label: PRESET_METADATA.json.label,
|
|
295
|
+
icon: FileCode,
|
|
296
|
+
color: PRESET_METADATA.json.color,
|
|
297
|
+
value: "json",
|
|
298
|
+
isActive: activePreset === "json",
|
|
299
|
+
description: PRESET_METADATA.json.description
|
|
300
|
+
}, {
|
|
301
|
+
id: "preset::full",
|
|
302
|
+
label: PRESET_METADATA.full.label,
|
|
303
|
+
icon: Layers,
|
|
304
|
+
color: PRESET_METADATA.full.color,
|
|
305
|
+
value: "full",
|
|
306
|
+
isActive: activePreset === "full",
|
|
307
|
+
description: PRESET_METADATA.full.description
|
|
308
|
+
}, {
|
|
309
|
+
id: "preset::custom",
|
|
310
|
+
label: "Custom",
|
|
311
|
+
icon: Settings,
|
|
312
|
+
color: macOSColors.text.secondary,
|
|
313
|
+
value: "custom",
|
|
314
|
+
isActive: activePreset === null,
|
|
315
|
+
description: "User-configured"
|
|
316
|
+
}]
|
|
317
|
+
}, {
|
|
318
|
+
id: "format",
|
|
319
|
+
title: "Format",
|
|
320
|
+
type: "custom",
|
|
321
|
+
data: [{
|
|
322
|
+
id: "format::summary",
|
|
323
|
+
label: "Summary",
|
|
324
|
+
icon: Zap,
|
|
325
|
+
color: macOSColors.semantic.success,
|
|
326
|
+
value: "summary",
|
|
327
|
+
isActive: settings.format === "summary",
|
|
328
|
+
description: "Compact, LLM-ready"
|
|
329
|
+
}, {
|
|
330
|
+
id: "format::markdown-table",
|
|
331
|
+
label: "Table",
|
|
332
|
+
icon: FileText,
|
|
333
|
+
color: macOSColors.semantic.info,
|
|
334
|
+
value: "markdown-table",
|
|
335
|
+
isActive: settings.format === "markdown-table",
|
|
336
|
+
description: "Markdown table"
|
|
337
|
+
}, {
|
|
338
|
+
id: "format::json",
|
|
339
|
+
label: "JSON",
|
|
340
|
+
icon: FileCode,
|
|
341
|
+
color: macOSColors.semantic.warning,
|
|
342
|
+
value: "json",
|
|
343
|
+
isActive: settings.format === "json",
|
|
344
|
+
description: "Structured data"
|
|
345
|
+
}]
|
|
346
|
+
}, {
|
|
347
|
+
id: "sort",
|
|
348
|
+
title: "Sort By",
|
|
349
|
+
type: "custom",
|
|
350
|
+
data: [{
|
|
351
|
+
id: "sort::renderCount",
|
|
352
|
+
label: "Count",
|
|
353
|
+
value: "renderCount",
|
|
354
|
+
isActive: settings.sortBy === "renderCount",
|
|
355
|
+
description: "Total renders"
|
|
356
|
+
}, {
|
|
357
|
+
id: "sort::rate",
|
|
358
|
+
label: "Rate",
|
|
359
|
+
value: "rate",
|
|
360
|
+
isActive: settings.sortBy === "rate",
|
|
361
|
+
description: "Renders / sec"
|
|
362
|
+
}, {
|
|
363
|
+
id: "sort::name",
|
|
364
|
+
label: "Name",
|
|
365
|
+
value: "name",
|
|
366
|
+
isActive: settings.sortBy === "name",
|
|
367
|
+
description: "Alphabetical"
|
|
368
|
+
}]
|
|
369
|
+
}, {
|
|
370
|
+
id: "topN",
|
|
371
|
+
title: "Top N",
|
|
372
|
+
type: "custom",
|
|
373
|
+
data: [{
|
|
374
|
+
id: "topN::10",
|
|
375
|
+
label: "10",
|
|
376
|
+
value: 10,
|
|
377
|
+
isActive: settings.topN === 10
|
|
378
|
+
}, {
|
|
379
|
+
id: "topN::25",
|
|
380
|
+
label: "25",
|
|
381
|
+
value: 25,
|
|
382
|
+
isActive: settings.topN === 25
|
|
383
|
+
}, {
|
|
384
|
+
id: "topN::50",
|
|
385
|
+
label: "50",
|
|
386
|
+
value: 50,
|
|
387
|
+
isActive: settings.topN === 50
|
|
388
|
+
}, {
|
|
389
|
+
id: "topN::100",
|
|
390
|
+
label: "100",
|
|
391
|
+
value: 100,
|
|
392
|
+
isActive: settings.topN === 100
|
|
393
|
+
}, {
|
|
394
|
+
id: "topN::-1",
|
|
395
|
+
label: "All",
|
|
396
|
+
value: -1,
|
|
397
|
+
isActive: settings.topN === -1
|
|
398
|
+
}]
|
|
399
|
+
}, {
|
|
400
|
+
id: "minRenders",
|
|
401
|
+
title: "Min Renders",
|
|
402
|
+
type: "custom",
|
|
403
|
+
data: [{
|
|
404
|
+
id: "minRenders::1",
|
|
405
|
+
label: "1",
|
|
406
|
+
value: 1,
|
|
407
|
+
isActive: settings.minRenders === 1
|
|
408
|
+
}, {
|
|
409
|
+
id: "minRenders::2",
|
|
410
|
+
label: "2",
|
|
411
|
+
value: 2,
|
|
412
|
+
isActive: settings.minRenders === 2
|
|
413
|
+
}, {
|
|
414
|
+
id: "minRenders::3",
|
|
415
|
+
label: "3",
|
|
416
|
+
value: 3,
|
|
417
|
+
isActive: settings.minRenders === 3
|
|
418
|
+
}, {
|
|
419
|
+
id: "minRenders::5",
|
|
420
|
+
label: "5",
|
|
421
|
+
value: 5,
|
|
422
|
+
isActive: settings.minRenders === 5
|
|
423
|
+
}, {
|
|
424
|
+
id: "minRenders::10",
|
|
425
|
+
label: "10",
|
|
426
|
+
value: 10,
|
|
427
|
+
isActive: settings.minRenders === 10
|
|
428
|
+
}]
|
|
429
|
+
}, {
|
|
430
|
+
id: "causes",
|
|
431
|
+
title: "Filter Causes",
|
|
432
|
+
type: "custom",
|
|
433
|
+
description: settings.filterCauses.length === 0 ? "All causes shown" : "Only the selected causes shown",
|
|
434
|
+
data: CAUSE_OPTIONS.map(opt => ({
|
|
435
|
+
id: `cause::${opt.value}`,
|
|
436
|
+
label: opt.label,
|
|
437
|
+
value: opt.value,
|
|
438
|
+
isActive: settings.filterCauses.includes(opt.value)
|
|
439
|
+
}))
|
|
440
|
+
}, {
|
|
441
|
+
id: "signal",
|
|
442
|
+
title: "Signal Extraction",
|
|
443
|
+
type: "custom",
|
|
444
|
+
data: [{
|
|
445
|
+
id: "signal::groupByName",
|
|
446
|
+
label: "Group by name",
|
|
447
|
+
value: "groupByName",
|
|
448
|
+
isActive: settings.groupByName,
|
|
449
|
+
description: "Collapse list items"
|
|
450
|
+
}, {
|
|
451
|
+
id: "signal::aggregateCauses",
|
|
452
|
+
label: "Aggregate causes",
|
|
453
|
+
value: "aggregateCauses",
|
|
454
|
+
isActive: settings.aggregateCauses,
|
|
455
|
+
description: "Hook x N"
|
|
456
|
+
}, {
|
|
457
|
+
id: "signal::includeHistory",
|
|
458
|
+
label: "Include history",
|
|
459
|
+
value: "includeHistory",
|
|
460
|
+
isActive: settings.includeHistory,
|
|
461
|
+
description: "JSON only — large"
|
|
462
|
+
}]
|
|
463
|
+
}],
|
|
464
|
+
previewSection: {
|
|
465
|
+
enabled: true,
|
|
466
|
+
title: "PREVIEW",
|
|
467
|
+
icon: Eye,
|
|
468
|
+
content: renderPreviewContent,
|
|
469
|
+
headerActions: renderPreviewHeaderActions
|
|
470
|
+
},
|
|
471
|
+
onFilterChange: handleOptionChange
|
|
472
|
+
}), [settings, activePreset, handleOptionChange, renderPreviewContent, renderPreviewHeaderActions]);
|
|
473
|
+
return /*#__PURE__*/_jsx(DynamicFilterView, {
|
|
474
|
+
...dynamicFilterConfig
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
const styles = StyleSheet.create({
|
|
478
|
+
collapsedPreview: {
|
|
479
|
+
gap: 8
|
|
480
|
+
},
|
|
481
|
+
expandButton: {
|
|
482
|
+
backgroundColor: macOSColors.background.input,
|
|
483
|
+
borderRadius: 8,
|
|
484
|
+
borderWidth: 1,
|
|
485
|
+
borderColor: macOSColors.border.default,
|
|
486
|
+
padding: 12
|
|
487
|
+
},
|
|
488
|
+
expandButtonContent: {
|
|
489
|
+
flexDirection: "row",
|
|
490
|
+
alignItems: "center",
|
|
491
|
+
gap: 10
|
|
492
|
+
},
|
|
493
|
+
expandButtonTextContainer: {
|
|
494
|
+
flex: 1
|
|
495
|
+
},
|
|
496
|
+
expandButtonTitle: {
|
|
497
|
+
fontSize: 13,
|
|
498
|
+
fontWeight: "600",
|
|
499
|
+
color: macOSColors.text.primary
|
|
500
|
+
},
|
|
501
|
+
expandButtonSubtitle: {
|
|
502
|
+
fontSize: 11,
|
|
503
|
+
color: macOSColors.text.secondary,
|
|
504
|
+
marginTop: 2
|
|
505
|
+
},
|
|
506
|
+
collapseButton: {
|
|
507
|
+
flexDirection: "row",
|
|
508
|
+
alignItems: "center",
|
|
509
|
+
justifyContent: "center",
|
|
510
|
+
gap: 6,
|
|
511
|
+
paddingVertical: 8,
|
|
512
|
+
marginBottom: 8,
|
|
513
|
+
backgroundColor: macOSColors.background.hover,
|
|
514
|
+
borderRadius: 6,
|
|
515
|
+
borderWidth: 1,
|
|
516
|
+
borderColor: macOSColors.border.default
|
|
517
|
+
},
|
|
518
|
+
collapseButtonText: {
|
|
519
|
+
fontSize: 12,
|
|
520
|
+
fontWeight: "500",
|
|
521
|
+
color: macOSColors.text.secondary
|
|
522
|
+
},
|
|
523
|
+
sizeWarning: {
|
|
524
|
+
flexDirection: "row",
|
|
525
|
+
alignItems: "center",
|
|
526
|
+
gap: 6,
|
|
527
|
+
paddingHorizontal: 10,
|
|
528
|
+
paddingVertical: 6,
|
|
529
|
+
backgroundColor: macOSColors.semantic.warningBackground,
|
|
530
|
+
borderRadius: 6,
|
|
531
|
+
borderWidth: 1,
|
|
532
|
+
borderColor: macOSColors.semantic.warning + "30"
|
|
533
|
+
},
|
|
534
|
+
sizeWarningDanger: {
|
|
535
|
+
backgroundColor: macOSColors.semantic.errorBackground,
|
|
536
|
+
borderColor: macOSColors.semantic.error + "30"
|
|
537
|
+
},
|
|
538
|
+
sizeWarningText: {
|
|
539
|
+
fontSize: 11,
|
|
540
|
+
fontWeight: "500",
|
|
541
|
+
flex: 1
|
|
542
|
+
},
|
|
543
|
+
previewScroll: {
|
|
544
|
+
maxHeight: 360
|
|
545
|
+
},
|
|
546
|
+
previewText: {
|
|
547
|
+
fontFamily: "monospace",
|
|
548
|
+
fontSize: 11,
|
|
549
|
+
color: macOSColors.text.primary,
|
|
550
|
+
lineHeight: 18
|
|
551
|
+
},
|
|
552
|
+
statusLabel: {
|
|
553
|
+
fontSize: 11,
|
|
554
|
+
fontWeight: "600",
|
|
555
|
+
color: macOSColors.text.muted,
|
|
556
|
+
marginRight: 8
|
|
557
|
+
}
|
|
558
|
+
});
|
|
@@ -1 +1,67 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* StatsDisplay
|
|
5
|
+
*
|
|
6
|
+
* Isolated component for displaying render statistics in the header.
|
|
7
|
+
* Subscribes to RenderTracker updates independently so parent header
|
|
8
|
+
* doesn't re-render when stats change.
|
|
9
|
+
*
|
|
10
|
+
* Following the optimization guide: move subscriptions to child components.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import React, { useState, useEffect, memo } from "react";
|
|
14
|
+
import { View, Text, StyleSheet } from "react-native";
|
|
15
|
+
import { Activity, buoyColors } from "@buoy-gg/shared-ui";
|
|
16
|
+
import { RenderTracker } from "../utils/RenderTracker";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Isolated stats display that owns its own subscription.
|
|
20
|
+
* Only this component re-renders when stats change.
|
|
21
|
+
*/
|
|
22
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
function StatsDisplayInner() {
|
|
24
|
+
const [stats, setStats] = useState({
|
|
25
|
+
totalComponents: 0,
|
|
26
|
+
totalRenders: 0
|
|
27
|
+
});
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
const unsubscribe = RenderTracker.subscribe(() => {
|
|
30
|
+
setStats(RenderTracker.getStats());
|
|
31
|
+
});
|
|
32
|
+
return unsubscribe;
|
|
33
|
+
}, []);
|
|
34
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
35
|
+
nativeID: "__rn_buoy__stats-row",
|
|
36
|
+
style: styles.headerChip,
|
|
37
|
+
children: [/*#__PURE__*/_jsx(Activity, {
|
|
38
|
+
size: 12,
|
|
39
|
+
color: buoyColors.primary
|
|
40
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
41
|
+
style: [styles.headerChipValue, {
|
|
42
|
+
color: buoyColors.primary
|
|
43
|
+
}],
|
|
44
|
+
children: stats.totalComponents
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
export const StatsDisplay = /*#__PURE__*/memo(StatsDisplayInner);
|
|
49
|
+
const styles = StyleSheet.create({
|
|
50
|
+
headerChip: {
|
|
51
|
+
flexDirection: "row",
|
|
52
|
+
alignItems: "center",
|
|
53
|
+
gap: 4,
|
|
54
|
+
backgroundColor: buoyColors.hover,
|
|
55
|
+
paddingHorizontal: 8,
|
|
56
|
+
paddingVertical: 5,
|
|
57
|
+
borderRadius: 12,
|
|
58
|
+
borderWidth: 1,
|
|
59
|
+
borderColor: buoyColors.border
|
|
60
|
+
},
|
|
61
|
+
headerChipValue: {
|
|
62
|
+
fontSize: 12,
|
|
63
|
+
fontWeight: "600",
|
|
64
|
+
fontFamily: "monospace"
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
export default StatsDisplay;
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Highlight Updates Modal Components
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export { HighlightUpdatesModal } from "./HighlightUpdatesModal";
|
|
8
|
+
export { RenderListItem } from "./RenderListItem";
|
|
9
|
+
export { RenderDetailView } from "./RenderDetailView";
|
|
10
|
+
export { HighlightFilterView } from "./HighlightFilterView";
|
|
11
|
+
export { IdentifierBadge, CategoryBadge, IDENTIFIER_CONFIG } from "./IdentifierBadge";
|
|
12
|
+
|
|
13
|
+
// Performance-optimized isolated components
|
|
14
|
+
export { IsolatedRenderList } from "./IsolatedRenderList";
|
|
15
|
+
export { StatsDisplay } from "./StatsDisplay";
|
|
16
|
+
export { MainListHeader, FilterViewHeader, DetailViewHeader, HeaderActions, SearchSection } from "./ModalHeaderContent";
|