@buoy-gg/highlight-updates 7.0.35 → 7.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +28 -6
  2. package/lib/commonjs/highlight-updates/HighlightUpdatesOverlay.js +1 -281
  3. package/lib/commonjs/highlight-updates/components/HighlightFilterView.js +1 -1474
  4. package/lib/commonjs/highlight-updates/components/HighlightUpdatesModal.js +1 -641
  5. package/lib/commonjs/highlight-updates/components/IdentifierBadge.js +1 -273
  6. package/lib/commonjs/highlight-updates/components/IsolatedRenderList.js +1 -188
  7. package/lib/commonjs/highlight-updates/components/ModalHeaderContent.js +1 -293
  8. package/lib/commonjs/highlight-updates/components/RenderCauseBadge.js +1 -508
  9. package/lib/commonjs/highlight-updates/components/RenderDetailView.js +1 -846
  10. package/lib/commonjs/highlight-updates/components/RenderHistoryViewer.js +1 -915
  11. package/lib/commonjs/highlight-updates/components/RenderListItem.js +1 -235
  12. package/lib/commonjs/highlight-updates/components/RendersCopySettingsView.js +1 -466
  13. package/lib/commonjs/highlight-updates/components/StatsDisplay.js +1 -73
  14. package/lib/commonjs/highlight-updates/types/copySettings.js +1 -107
  15. package/lib/commonjs/highlight-updates/utils/CommitProfiler.js +1 -446
  16. package/lib/commonjs/highlight-updates/utils/HighlightUpdatesController.js +1 -1920
  17. package/lib/commonjs/highlight-updates/utils/PerformanceLogger.js +1 -359
  18. package/lib/commonjs/highlight-updates/utils/ProfilerInterceptor.js +1 -371
  19. package/lib/commonjs/highlight-updates/utils/RenderCauseDetector.js +1 -1840
  20. package/lib/commonjs/highlight-updates/utils/RenderTracker.js +1 -952
  21. package/lib/commonjs/highlight-updates/utils/ViewTypeMapper.js +1 -264
  22. package/lib/commonjs/highlight-updates/utils/copySettingsStorage.js +1 -32
  23. package/lib/commonjs/highlight-updates/utils/devtoolsComponentNames.js +1 -188
  24. package/lib/commonjs/highlight-updates/utils/namedComposite.js +1 -41
  25. package/lib/commonjs/highlight-updates/utils/ownStateChanged.js +1 -103
  26. package/lib/commonjs/highlight-updates/utils/rawEventEmitter.js +1 -50
  27. package/lib/commonjs/highlight-updates/utils/renderExportFormatter.js +1 -58
  28. package/lib/commonjs/highlight-updates/utils/rendersExportFormatter.js +1 -485
  29. package/lib/commonjs/highlight-updates/utils/screenElements.js +1 -1046
  30. package/lib/commonjs/highlight-updates/utils/tapMatch.js +1 -58
  31. package/lib/commonjs/highlight-updates/utils/testIDs.js +1 -68
  32. package/lib/commonjs/highlight-updates/utils/touchCapture.js +1 -277
  33. package/lib/commonjs/index.js +1 -429
  34. package/lib/commonjs/preset.js +1 -278
  35. package/lib/commonjs/sync/highlightUpdatesSyncAdapter.js +1 -235
  36. package/lib/module/highlight-updates/HighlightUpdatesOverlay.js +1 -274
  37. package/lib/module/highlight-updates/components/HighlightFilterView.js +1 -1468
  38. package/lib/module/highlight-updates/components/HighlightUpdatesModal.js +1 -634
  39. package/lib/module/highlight-updates/components/IdentifierBadge.js +1 -265
  40. package/lib/module/highlight-updates/components/IsolatedRenderList.js +1 -183
  41. package/lib/module/highlight-updates/components/ModalHeaderContent.js +1 -288
  42. package/lib/module/highlight-updates/components/RenderCauseBadge.js +1 -499
  43. package/lib/module/highlight-updates/components/RenderDetailView.js +1 -840
  44. package/lib/module/highlight-updates/components/RenderHistoryViewer.js +1 -908
  45. package/lib/module/highlight-updates/components/RenderListItem.js +1 -230
  46. package/lib/module/highlight-updates/components/RendersCopySettingsView.js +1 -462
  47. package/lib/module/highlight-updates/components/StatsDisplay.js +1 -70
  48. package/lib/module/highlight-updates/types/copySettings.js +1 -102
  49. package/lib/module/highlight-updates/utils/CommitProfiler.js +1 -442
  50. package/lib/module/highlight-updates/utils/HighlightUpdatesController.js +1 -1916
  51. package/lib/module/highlight-updates/utils/PerformanceLogger.js +1 -353
  52. package/lib/module/highlight-updates/utils/ProfilerInterceptor.js +1 -358
  53. package/lib/module/highlight-updates/utils/RenderCauseDetector.js +1 -1830
  54. package/lib/module/highlight-updates/utils/RenderTracker.js +1 -949
  55. package/lib/module/highlight-updates/utils/ViewTypeMapper.js +1 -255
  56. package/lib/module/highlight-updates/utils/copySettingsStorage.js +1 -26
  57. package/lib/module/highlight-updates/utils/devtoolsComponentNames.js +1 -178
  58. package/lib/module/highlight-updates/utils/namedComposite.js +1 -36
  59. package/lib/module/highlight-updates/utils/ownStateChanged.js +1 -98
  60. package/lib/module/highlight-updates/utils/rawEventEmitter.js +1 -46
  61. package/lib/module/highlight-updates/utils/renderExportFormatter.js +1 -54
  62. package/lib/module/highlight-updates/utils/rendersExportFormatter.js +1 -478
  63. package/lib/module/highlight-updates/utils/screenElements.js +1 -1040
  64. package/lib/module/highlight-updates/utils/tapMatch.js +1 -52
  65. package/lib/module/highlight-updates/utils/testIDs.js +1 -60
  66. package/lib/module/highlight-updates/utils/touchCapture.js +1 -270
  67. package/lib/module/index.js +1 -130
  68. package/lib/module/preset.js +1 -272
  69. package/lib/module/sync/highlightUpdatesSyncAdapter.js +1 -230
  70. package/lib/typescript/highlight-updates/utils/screenElements.d.ts +52 -1
  71. package/lib/typescript/highlight-updates/utils/tapMatch.d.ts +11 -0
  72. package/lib/typescript/sync/highlightUpdatesSyncAdapter.d.ts +1 -1
  73. package/package.json +8 -8
  74. package/lib/typescript/highlight-updates/HighlightUpdatesOverlay.d.ts.map +0 -1
  75. package/lib/typescript/highlight-updates/components/HighlightFilterView.d.ts.map +0 -1
  76. package/lib/typescript/highlight-updates/components/HighlightUpdatesModal.d.ts.map +0 -1
  77. package/lib/typescript/highlight-updates/components/IdentifierBadge.d.ts.map +0 -1
  78. package/lib/typescript/highlight-updates/components/IsolatedRenderList.d.ts.map +0 -1
  79. package/lib/typescript/highlight-updates/components/ModalHeaderContent.d.ts.map +0 -1
  80. package/lib/typescript/highlight-updates/components/RenderCauseBadge.d.ts.map +0 -1
  81. package/lib/typescript/highlight-updates/components/RenderDetailView.d.ts.map +0 -1
  82. package/lib/typescript/highlight-updates/components/RenderHistoryViewer.d.ts.map +0 -1
  83. package/lib/typescript/highlight-updates/components/RenderListItem.d.ts.map +0 -1
  84. package/lib/typescript/highlight-updates/components/RendersCopySettingsView.d.ts.map +0 -1
  85. package/lib/typescript/highlight-updates/components/StatsDisplay.d.ts.map +0 -1
  86. package/lib/typescript/highlight-updates/types/copySettings.d.ts.map +0 -1
  87. package/lib/typescript/highlight-updates/utils/CommitProfiler.d.ts.map +0 -1
  88. package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts.map +0 -1
  89. package/lib/typescript/highlight-updates/utils/PerformanceLogger.d.ts.map +0 -1
  90. package/lib/typescript/highlight-updates/utils/ProfilerInterceptor.d.ts.map +0 -1
  91. package/lib/typescript/highlight-updates/utils/RenderCauseDetector.d.ts.map +0 -1
  92. package/lib/typescript/highlight-updates/utils/RenderTracker.d.ts.map +0 -1
  93. package/lib/typescript/highlight-updates/utils/ViewTypeMapper.d.ts.map +0 -1
  94. package/lib/typescript/highlight-updates/utils/copySettingsStorage.d.ts.map +0 -1
  95. package/lib/typescript/highlight-updates/utils/devtoolsComponentNames.d.ts.map +0 -1
  96. package/lib/typescript/highlight-updates/utils/namedComposite.d.ts.map +0 -1
  97. package/lib/typescript/highlight-updates/utils/ownStateChanged.d.ts.map +0 -1
  98. package/lib/typescript/highlight-updates/utils/rawEventEmitter.d.ts.map +0 -1
  99. package/lib/typescript/highlight-updates/utils/renderExportFormatter.d.ts.map +0 -1
  100. package/lib/typescript/highlight-updates/utils/rendersExportFormatter.d.ts.map +0 -1
  101. package/lib/typescript/highlight-updates/utils/screenElements.d.ts.map +0 -1
  102. package/lib/typescript/highlight-updates/utils/tapMatch.d.ts.map +0 -1
  103. package/lib/typescript/highlight-updates/utils/testIDs.d.ts.map +0 -1
  104. package/lib/typescript/highlight-updates/utils/touchCapture.d.ts.map +0 -1
  105. package/lib/typescript/index.d.ts.map +0 -1
  106. package/lib/typescript/preset.d.ts.map +0 -1
  107. package/lib/typescript/sync/highlightUpdatesSyncAdapter.d.ts.map +0 -1
@@ -1,466 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.RendersCopySettingsView = RendersCopySettingsView;
7
- var _react = require("react");
8
- var _reactNative = require("react-native");
9
- var _sharedUi = require("@buoy-gg/shared-ui");
10
- var _copySettings = require("../types/copySettings");
11
- var _rendersExportFormatter = require("../utils/rendersExportFormatter");
12
- var _copySettingsStorage = require("../utils/copySettingsStorage");
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- /**
15
- * RendersCopySettingsView
16
- *
17
- * Settings UI for configuring render report export.
18
- * Mirrors EventsCopySettingsView but with renders-specific options.
19
- */
20
-
21
- const SIZE_WARNING_THRESHOLD = 50 * 1024;
22
- const SIZE_DANGER_THRESHOLD = 200 * 1024;
23
- const CAUSE_OPTIONS = [{
24
- value: "mount",
25
- label: "Mount"
26
- }, {
27
- value: "props",
28
- label: "Props"
29
- }, {
30
- value: "hooks",
31
- label: "Hooks"
32
- }, {
33
- value: "state",
34
- label: "State"
35
- }, {
36
- value: "parent",
37
- label: "Parent"
38
- }, {
39
- value: "context",
40
- label: "Context"
41
- }, {
42
- value: "unknown",
43
- label: "Unknown"
44
- }];
45
- function formatBytes(bytes) {
46
- if (bytes < 1024) return `${bytes} B`;
47
- if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
48
- return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
49
- }
50
- function createMockRenders() {
51
- const now = Date.now();
52
- return [{
53
- id: "1",
54
- nativeTag: 1,
55
- viewType: "RCTView",
56
- displayName: "View",
57
- componentName: "PokemonListItem",
58
- renderCount: 30,
59
- firstRenderTime: now - 5000,
60
- lastRenderTime: now,
61
- color: "#10B981",
62
- lastRenderCause: {
63
- type: "parent",
64
- timestamp: now,
65
- componentCause: "parent"
66
- }
67
- }, {
68
- id: "2",
69
- nativeTag: 2,
70
- viewType: "RCTView",
71
- displayName: "View",
72
- componentName: "CartHeader",
73
- renderCount: 12,
74
- firstRenderTime: now - 4000,
75
- lastRenderTime: now,
76
- color: "#3B82F6",
77
- lastRenderCause: {
78
- type: "hooks",
79
- timestamp: now,
80
- componentCause: "state",
81
- hookChanges: [{
82
- type: "useState",
83
- index: 2,
84
- previousValue: 4,
85
- currentValue: 5
86
- }]
87
- }
88
- }, {
89
- id: "3",
90
- nativeTag: 3,
91
- viewType: "RCTView",
92
- displayName: "View",
93
- componentName: "SearchBar",
94
- renderCount: 8,
95
- firstRenderTime: now - 3000,
96
- lastRenderTime: now,
97
- color: "#F59E0B",
98
- lastRenderCause: {
99
- type: "props",
100
- timestamp: now,
101
- componentCause: "props",
102
- changedKeys: ["query", "onChange"]
103
- }
104
- }];
105
- }
106
- function RendersCopySettingsView({
107
- renders
108
- }) {
109
- const [settings, setSettings] = (0, _react.useState)(_copySettings.DEFAULT_COPY_SETTINGS);
110
- const [isPreviewExpanded, setIsPreviewExpanded] = (0, _react.useState)(false);
111
- (0, _react.useEffect)(() => {
112
- let mounted = true;
113
- (0, _copySettingsStorage.loadCopySettings)().then(saved => {
114
- if (mounted && saved) setSettings(saved);
115
- });
116
- return () => {
117
- mounted = false;
118
- };
119
- }, []);
120
- const updateSettings = (0, _react.useCallback)(next => {
121
- setSettings(next);
122
- (0, _copySettingsStorage.saveCopySettings)(next);
123
- }, []);
124
- const hasLiveData = renders.length > 0;
125
- const previewRenders = hasLiveData ? renders : createMockRenders();
126
- const activePreset = (0, _react.useMemo)(() => (0, _copySettings.detectActivePreset)(settings), [settings]);
127
- const estimatedSize = (0, _react.useMemo)(() => (0, _rendersExportFormatter.estimateExportSize)(previewRenders, settings), [previewRenders, settings]);
128
- const sizeWarningLevel = (0, _react.useMemo)(() => {
129
- if (estimatedSize >= SIZE_DANGER_THRESHOLD) return "danger";
130
- if (estimatedSize >= SIZE_WARNING_THRESHOLD) return "warning";
131
- return "none";
132
- }, [estimatedSize]);
133
- const generateCopyText = (0, _react.useCallback)(() => (0, _rendersExportFormatter.generateExport)(previewRenders, settings), [previewRenders, settings]);
134
- const applyPreset = (0, _react.useCallback)(name => {
135
- const preset = _copySettings.COPY_PRESETS[name];
136
- updateSettings({
137
- ...preset,
138
- filterCauses: [...preset.filterCauses]
139
- });
140
- }, [updateSettings]);
141
- const handleOptionChange = (0, _react.useCallback)((optionId, value) => {
142
- const [group, key] = optionId.split("::");
143
- if (group === "preset") {
144
- applyPreset(key);
145
- return;
146
- }
147
- if (group === "format") {
148
- updateSettings({
149
- ...settings,
150
- format: value
151
- });
152
- return;
153
- }
154
- if (group === "sort") {
155
- updateSettings({
156
- ...settings,
157
- sortBy: value
158
- });
159
- return;
160
- }
161
- if (group === "topN") {
162
- updateSettings({
163
- ...settings,
164
- topN: value
165
- });
166
- return;
167
- }
168
- if (group === "minRenders") {
169
- updateSettings({
170
- ...settings,
171
- minRenders: value
172
- });
173
- return;
174
- }
175
- if (group === "cause") {
176
- const cause = value;
177
- const has = settings.filterCauses.includes(cause);
178
- updateSettings({
179
- ...settings,
180
- filterCauses: has ? settings.filterCauses.filter(c => c !== cause) : [...settings.filterCauses, cause]
181
- });
182
- return;
183
- }
184
- if (group === "signal") {
185
- const k = key;
186
- updateSettings({
187
- ...settings,
188
- [k]: !settings[k]
189
- });
190
- return;
191
- }
192
- }, [settings, updateSettings, applyPreset]);
193
- const renderPreviewContent = (0, _react.useCallback)(() => {
194
- const {
195
- totalComponents,
196
- totalRenders
197
- } = (0, _rendersExportFormatter.getExportSummary)(previewRenders);
198
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ExportPreview, {
199
- expanded: isPreviewExpanded,
200
- onExpandedChange: setIsPreviewExpanded,
201
- summary: `${totalComponents} component${totalComponents !== 1 ? "s" : ""} · ${totalRenders} renders · ~${formatBytes(estimatedSize)}${!hasLiveData ? " (mock data)" : ""}`,
202
- warningLevel: sizeWarningLevel,
203
- warningText: {
204
- warning: "Large payload — preview may be slow",
205
- danger: "Very large payload — try a smaller topN or turn off history"
206
- },
207
- testIDs: {
208
- expand: "buoy-highlight-copy-preview-show",
209
- collapse: "buoy-highlight-copy-preview-hide",
210
- summary: "buoy-highlight-copy-preview-summary",
211
- warning: "buoy-highlight-copy-size-warning"
212
- },
213
- renderBody: () => {
214
- const exportText = generateCopyText();
215
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
216
- testID: "buoy-highlight-copy-preview-scroll",
217
- style: styles.previewScroll,
218
- nestedScrollEnabled: true,
219
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
220
- testID: "buoy-highlight-copy-preview-text",
221
- style: styles.previewText,
222
- selectable: true,
223
- children: exportText
224
- })
225
- });
226
- }
227
- });
228
- }, [isPreviewExpanded, previewRenders, estimatedSize, sizeWarningLevel, hasLiveData, generateCopyText]);
229
- const renderPreviewHeaderActions = (0, _react.useCallback)(() => {
230
- const {
231
- totalComponents
232
- } = (0, _rendersExportFormatter.getExportSummary)(previewRenders);
233
- const statusLabel = hasLiveData ? `${totalComponents} components` : "Mock data (no renders captured)";
234
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
235
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
236
- testID: "buoy-highlight-copy-status",
237
- style: styles.statusLabel,
238
- children: statusLabel
239
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolbarCopyButton, {
240
- value: generateCopyText
241
- })]
242
- });
243
- }, [hasLiveData, previewRenders, generateCopyText]);
244
- const dynamicFilterConfig = (0, _react.useMemo)(() => ({
245
- sections: [{
246
- id: "presets",
247
- title: "Presets",
248
- type: "custom",
249
- data: [{
250
- id: "preset::llm",
251
- label: _copySettings.PRESET_METADATA.llm.label,
252
- icon: _sharedUi.Zap,
253
- color: _copySettings.PRESET_METADATA.llm.color,
254
- value: "llm",
255
- isActive: activePreset === "llm",
256
- description: _copySettings.PRESET_METADATA.llm.description
257
- }, {
258
- id: "preset::table",
259
- label: _copySettings.PRESET_METADATA.table.label,
260
- icon: _sharedUi.FileText,
261
- color: _copySettings.PRESET_METADATA.table.color,
262
- value: "table",
263
- isActive: activePreset === "table",
264
- description: _copySettings.PRESET_METADATA.table.description
265
- }, {
266
- id: "preset::json",
267
- label: _copySettings.PRESET_METADATA.json.label,
268
- icon: _sharedUi.FileCode,
269
- color: _copySettings.PRESET_METADATA.json.color,
270
- value: "json",
271
- isActive: activePreset === "json",
272
- description: _copySettings.PRESET_METADATA.json.description
273
- }, {
274
- id: "preset::full",
275
- label: _copySettings.PRESET_METADATA.full.label,
276
- icon: _sharedUi.Layers,
277
- color: _copySettings.PRESET_METADATA.full.color,
278
- value: "full",
279
- isActive: activePreset === "full",
280
- description: _copySettings.PRESET_METADATA.full.description
281
- }, {
282
- id: "preset::custom",
283
- label: "Custom",
284
- icon: _sharedUi.Settings,
285
- color: _sharedUi.night.color.textSecondary,
286
- value: "custom",
287
- isActive: activePreset === null,
288
- description: "User-configured"
289
- }]
290
- }, {
291
- id: "format",
292
- title: "Format",
293
- type: "custom",
294
- data: [{
295
- id: "format::summary",
296
- label: "Summary",
297
- icon: _sharedUi.Zap,
298
- color: _sharedUi.macOSColors.semantic.success,
299
- value: "summary",
300
- isActive: settings.format === "summary",
301
- description: "Compact, LLM-ready"
302
- }, {
303
- id: "format::markdown-table",
304
- label: "Table",
305
- icon: _sharedUi.FileText,
306
- color: _sharedUi.macOSColors.semantic.info,
307
- value: "markdown-table",
308
- isActive: settings.format === "markdown-table",
309
- description: "Markdown table"
310
- }, {
311
- id: "format::json",
312
- label: "JSON",
313
- icon: _sharedUi.FileCode,
314
- color: _sharedUi.macOSColors.semantic.warning,
315
- value: "json",
316
- isActive: settings.format === "json",
317
- description: "Structured data"
318
- }]
319
- }, {
320
- id: "sort",
321
- title: "Sort By",
322
- type: "custom",
323
- data: [{
324
- id: "sort::renderCount",
325
- label: "Count",
326
- value: "renderCount",
327
- isActive: settings.sortBy === "renderCount",
328
- description: "Total renders"
329
- }, {
330
- id: "sort::rate",
331
- label: "Rate",
332
- value: "rate",
333
- isActive: settings.sortBy === "rate",
334
- description: "Renders / sec"
335
- }, {
336
- id: "sort::name",
337
- label: "Name",
338
- value: "name",
339
- isActive: settings.sortBy === "name",
340
- description: "Alphabetical"
341
- }]
342
- }, {
343
- id: "topN",
344
- title: "Top N",
345
- type: "custom",
346
- data: [{
347
- id: "topN::10",
348
- label: "10",
349
- value: 10,
350
- isActive: settings.topN === 10
351
- }, {
352
- id: "topN::25",
353
- label: "25",
354
- value: 25,
355
- isActive: settings.topN === 25
356
- }, {
357
- id: "topN::50",
358
- label: "50",
359
- value: 50,
360
- isActive: settings.topN === 50
361
- }, {
362
- id: "topN::100",
363
- label: "100",
364
- value: 100,
365
- isActive: settings.topN === 100
366
- }, {
367
- id: "topN::-1",
368
- label: "All",
369
- value: -1,
370
- isActive: settings.topN === -1
371
- }]
372
- }, {
373
- id: "minRenders",
374
- title: "Min Renders",
375
- type: "custom",
376
- data: [{
377
- id: "minRenders::1",
378
- label: "1",
379
- value: 1,
380
- isActive: settings.minRenders === 1
381
- }, {
382
- id: "minRenders::2",
383
- label: "2",
384
- value: 2,
385
- isActive: settings.minRenders === 2
386
- }, {
387
- id: "minRenders::3",
388
- label: "3",
389
- value: 3,
390
- isActive: settings.minRenders === 3
391
- }, {
392
- id: "minRenders::5",
393
- label: "5",
394
- value: 5,
395
- isActive: settings.minRenders === 5
396
- }, {
397
- id: "minRenders::10",
398
- label: "10",
399
- value: 10,
400
- isActive: settings.minRenders === 10
401
- }]
402
- }, {
403
- id: "causes",
404
- title: "Filter Causes",
405
- type: "custom",
406
- description: settings.filterCauses.length === 0 ? "All causes shown" : "Only the selected causes shown",
407
- data: CAUSE_OPTIONS.map(opt => ({
408
- id: `cause::${opt.value}`,
409
- label: opt.label,
410
- value: opt.value,
411
- isActive: settings.filterCauses.includes(opt.value)
412
- }))
413
- }, {
414
- id: "signal",
415
- title: "Signal Extraction",
416
- type: "custom",
417
- data: [{
418
- id: "signal::groupByName",
419
- label: "Group by name",
420
- value: "groupByName",
421
- isActive: settings.groupByName,
422
- description: "Collapse list items"
423
- }, {
424
- id: "signal::aggregateCauses",
425
- label: "Aggregate causes",
426
- value: "aggregateCauses",
427
- isActive: settings.aggregateCauses,
428
- description: "Hook x N"
429
- }, {
430
- id: "signal::includeHistory",
431
- label: "Include history",
432
- value: "includeHistory",
433
- isActive: settings.includeHistory,
434
- description: "JSON only — large"
435
- }]
436
- }],
437
- previewSection: {
438
- enabled: true,
439
- title: "PREVIEW",
440
- icon: _sharedUi.Eye,
441
- content: renderPreviewContent,
442
- headerActions: renderPreviewHeaderActions
443
- },
444
- onFilterChange: handleOptionChange
445
- }), [settings, activePreset, handleOptionChange, renderPreviewContent, renderPreviewHeaderActions]);
446
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.DynamicFilterView, {
447
- ...dynamicFilterConfig
448
- });
449
- }
450
- const styles = _reactNative.StyleSheet.create({
451
- previewScroll: {
452
- maxHeight: 360
453
- },
454
- previewText: {
455
- fontFamily: _sharedUi.monoFont,
456
- fontSize: 11,
457
- color: _sharedUi.night.color.text,
458
- lineHeight: 18
459
- },
460
- statusLabel: {
461
- fontSize: 11,
462
- fontWeight: "600",
463
- color: _sharedUi.night.color.textTertiary,
464
- marginRight: 8
465
- }
466
- });
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RendersCopySettingsView=RendersCopySettingsView;var _react=require("react"),_reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_copySettings=require("../types/copySettings"),_rendersExportFormatter=require("../utils/rendersExportFormatter"),_copySettingsStorage=require("../utils/copySettingsStorage"),_jsxRuntime=require("react/jsx-runtime");const SIZE_WARNING_THRESHOLD=51200,SIZE_DANGER_THRESHOLD=204800,CAUSE_OPTIONS=[{value:"mount",label:"Mount"},{value:"props",label:"Props"},{value:"hooks",label:"Hooks"},{value:"state",label:"State"},{value:"parent",label:"Parent"},{value:"context",label:"Context"},{value:"unknown",label:"Unknown"}];function formatBytes(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function createMockRenders(){const e=Date.now();return[{id:"1",nativeTag:1,viewType:"RCTView",displayName:"View",componentName:"PokemonListItem",renderCount:30,firstRenderTime:e-5e3,lastRenderTime:e,color:"#10B981",lastRenderCause:{type:"parent",timestamp:e,componentCause:"parent"}},{id:"2",nativeTag:2,viewType:"RCTView",displayName:"View",componentName:"CartHeader",renderCount:12,firstRenderTime:e-4e3,lastRenderTime:e,color:"#3B82F6",lastRenderCause:{type:"hooks",timestamp:e,componentCause:"state",hookChanges:[{type:"useState",index:2,previousValue:4,currentValue:5}]}},{id:"3",nativeTag:3,viewType:"RCTView",displayName:"View",componentName:"SearchBar",renderCount:8,firstRenderTime:e-3e3,lastRenderTime:e,color:"#F59E0B",lastRenderCause:{type:"props",timestamp:e,componentCause:"props",changedKeys:["query","onChange"]}}]}function RendersCopySettingsView({renders:e}){const[t,i]=(0,_react.useState)(_copySettings.DEFAULT_COPY_SETTINGS),[a,s]=(0,_react.useState)(!1);(0,_react.useEffect)(()=>{let e=!0;return(0,_copySettingsStorage.loadCopySettings)().then(t=>{e&&t&&i(t)}),()=>{e=!1}},[]);const r=(0,_react.useCallback)(e=>{i(e),(0,_copySettingsStorage.saveCopySettings)(e)},[]),o=e.length>0,l=o?e:createMockRenders(),n=(0,_react.useMemo)(()=>(0,_copySettings.detectActivePreset)(t),[t]),c=(0,_react.useMemo)(()=>(0,_rendersExportFormatter.estimateExportSize)(l,t),[l,t]),d=(0,_react.useMemo)(()=>c>=SIZE_DANGER_THRESHOLD?"danger":c>=SIZE_WARNING_THRESHOLD?"warning":"none",[c]),u=(0,_react.useCallback)(()=>(0,_rendersExportFormatter.generateExport)(l,t),[l,t]),p=(0,_react.useCallback)(e=>{const t=_copySettings.COPY_PRESETS[e];t&&r({...t,filterCauses:[...t.filterCauses]})},[r]),m=(0,_react.useCallback)((e,i)=>{const[a,s]=e.split("::");if("preset"!==a)if("format"!==a)if("sort"!==a)if("topN"!==a)if("minRenders"!==a){if("cause"===a){const e=i,a=t.filterCauses.includes(e);return void r({...t,filterCauses:a?t.filterCauses.filter(t=>t!==e):[...t.filterCauses,e]})}if("signal"===a){const e=s;return void r({...t,[e]:!t[e]})}}else r({...t,minRenders:i});else r({...t,topN:i});else r({...t,sortBy:i});else r({...t,format:i});else p(s)},[t,r,p]),y=(0,_react.useCallback)(()=>{const{totalComponents:e,totalRenders:t}=(0,_rendersExportFormatter.getExportSummary)(l);return(0,_jsxRuntime.jsx)(_sharedUi.ExportPreview,{expanded:a,onExpandedChange:s,summary:`${e} component${1!==e?"s":""} · ${t} renders · ~${formatBytes(c)}${o?"":" (mock data)"}`,warningLevel:d,warningText:{warning:"Large payload — preview may be slow",danger:"Very large payload — try a smaller topN or turn off history"},testIDs:{expand:"buoy-highlight-copy-preview-show",collapse:"buoy-highlight-copy-preview-hide",summary:"buoy-highlight-copy-preview-summary",warning:"buoy-highlight-copy-size-warning"},renderBody:()=>{const e=u();return(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{testID:"buoy-highlight-copy-preview-scroll",style:styles.previewScroll,nestedScrollEnabled:!0,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-highlight-copy-preview-text",style:styles.previewText,selectable:!0,children:e})})}})},[a,l,c,d,o,u]),g=(0,_react.useCallback)(()=>{const{totalComponents:e}=(0,_rendersExportFormatter.getExportSummary)(l),t=o?`${e} components`:"Mock data (no renders captured)";return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-highlight-copy-status",style:styles.statusLabel,children:t}),(0,_jsxRuntime.jsx)(_sharedUi.ToolbarCopyButton,{value:u})]})},[o,l,u]),_=(0,_react.useMemo)(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::llm",label:_copySettings.PRESET_METADATA.llm.label,icon:_sharedUi.Zap,color:_copySettings.PRESET_METADATA.llm.color,value:"llm",isActive:"llm"===n,description:_copySettings.PRESET_METADATA.llm.description},{id:"preset::table",label:_copySettings.PRESET_METADATA.table.label,icon:_sharedUi.FileText,color:_copySettings.PRESET_METADATA.table.color,value:"table",isActive:"table"===n,description:_copySettings.PRESET_METADATA.table.description},{id:"preset::json",label:_copySettings.PRESET_METADATA.json.label,icon:_sharedUi.FileCode,color:_copySettings.PRESET_METADATA.json.color,value:"json",isActive:"json"===n,description:_copySettings.PRESET_METADATA.json.description},{id:"preset::full",label:_copySettings.PRESET_METADATA.full.label,icon:_sharedUi.Layers,color:_copySettings.PRESET_METADATA.full.color,value:"full",isActive:"full"===n,description:_copySettings.PRESET_METADATA.full.description},{id:"preset::custom",label:"Custom",icon:_sharedUi.Settings,color:_sharedUi.night.color.textSecondary,value:"custom",isActive:null===n,description:"User-configured"}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::summary",label:"Summary",icon:_sharedUi.Zap,color:_sharedUi.macOSColors.semantic.success,value:"summary",isActive:"summary"===t.format,description:"Compact, LLM-ready"},{id:"format::markdown-table",label:"Table",icon:_sharedUi.FileText,color:_sharedUi.macOSColors.semantic.info,value:"markdown-table",isActive:"markdown-table"===t.format,description:"Markdown table"},{id:"format::json",label:"JSON",icon:_sharedUi.FileCode,color:_sharedUi.macOSColors.semantic.warning,value:"json",isActive:"json"===t.format,description:"Structured data"}]},{id:"sort",title:"Sort By",type:"custom",data:[{id:"sort::renderCount",label:"Count",value:"renderCount",isActive:"renderCount"===t.sortBy,description:"Total renders"},{id:"sort::rate",label:"Rate",value:"rate",isActive:"rate"===t.sortBy,description:"Renders / sec"},{id:"sort::name",label:"Name",value:"name",isActive:"name"===t.sortBy,description:"Alphabetical"}]},{id:"topN",title:"Top N",type:"custom",data:[{id:"topN::10",label:"10",value:10,isActive:10===t.topN},{id:"topN::25",label:"25",value:25,isActive:25===t.topN},{id:"topN::50",label:"50",value:50,isActive:50===t.topN},{id:"topN::100",label:"100",value:100,isActive:100===t.topN},{id:"topN::-1",label:"All",value:-1,isActive:-1===t.topN}]},{id:"minRenders",title:"Min Renders",type:"custom",data:[{id:"minRenders::1",label:"1",value:1,isActive:1===t.minRenders},{id:"minRenders::2",label:"2",value:2,isActive:2===t.minRenders},{id:"minRenders::3",label:"3",value:3,isActive:3===t.minRenders},{id:"minRenders::5",label:"5",value:5,isActive:5===t.minRenders},{id:"minRenders::10",label:"10",value:10,isActive:10===t.minRenders}]},{id:"causes",title:"Filter Causes",type:"custom",description:0===t.filterCauses.length?"All causes shown":"Only the selected causes shown",data:CAUSE_OPTIONS.map(e=>({id:`cause::${e.value}`,label:e.label,value:e.value,isActive:t.filterCauses.includes(e.value)}))},{id:"signal",title:"Signal Extraction",type:"custom",data:[{id:"signal::groupByName",label:"Group by name",value:"groupByName",isActive:t.groupByName,description:"Collapse list items"},{id:"signal::aggregateCauses",label:"Aggregate causes",value:"aggregateCauses",isActive:t.aggregateCauses,description:"Hook x N"},{id:"signal::includeHistory",label:"Include history",value:"includeHistory",isActive:t.includeHistory,description:"JSON only — large"}]}],previewSection:{enabled:!0,title:"PREVIEW",icon:_sharedUi.Eye,content:y,headerActions:g},onFilterChange:m}),[t,n,m,y,g]);return(0,_jsxRuntime.jsx)(_sharedUi.DynamicFilterView,{..._})}const styles=_reactNative.StyleSheet.create({previewScroll:{maxHeight:360},previewText:{fontFamily:_sharedUi.monoFont,fontSize:11,color:_sharedUi.night.color.text,lineHeight:18},statusLabel:{fontSize:11,fontWeight:"600",color:_sharedUi.night.color.textTertiary,marginRight:8}});
@@ -1,73 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.StatsDisplay = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
9
- var _sharedUi = require("@buoy-gg/shared-ui");
10
- var _RenderTracker = require("../utils/RenderTracker");
11
- var _jsxRuntime = require("react/jsx-runtime");
12
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
- /**
14
- * StatsDisplay
15
- *
16
- * Isolated component for displaying render statistics in the header.
17
- * Subscribes to RenderTracker updates independently so parent header
18
- * doesn't re-render when stats change.
19
- *
20
- * Following the optimization guide: move subscriptions to child components.
21
- */
22
-
23
- /**
24
- * Isolated stats display that owns its own subscription.
25
- * Only this component re-renders when stats change.
26
- */function StatsDisplayInner() {
27
- const [stats, setStats] = (0, _react.useState)({
28
- totalComponents: 0,
29
- totalRenders: 0
30
- });
31
- (0, _react.useEffect)(() => {
32
- const unsubscribe = _RenderTracker.RenderTracker.subscribe(() => {
33
- setStats(_RenderTracker.RenderTracker.getStats());
34
- });
35
- return unsubscribe;
36
- }, []);
37
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
38
- nativeID: "__rn_buoy__stats-row",
39
- testID: "buoy-highlight-stats",
40
- accessibilityLabel: `${stats.totalComponents} components tracked`,
41
- style: styles.headerChip,
42
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Activity, {
43
- size: 12,
44
- color: _sharedUi.night.color.accent
45
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
46
- testID: "buoy-highlight-stats-value",
47
- style: [styles.headerChipValue, {
48
- color: _sharedUi.night.color.accent
49
- }],
50
- children: stats.totalComponents
51
- })]
52
- });
53
- }
54
- const StatsDisplay = exports.StatsDisplay = /*#__PURE__*/(0, _react.memo)(StatsDisplayInner);
55
- const styles = _reactNative.StyleSheet.create({
56
- headerChip: {
57
- flexDirection: "row",
58
- alignItems: "center",
59
- gap: 4,
60
- backgroundColor: _sharedUi.night.color.buttonSurface,
61
- paddingHorizontal: 8,
62
- paddingVertical: 5,
63
- borderRadius: 12,
64
- borderWidth: 1,
65
- borderColor: _sharedUi.night.color.border
66
- },
67
- headerChipValue: {
68
- fontSize: 12,
69
- fontWeight: "600",
70
- fontFamily: _sharedUi.monoFont
71
- }
72
- });
73
- var _default = exports.default = StatsDisplay;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.StatsDisplay=void 0;var _react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_RenderTracker=require("../utils/RenderTracker"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap,a=new WeakMap;return(_interopRequireWildcard=function(e,t){if(!t&&e&&e.__esModule)return e;var i,o,n={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return n;if(i=t?a:r){if(i.has(e))return i.get(e);i.set(e,n)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((o=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(o.get||o.set)?i(n,t,o):n[t]=e[t]);return n})(e,t)}function StatsDisplayInner(){const[e,t]=(0,_react.useState)({totalComponents:0,totalRenders:0});return(0,_react.useEffect)(()=>_RenderTracker.RenderTracker.subscribe(()=>{t(_RenderTracker.RenderTracker.getStats())}),[]),(0,_jsxRuntime.jsxs)(_reactNative.View,{nativeID:"__rn_buoy__stats-row",testID:"buoy-highlight-stats",accessibilityLabel:`${e.totalComponents} components tracked`,style:styles.headerChip,children:[(0,_jsxRuntime.jsx)(_sharedUi.Activity,{size:12,color:_sharedUi.night.color.accent}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-highlight-stats-value",style:[styles.headerChipValue,{color:_sharedUi.night.color.accent}],children:e.totalComponents})]})}const StatsDisplay=exports.StatsDisplay=(0,_react.memo)(StatsDisplayInner),styles=_reactNative.StyleSheet.create({headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:_sharedUi.night.color.buttonSurface,paddingHorizontal:8,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:_sharedUi.night.color.border},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:_sharedUi.monoFont}});var _default=exports.default=StatsDisplay;
@@ -1,107 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PRESET_METADATA = exports.DEFAULT_COPY_SETTINGS = exports.COPY_PRESETS = void 0;
7
- exports.detectActivePreset = detectActivePreset;
8
- /**
9
- * Highlight Updates Copy Settings
10
- *
11
- * Configuration for exporting render reports as compact debug-focused output.
12
- */
13
-
14
- // -1 = all
15
-
16
- const DEFAULT_COPY_SETTINGS = exports.DEFAULT_COPY_SETTINGS = {
17
- format: "summary",
18
- topN: 25,
19
- minRenders: 2,
20
- filterCauses: [],
21
- groupByName: true,
22
- aggregateCauses: true,
23
- sortBy: "renderCount",
24
- includeHistory: false
25
- };
26
- const COPY_PRESETS = exports.COPY_PRESETS = {
27
- /** LLM-pasteable summary — the default */
28
- llm: {
29
- format: "summary",
30
- topN: 25,
31
- minRenders: 2,
32
- filterCauses: [],
33
- groupByName: true,
34
- aggregateCauses: true,
35
- sortBy: "renderCount",
36
- includeHistory: false
37
- },
38
- /** Markdown table for PR descriptions */
39
- table: {
40
- format: "markdown-table",
41
- topN: 50,
42
- minRenders: 2,
43
- filterCauses: [],
44
- groupByName: true,
45
- aggregateCauses: true,
46
- sortBy: "renderCount",
47
- includeHistory: false
48
- },
49
- /** Compact JSON, no history */
50
- json: {
51
- format: "json",
52
- topN: -1,
53
- minRenders: 1,
54
- filterCauses: [],
55
- groupByName: false,
56
- aggregateCauses: true,
57
- sortBy: "renderCount",
58
- includeHistory: false
59
- },
60
- /** Full JSON dump including history (escape hatch) */
61
- full: {
62
- format: "json",
63
- topN: -1,
64
- minRenders: 1,
65
- filterCauses: [],
66
- groupByName: false,
67
- aggregateCauses: false,
68
- sortBy: "renderCount",
69
- includeHistory: true
70
- }
71
- };
72
- function detectActivePreset(settings) {
73
- for (const [name, preset] of Object.entries(COPY_PRESETS)) {
74
- const matches = Object.keys(preset).every(key => {
75
- const a = settings[key];
76
- const b = preset[key];
77
- if (Array.isArray(a) && Array.isArray(b)) {
78
- return a.length === b.length && a.every((v, i) => v === b[i]);
79
- }
80
- return a === b;
81
- });
82
- if (matches) return name;
83
- }
84
- return null;
85
- }
86
- const PRESET_METADATA = exports.PRESET_METADATA = {
87
- llm: {
88
- label: "LLM",
89
- description: "Compact summary for AI",
90
- color: "#10B981"
91
- },
92
- table: {
93
- label: "Table",
94
- description: "Markdown table",
95
- color: "#3B82F6"
96
- },
97
- json: {
98
- label: "JSON",
99
- description: "Structured data",
100
- color: "#F59E0B"
101
- },
102
- full: {
103
- label: "Full",
104
- description: "Everything incl. history",
105
- color: "#6B7280"
106
- }
107
- };
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PRESET_METADATA=exports.DEFAULT_COPY_SETTINGS=exports.COPY_PRESETS=void 0,exports.detectActivePreset=detectActivePreset;const DEFAULT_COPY_SETTINGS=exports.DEFAULT_COPY_SETTINGS={format:"summary",topN:25,minRenders:2,filterCauses:[],groupByName:!0,aggregateCauses:!0,sortBy:"renderCount",includeHistory:!1},COPY_PRESETS=exports.COPY_PRESETS={llm:{format:"summary",topN:25,minRenders:2,filterCauses:[],groupByName:!0,aggregateCauses:!0,sortBy:"renderCount",includeHistory:!1},table:{format:"markdown-table",topN:50,minRenders:2,filterCauses:[],groupByName:!0,aggregateCauses:!0,sortBy:"renderCount",includeHistory:!1},json:{format:"json",topN:-1,minRenders:1,filterCauses:[],groupByName:!1,aggregateCauses:!0,sortBy:"renderCount",includeHistory:!1},full:{format:"json",topN:-1,minRenders:1,filterCauses:[],groupByName:!1,aggregateCauses:!1,sortBy:"renderCount",includeHistory:!0}};function detectActivePreset(e){for(const[r,t]of Object.entries(COPY_PRESETS))if(Object.keys(t).every(r=>{const o=e[r],s=t[r];return Array.isArray(o)&&Array.isArray(s)?o.length===s.length&&o.every((e,r)=>e===s[r]):o===s}))return r;return null}const PRESET_METADATA=exports.PRESET_METADATA={llm:{label:"LLM",description:"Compact summary for AI",color:"#10B981"},table:{label:"Table",description:"Markdown table",color:"#3B82F6"},json:{label:"JSON",description:"Structured data",color:"#F59E0B"},full:{label:"Full",description:"Everything incl. history",color:"#6B7280"}};