@buoy-gg/events 7.0.28 → 7.0.30
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/components/EventsModal.js +2 -1
- package/lib/commonjs/components/EventsModal.js.map +1 -1
- package/lib/module/components/EventsModal.js +2 -1
- package/lib/module/components/EventsModal.js.map +1 -1
- package/lib/typescript/components/EventsModal.d.ts.map +1 -1
- package/package.json +7 -8
- package/src/components/EventsCopySettingsView.tsx +0 -781
- package/src/components/EventsModal.tsx +0 -536
- package/src/components/ReactQueryEventDetail.tsx +0 -418
- package/src/components/UnifiedEventDetail.tsx +0 -596
- package/src/components/UnifiedEventFilters.tsx +0 -226
- package/src/components/UnifiedEventItem.tsx +0 -467
- package/src/components/UnifiedEventList.tsx +0 -216
- package/src/components/UnifiedEventViewer.tsx +0 -133
- package/src/hooks/useUnifiedEvents.ts +0 -573
- package/src/index.tsx +0 -128
- package/src/preset.tsx +0 -57
- package/src/sources/sourceIds.ts +0 -25
- package/src/stores/unifiedEventStore.ts +0 -686
- package/src/sync/__tests__/eventsSyncAdapter.test.ts +0 -471
- package/src/sync/eventsSyncAdapter.ts +0 -391
- package/src/types/copySettings.ts +0 -299
- package/src/types/index.ts +0 -101
- package/src/utils/autoDiscoverEventSources.ts +0 -1087
- package/src/utils/badgeSelectionStorage.ts +0 -81
- package/src/utils/copySettingsStorage.ts +0 -61
- package/src/utils/correlationUtils.ts +0 -146
- package/src/utils/eventExportFormatter.ts +0 -2066
- package/src/utils/eventTransformers.ts +0 -567
|
@@ -1,781 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* EventsCopySettingsView
|
|
3
|
-
*
|
|
4
|
-
* Settings UI for configuring event export format and content.
|
|
5
|
-
* Based on NetworkCopySettingsView pattern.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
9
|
-
import { Text, StyleSheet, ScrollView, View, TouchableOpacity } from "react-native";
|
|
10
|
-
import {
|
|
11
|
-
DynamicFilterView,
|
|
12
|
-
type DynamicFilterConfig,
|
|
13
|
-
macOSColors,
|
|
14
|
-
night,
|
|
15
|
-
FileText,
|
|
16
|
-
FileCode,
|
|
17
|
-
Hash,
|
|
18
|
-
Zap,
|
|
19
|
-
AlertTriangle,
|
|
20
|
-
Settings,
|
|
21
|
-
Eye,
|
|
22
|
-
ChevronDown,
|
|
23
|
-
ChevronUp,
|
|
24
|
-
XCircle,
|
|
25
|
-
GitBranch,
|
|
26
|
-
ToolbarCopyButton,
|
|
27
|
-
useFeatureGate,
|
|
28
|
-
ProFeatureBanner,
|
|
29
|
-
} from "@buoy-gg/shared-ui";
|
|
30
|
-
import { DataViewer } from "@buoy-gg/shared-ui/dataViewer";
|
|
31
|
-
import type { UnifiedEvent } from "../types";
|
|
32
|
-
import {
|
|
33
|
-
type EventsCopySettings,
|
|
34
|
-
DEFAULT_COPY_SETTINGS,
|
|
35
|
-
COPY_PRESETS,
|
|
36
|
-
PRESET_METADATA,
|
|
37
|
-
detectActivePreset,
|
|
38
|
-
type CopyPresetName,
|
|
39
|
-
} from "../types/copySettings";
|
|
40
|
-
import {
|
|
41
|
-
generateExport,
|
|
42
|
-
estimateExportSize,
|
|
43
|
-
getExportSummary,
|
|
44
|
-
} from "../utils/eventExportFormatter";
|
|
45
|
-
import {
|
|
46
|
-
loadCopySettings,
|
|
47
|
-
saveCopySettings,
|
|
48
|
-
} from "../utils/copySettingsStorage";
|
|
49
|
-
|
|
50
|
-
interface EventsCopySettingsViewProps {
|
|
51
|
-
events?: UnifiedEvent[];
|
|
52
|
-
initialSettings?: EventsCopySettings;
|
|
53
|
-
onSettingsChange?: (settings: EventsCopySettings) => void;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Size thresholds for warnings
|
|
57
|
-
const SIZE_WARNING_THRESHOLD = 50 * 1024; // 50KB
|
|
58
|
-
const SIZE_DANGER_THRESHOLD = 200 * 1024; // 200KB
|
|
59
|
-
|
|
60
|
-
// Helper to format bytes
|
|
61
|
-
function formatBytes(bytes: number): string {
|
|
62
|
-
if (bytes < 1024) return `${bytes} B`;
|
|
63
|
-
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
64
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Mock events for preview when no real events exist
|
|
68
|
-
function createMockEvents(): UnifiedEvent[] {
|
|
69
|
-
const now = Date.now();
|
|
70
|
-
return [
|
|
71
|
-
{
|
|
72
|
-
id: "mock-1",
|
|
73
|
-
source: "storage-async",
|
|
74
|
-
timestamp: now - 2000,
|
|
75
|
-
title: "Set Item",
|
|
76
|
-
subtitle: "user_cart",
|
|
77
|
-
status: "success",
|
|
78
|
-
originalEvent: { action: "setItem", key: "user_cart", value: { items: 2 } },
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
id: "mock-2",
|
|
82
|
-
source: "react-query-query",
|
|
83
|
-
timestamp: now - 1500,
|
|
84
|
-
title: "cart \u203A items",
|
|
85
|
-
subtitle: "Fetching...",
|
|
86
|
-
status: "pending",
|
|
87
|
-
originalEvent: { type: "query-fetch-start", queryKey: ["cart", "items"] },
|
|
88
|
-
correlationId: "rq-query-cart",
|
|
89
|
-
sequenceInGroup: 1,
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
id: "mock-3",
|
|
93
|
-
source: "react-query-query",
|
|
94
|
-
timestamp: now - 1000,
|
|
95
|
-
title: "cart \u203A items",
|
|
96
|
-
subtitle: "Success \u00B7 500ms",
|
|
97
|
-
status: "success",
|
|
98
|
-
originalEvent: { type: "query-fetch-success", queryKey: ["cart", "items"], data: { items: [] } },
|
|
99
|
-
correlationId: "rq-query-cart",
|
|
100
|
-
sequenceInGroup: 2,
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
id: "mock-4",
|
|
104
|
-
source: "network",
|
|
105
|
-
timestamp: now - 500,
|
|
106
|
-
title: "POST /api/checkout",
|
|
107
|
-
subtitle: "402 \u00B7 450ms",
|
|
108
|
-
status: "error",
|
|
109
|
-
originalEvent: { method: "POST", url: "/api/checkout", status: 402, error: "Payment required" },
|
|
110
|
-
},
|
|
111
|
-
];
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export function EventsCopySettingsView({
|
|
115
|
-
events = [],
|
|
116
|
-
initialSettings = DEFAULT_COPY_SETTINGS,
|
|
117
|
-
onSettingsChange,
|
|
118
|
-
}: EventsCopySettingsViewProps) {
|
|
119
|
-
const { isPro } = useFeatureGate();
|
|
120
|
-
const [settings, setSettings] = useState<EventsCopySettings>(initialSettings);
|
|
121
|
-
const [isPreviewExpanded, setIsPreviewExpanded] = useState(false);
|
|
122
|
-
const [isLoaded, setIsLoaded] = useState(false);
|
|
123
|
-
|
|
124
|
-
// Load persisted settings on mount
|
|
125
|
-
useEffect(() => {
|
|
126
|
-
let mounted = true;
|
|
127
|
-
loadCopySettings().then((savedSettings) => {
|
|
128
|
-
if (mounted && savedSettings) {
|
|
129
|
-
setSettings(savedSettings);
|
|
130
|
-
onSettingsChange?.(savedSettings);
|
|
131
|
-
}
|
|
132
|
-
if (mounted) {
|
|
133
|
-
setIsLoaded(true);
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
return () => {
|
|
137
|
-
mounted = false;
|
|
138
|
-
};
|
|
139
|
-
}, [onSettingsChange]);
|
|
140
|
-
|
|
141
|
-
// Update internal state, notify parent, and persist
|
|
142
|
-
const updateSettings = useCallback(
|
|
143
|
-
(newSettings: EventsCopySettings) => {
|
|
144
|
-
setSettings(newSettings);
|
|
145
|
-
onSettingsChange?.(newSettings);
|
|
146
|
-
// Persist to storage
|
|
147
|
-
saveCopySettings(newSettings);
|
|
148
|
-
},
|
|
149
|
-
[onSettingsChange]
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
// Use mock events if no real events
|
|
153
|
-
const hasLiveData = events.length > 0;
|
|
154
|
-
const previewEvents = hasLiveData ? events : createMockEvents();
|
|
155
|
-
|
|
156
|
-
// Detect active preset
|
|
157
|
-
const activePreset = useMemo(() => detectActivePreset(settings), [settings]);
|
|
158
|
-
|
|
159
|
-
// Estimate size
|
|
160
|
-
const estimatedSize = useMemo(
|
|
161
|
-
() => estimateExportSize(previewEvents, settings),
|
|
162
|
-
[previewEvents, settings]
|
|
163
|
-
);
|
|
164
|
-
|
|
165
|
-
// Size warning level
|
|
166
|
-
const sizeWarningLevel = useMemo(() => {
|
|
167
|
-
if (estimatedSize >= SIZE_DANGER_THRESHOLD) return "danger";
|
|
168
|
-
if (estimatedSize >= SIZE_WARNING_THRESHOLD) return "warning";
|
|
169
|
-
return "none";
|
|
170
|
-
}, [estimatedSize]);
|
|
171
|
-
|
|
172
|
-
// Generate copy text
|
|
173
|
-
const generateCopyText = useCallback(() => {
|
|
174
|
-
return generateExport(previewEvents, settings);
|
|
175
|
-
}, [previewEvents, settings]);
|
|
176
|
-
|
|
177
|
-
// Handle preset selection
|
|
178
|
-
const applyPreset = useCallback(
|
|
179
|
-
(presetName: CopyPresetName) => {
|
|
180
|
-
const preset = COPY_PRESETS[presetName];
|
|
181
|
-
updateSettings({
|
|
182
|
-
...preset,
|
|
183
|
-
// Convert readonly array to mutable array
|
|
184
|
-
filterSources: [...preset.filterSources],
|
|
185
|
-
});
|
|
186
|
-
},
|
|
187
|
-
[updateSettings]
|
|
188
|
-
);
|
|
189
|
-
|
|
190
|
-
// Handle option changes
|
|
191
|
-
const handleOptionChange = useCallback(
|
|
192
|
-
(optionId: string, value: unknown) => {
|
|
193
|
-
const [group, key] = optionId.split("::");
|
|
194
|
-
|
|
195
|
-
if (group === "preset") {
|
|
196
|
-
applyPreset(key as CopyPresetName);
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
if (group === "include") {
|
|
201
|
-
updateSettings({
|
|
202
|
-
...settings,
|
|
203
|
-
[key]: !settings[key as keyof EventsCopySettings],
|
|
204
|
-
});
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
if (group === "format") {
|
|
209
|
-
updateSettings({
|
|
210
|
-
...settings,
|
|
211
|
-
format: value as EventsCopySettings["format"],
|
|
212
|
-
});
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
if (group === "timestamp") {
|
|
217
|
-
updateSettings({
|
|
218
|
-
...settings,
|
|
219
|
-
timestampFormat: value as EventsCopySettings["timestampFormat"],
|
|
220
|
-
});
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
if (group === "filter") {
|
|
225
|
-
updateSettings({
|
|
226
|
-
...settings,
|
|
227
|
-
filterMode: value as EventsCopySettings["filterMode"],
|
|
228
|
-
});
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
if (group === "threshold") {
|
|
233
|
-
updateSettings({
|
|
234
|
-
...settings,
|
|
235
|
-
dataSizeThreshold: value as EventsCopySettings["dataSizeThreshold"],
|
|
236
|
-
});
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
[settings, updateSettings, applyPreset]
|
|
241
|
-
);
|
|
242
|
-
|
|
243
|
-
// Render preview content
|
|
244
|
-
const renderPreviewContent = useCallback(() => {
|
|
245
|
-
const eventCount = previewEvents.length;
|
|
246
|
-
|
|
247
|
-
// Collapsed state
|
|
248
|
-
if (!isPreviewExpanded) {
|
|
249
|
-
const warningColor =
|
|
250
|
-
sizeWarningLevel === "danger"
|
|
251
|
-
? night.color.danger
|
|
252
|
-
: sizeWarningLevel === "warning"
|
|
253
|
-
? night.color.warning
|
|
254
|
-
: night.color.textSecondary;
|
|
255
|
-
|
|
256
|
-
return (
|
|
257
|
-
<View style={styles.collapsedPreview}>
|
|
258
|
-
<TouchableOpacity
|
|
259
|
-
style={styles.expandButton}
|
|
260
|
-
onPress={() => setIsPreviewExpanded(true)}
|
|
261
|
-
>
|
|
262
|
-
<View style={styles.expandButtonContent}>
|
|
263
|
-
<Eye size={16} color={night.color.info} />
|
|
264
|
-
<View style={styles.expandButtonTextContainer}>
|
|
265
|
-
<Text style={styles.expandButtonTitle}>Show Preview</Text>
|
|
266
|
-
<Text style={styles.expandButtonSubtitle}>
|
|
267
|
-
{eventCount} event{eventCount !== 1 ? "s" : ""} \u00B7 ~
|
|
268
|
-
{formatBytes(estimatedSize)}
|
|
269
|
-
{!hasLiveData ? " (mock data)" : ""}
|
|
270
|
-
</Text>
|
|
271
|
-
</View>
|
|
272
|
-
<ChevronDown size={16} color={night.color.textTertiary} />
|
|
273
|
-
</View>
|
|
274
|
-
</TouchableOpacity>
|
|
275
|
-
|
|
276
|
-
{sizeWarningLevel !== "none" && (
|
|
277
|
-
<View
|
|
278
|
-
style={[
|
|
279
|
-
styles.sizeWarning,
|
|
280
|
-
sizeWarningLevel === "danger" && styles.sizeWarningDanger,
|
|
281
|
-
]}
|
|
282
|
-
>
|
|
283
|
-
<AlertTriangle size={12} color={warningColor} />
|
|
284
|
-
<Text style={[styles.sizeWarningText, { color: warningColor }]}>
|
|
285
|
-
{sizeWarningLevel === "danger"
|
|
286
|
-
? "Very large payload - may cause performance issues"
|
|
287
|
-
: "Large payload - preview may be slow"}
|
|
288
|
-
</Text>
|
|
289
|
-
</View>
|
|
290
|
-
)}
|
|
291
|
-
</View>
|
|
292
|
-
);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
// Expanded state
|
|
296
|
-
const exportText = generateCopyText();
|
|
297
|
-
|
|
298
|
-
return (
|
|
299
|
-
<View>
|
|
300
|
-
<TouchableOpacity
|
|
301
|
-
style={styles.collapseButton}
|
|
302
|
-
onPress={() => setIsPreviewExpanded(false)}
|
|
303
|
-
>
|
|
304
|
-
<Text style={styles.collapseButtonText}>Hide Preview</Text>
|
|
305
|
-
<ChevronUp size={14} color={night.color.textSecondary} />
|
|
306
|
-
</TouchableOpacity>
|
|
307
|
-
|
|
308
|
-
{settings.format === "json" ? (
|
|
309
|
-
<DataViewer
|
|
310
|
-
data={JSON.parse(exportText)}
|
|
311
|
-
title=""
|
|
312
|
-
showTypeFilter={true}
|
|
313
|
-
rawMode={true}
|
|
314
|
-
initialExpanded={true}
|
|
315
|
-
/>
|
|
316
|
-
) : (
|
|
317
|
-
<View>
|
|
318
|
-
{settings.format === "mermaid" && (
|
|
319
|
-
<Text style={styles.mermaidHint}>
|
|
320
|
-
💡 Paste into mermaid.live to visualize
|
|
321
|
-
</Text>
|
|
322
|
-
)}
|
|
323
|
-
<ScrollView style={styles.previewScroll} nestedScrollEnabled>
|
|
324
|
-
<Text style={styles.previewText} selectable={isPro}>
|
|
325
|
-
{exportText}
|
|
326
|
-
</Text>
|
|
327
|
-
</ScrollView>
|
|
328
|
-
</View>
|
|
329
|
-
)}
|
|
330
|
-
</View>
|
|
331
|
-
);
|
|
332
|
-
}, [
|
|
333
|
-
isPreviewExpanded,
|
|
334
|
-
previewEvents,
|
|
335
|
-
settings,
|
|
336
|
-
estimatedSize,
|
|
337
|
-
sizeWarningLevel,
|
|
338
|
-
hasLiveData,
|
|
339
|
-
generateCopyText,
|
|
340
|
-
isPro,
|
|
341
|
-
]);
|
|
342
|
-
|
|
343
|
-
// Render preview header actions
|
|
344
|
-
const renderPreviewHeaderActions = useCallback(() => {
|
|
345
|
-
const summary = getExportSummary(previewEvents);
|
|
346
|
-
const statusLabel = hasLiveData
|
|
347
|
-
? `${summary.totalEvents} events`
|
|
348
|
-
: "Mock data (no events captured)";
|
|
349
|
-
|
|
350
|
-
return (
|
|
351
|
-
<>
|
|
352
|
-
<Text style={styles.statusLabel}>{statusLabel}</Text>
|
|
353
|
-
<ToolbarCopyButton value={generateCopyText()} />
|
|
354
|
-
</>
|
|
355
|
-
);
|
|
356
|
-
}, [hasLiveData, previewEvents, generateCopyText]);
|
|
357
|
-
|
|
358
|
-
// Build filter config
|
|
359
|
-
const dynamicFilterConfig = useMemo<DynamicFilterConfig>(
|
|
360
|
-
() => ({
|
|
361
|
-
sections: [
|
|
362
|
-
// Presets Section
|
|
363
|
-
{
|
|
364
|
-
id: "presets",
|
|
365
|
-
title: "Presets",
|
|
366
|
-
type: "custom" as const,
|
|
367
|
-
data: [
|
|
368
|
-
{
|
|
369
|
-
id: "preset::llm",
|
|
370
|
-
label: PRESET_METADATA.llm.label,
|
|
371
|
-
icon: Zap,
|
|
372
|
-
color: PRESET_METADATA.llm.color,
|
|
373
|
-
value: "llm",
|
|
374
|
-
isActive: activePreset === "llm",
|
|
375
|
-
description: PRESET_METADATA.llm.description,
|
|
376
|
-
},
|
|
377
|
-
{
|
|
378
|
-
id: "preset::bugReport",
|
|
379
|
-
label: PRESET_METADATA.bugReport.label,
|
|
380
|
-
icon: AlertTriangle,
|
|
381
|
-
color: PRESET_METADATA.bugReport.color,
|
|
382
|
-
value: "bugReport",
|
|
383
|
-
isActive: activePreset === "bugReport",
|
|
384
|
-
description: PRESET_METADATA.bugReport.description,
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
id: "preset::json",
|
|
388
|
-
label: PRESET_METADATA.json.label,
|
|
389
|
-
icon: FileCode,
|
|
390
|
-
color: PRESET_METADATA.json.color,
|
|
391
|
-
value: "json",
|
|
392
|
-
isActive: activePreset === "json",
|
|
393
|
-
description: PRESET_METADATA.json.description,
|
|
394
|
-
},
|
|
395
|
-
{
|
|
396
|
-
id: "preset::errors",
|
|
397
|
-
label: PRESET_METADATA.errors.label,
|
|
398
|
-
icon: XCircle,
|
|
399
|
-
color: PRESET_METADATA.errors.color,
|
|
400
|
-
value: "errors",
|
|
401
|
-
isActive: activePreset === "errors",
|
|
402
|
-
description: PRESET_METADATA.errors.description,
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
id: "preset::minimal",
|
|
406
|
-
label: PRESET_METADATA.minimal.label,
|
|
407
|
-
icon: FileText,
|
|
408
|
-
color: PRESET_METADATA.minimal.color,
|
|
409
|
-
value: "minimal",
|
|
410
|
-
isActive: activePreset === "minimal",
|
|
411
|
-
description: PRESET_METADATA.minimal.description,
|
|
412
|
-
},
|
|
413
|
-
{
|
|
414
|
-
id: "preset::mermaid",
|
|
415
|
-
label: PRESET_METADATA.mermaid.label,
|
|
416
|
-
icon: GitBranch,
|
|
417
|
-
color: PRESET_METADATA.mermaid.color,
|
|
418
|
-
value: "mermaid",
|
|
419
|
-
isActive: activePreset === "mermaid",
|
|
420
|
-
description: PRESET_METADATA.mermaid.description,
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
id: "preset::custom",
|
|
424
|
-
label: "Custom",
|
|
425
|
-
icon: Settings,
|
|
426
|
-
color: night.color.textSecondary,
|
|
427
|
-
value: "custom",
|
|
428
|
-
isActive: activePreset === null,
|
|
429
|
-
description: "User-configured",
|
|
430
|
-
},
|
|
431
|
-
],
|
|
432
|
-
},
|
|
433
|
-
|
|
434
|
-
// Include Section
|
|
435
|
-
{
|
|
436
|
-
id: "include",
|
|
437
|
-
title: "Include",
|
|
438
|
-
type: "custom" as const,
|
|
439
|
-
data: [
|
|
440
|
-
{
|
|
441
|
-
id: "include::includeSource",
|
|
442
|
-
label: "Source",
|
|
443
|
-
value: "includeSource",
|
|
444
|
-
isActive: settings.includeSource,
|
|
445
|
-
},
|
|
446
|
-
{
|
|
447
|
-
id: "include::includeStatus",
|
|
448
|
-
label: "Status",
|
|
449
|
-
value: "includeStatus",
|
|
450
|
-
isActive: settings.includeStatus,
|
|
451
|
-
},
|
|
452
|
-
{
|
|
453
|
-
id: "include::includeTitle",
|
|
454
|
-
label: "Title",
|
|
455
|
-
value: "includeTitle",
|
|
456
|
-
isActive: settings.includeTitle,
|
|
457
|
-
},
|
|
458
|
-
{
|
|
459
|
-
id: "include::includeSubtitle",
|
|
460
|
-
label: "Subtitle",
|
|
461
|
-
value: "includeSubtitle",
|
|
462
|
-
isActive: settings.includeSubtitle,
|
|
463
|
-
},
|
|
464
|
-
{
|
|
465
|
-
id: "include::includeCorrelation",
|
|
466
|
-
label: "Correlation",
|
|
467
|
-
value: "includeCorrelation",
|
|
468
|
-
isActive: settings.includeCorrelation,
|
|
469
|
-
},
|
|
470
|
-
{
|
|
471
|
-
id: "include::includeDuration",
|
|
472
|
-
label: "Duration",
|
|
473
|
-
value: "includeDuration",
|
|
474
|
-
isActive: settings.includeDuration,
|
|
475
|
-
},
|
|
476
|
-
{
|
|
477
|
-
id: "include::includeSummaryHeader",
|
|
478
|
-
label: "Summary",
|
|
479
|
-
value: "includeSummaryHeader",
|
|
480
|
-
isActive: settings.includeSummaryHeader,
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
id: "include::includeEventData",
|
|
484
|
-
label: "Data",
|
|
485
|
-
value: "includeEventData",
|
|
486
|
-
isActive: settings.includeEventData,
|
|
487
|
-
},
|
|
488
|
-
],
|
|
489
|
-
},
|
|
490
|
-
|
|
491
|
-
// Format Section
|
|
492
|
-
{
|
|
493
|
-
id: "format",
|
|
494
|
-
title: "Format",
|
|
495
|
-
type: "custom" as const,
|
|
496
|
-
data: [
|
|
497
|
-
{
|
|
498
|
-
id: "format::markdown",
|
|
499
|
-
label: "Markdown",
|
|
500
|
-
icon: FileText,
|
|
501
|
-
color: macOSColors.semantic.info,
|
|
502
|
-
value: "markdown",
|
|
503
|
-
isActive: settings.format === "markdown",
|
|
504
|
-
},
|
|
505
|
-
{
|
|
506
|
-
id: "format::json",
|
|
507
|
-
label: "JSON",
|
|
508
|
-
icon: FileCode,
|
|
509
|
-
color: macOSColors.semantic.warning,
|
|
510
|
-
value: "json",
|
|
511
|
-
isActive: settings.format === "json",
|
|
512
|
-
},
|
|
513
|
-
{
|
|
514
|
-
id: "format::plaintext",
|
|
515
|
-
label: "Text",
|
|
516
|
-
icon: Hash,
|
|
517
|
-
color: night.color.textSecondary,
|
|
518
|
-
value: "plaintext",
|
|
519
|
-
isActive: settings.format === "plaintext",
|
|
520
|
-
},
|
|
521
|
-
{
|
|
522
|
-
id: "format::mermaid",
|
|
523
|
-
label: "Diagram",
|
|
524
|
-
icon: GitBranch,
|
|
525
|
-
color: "#A855F7",
|
|
526
|
-
value: "mermaid",
|
|
527
|
-
isActive: settings.format === "mermaid",
|
|
528
|
-
description: "Mermaid sequence diagram",
|
|
529
|
-
},
|
|
530
|
-
],
|
|
531
|
-
},
|
|
532
|
-
|
|
533
|
-
// Timestamp Section
|
|
534
|
-
{
|
|
535
|
-
id: "timestamp",
|
|
536
|
-
title: "Timestamps",
|
|
537
|
-
type: "custom" as const,
|
|
538
|
-
data: [
|
|
539
|
-
{
|
|
540
|
-
id: "timestamp::relative",
|
|
541
|
-
label: "Relative",
|
|
542
|
-
value: "relative",
|
|
543
|
-
isActive: settings.timestampFormat === "relative",
|
|
544
|
-
description: "+0ms, +150ms",
|
|
545
|
-
},
|
|
546
|
-
{
|
|
547
|
-
id: "timestamp::absolute",
|
|
548
|
-
label: "Absolute",
|
|
549
|
-
value: "absolute",
|
|
550
|
-
isActive: settings.timestampFormat === "absolute",
|
|
551
|
-
description: "ISO format",
|
|
552
|
-
},
|
|
553
|
-
{
|
|
554
|
-
id: "timestamp::both",
|
|
555
|
-
label: "Both",
|
|
556
|
-
value: "both",
|
|
557
|
-
isActive: settings.timestampFormat === "both",
|
|
558
|
-
description: "Both formats",
|
|
559
|
-
},
|
|
560
|
-
],
|
|
561
|
-
},
|
|
562
|
-
|
|
563
|
-
// Filter Section
|
|
564
|
-
{
|
|
565
|
-
id: "filter",
|
|
566
|
-
title: "Filter Events",
|
|
567
|
-
type: "custom" as const,
|
|
568
|
-
data: [
|
|
569
|
-
{
|
|
570
|
-
id: "filter::all",
|
|
571
|
-
label: "All",
|
|
572
|
-
value: "all",
|
|
573
|
-
isActive: settings.filterMode === "all",
|
|
574
|
-
},
|
|
575
|
-
{
|
|
576
|
-
id: "filter::errors",
|
|
577
|
-
label: "Errors",
|
|
578
|
-
icon: XCircle,
|
|
579
|
-
color: macOSColors.semantic.error,
|
|
580
|
-
value: "errors",
|
|
581
|
-
isActive: settings.filterMode === "errors",
|
|
582
|
-
},
|
|
583
|
-
{
|
|
584
|
-
id: "filter::success",
|
|
585
|
-
label: "Success",
|
|
586
|
-
color: macOSColors.semantic.success,
|
|
587
|
-
value: "success",
|
|
588
|
-
isActive: settings.filterMode === "success",
|
|
589
|
-
},
|
|
590
|
-
{
|
|
591
|
-
id: "filter::pending",
|
|
592
|
-
label: "Pending",
|
|
593
|
-
color: macOSColors.semantic.warning,
|
|
594
|
-
value: "pending",
|
|
595
|
-
isActive: settings.filterMode === "pending",
|
|
596
|
-
},
|
|
597
|
-
],
|
|
598
|
-
},
|
|
599
|
-
|
|
600
|
-
// LLM Optimization Section
|
|
601
|
-
{
|
|
602
|
-
id: "llmOptimization",
|
|
603
|
-
title: "LLM Optimization",
|
|
604
|
-
type: "custom" as const,
|
|
605
|
-
data: [
|
|
606
|
-
{
|
|
607
|
-
id: "include::compactMode",
|
|
608
|
-
label: "Compact",
|
|
609
|
-
value: "compactMode",
|
|
610
|
-
isActive: settings.compactMode,
|
|
611
|
-
description: "One line per event",
|
|
612
|
-
},
|
|
613
|
-
{
|
|
614
|
-
id: "include::smartJsonParsing",
|
|
615
|
-
label: "Smart JSON",
|
|
616
|
-
value: "smartJsonParsing",
|
|
617
|
-
isActive: settings.smartJsonParsing,
|
|
618
|
-
description: "Parse nested JSON",
|
|
619
|
-
},
|
|
620
|
-
{
|
|
621
|
-
id: "include::reduxChangedOnly",
|
|
622
|
-
label: "Redux Diff",
|
|
623
|
-
value: "reduxChangedOnly",
|
|
624
|
-
isActive: settings.reduxChangedOnly,
|
|
625
|
-
description: "Only show changes",
|
|
626
|
-
},
|
|
627
|
-
{
|
|
628
|
-
id: "include::showStorageDiff",
|
|
629
|
-
label: "Storage Diff",
|
|
630
|
-
value: "showStorageDiff",
|
|
631
|
-
isActive: settings.showStorageDiff,
|
|
632
|
-
description: "Show what changed",
|
|
633
|
-
},
|
|
634
|
-
{
|
|
635
|
-
id: "include::stripVerboseFields",
|
|
636
|
-
label: "Strip Noise",
|
|
637
|
-
value: "stripVerboseFields",
|
|
638
|
-
isActive: settings.stripVerboseFields,
|
|
639
|
-
description: "Remove images/descriptions",
|
|
640
|
-
},
|
|
641
|
-
],
|
|
642
|
-
},
|
|
643
|
-
],
|
|
644
|
-
previewSection: {
|
|
645
|
-
enabled: true,
|
|
646
|
-
title: "PREVIEW",
|
|
647
|
-
icon: Eye,
|
|
648
|
-
content: renderPreviewContent,
|
|
649
|
-
headerActions: renderPreviewHeaderActions,
|
|
650
|
-
},
|
|
651
|
-
onFilterChange: handleOptionChange,
|
|
652
|
-
}),
|
|
653
|
-
[settings, activePreset, handleOptionChange, renderPreviewContent, renderPreviewHeaderActions]
|
|
654
|
-
);
|
|
655
|
-
|
|
656
|
-
// Pro gating - show banner at top with preview below (no floating)
|
|
657
|
-
if (!isPro) {
|
|
658
|
-
return (
|
|
659
|
-
<ScrollView style={styles.gatedContainer} contentContainerStyle={styles.gatedContent}>
|
|
660
|
-
<ProFeatureBanner
|
|
661
|
-
featureName="Events Export"
|
|
662
|
-
description="Export event flows to share with your team, debug issues, or feed into AI tools."
|
|
663
|
-
benefits={[
|
|
664
|
-
"Export to Markdown, JSON, or plain text",
|
|
665
|
-
"Customizable presets (LLM-ready, Bug Report, JSON)",
|
|
666
|
-
"Share event flows with teammates",
|
|
667
|
-
"Feed event context directly to AI assistants",
|
|
668
|
-
]}
|
|
669
|
-
/>
|
|
670
|
-
<View style={styles.gatedPreview}>
|
|
671
|
-
<DynamicFilterView {...dynamicFilterConfig} />
|
|
672
|
-
</View>
|
|
673
|
-
</ScrollView>
|
|
674
|
-
);
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
return <DynamicFilterView {...dynamicFilterConfig} />;
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
const styles = StyleSheet.create({
|
|
681
|
-
collapsedPreview: {
|
|
682
|
-
gap: 8,
|
|
683
|
-
},
|
|
684
|
-
expandButton: {
|
|
685
|
-
backgroundColor: night.color.surfaceElevated,
|
|
686
|
-
borderRadius: 8,
|
|
687
|
-
borderWidth: 1,
|
|
688
|
-
borderColor: night.color.border,
|
|
689
|
-
padding: 12,
|
|
690
|
-
},
|
|
691
|
-
expandButtonContent: {
|
|
692
|
-
flexDirection: "row",
|
|
693
|
-
alignItems: "center",
|
|
694
|
-
gap: 10,
|
|
695
|
-
},
|
|
696
|
-
expandButtonTextContainer: {
|
|
697
|
-
flex: 1,
|
|
698
|
-
},
|
|
699
|
-
expandButtonTitle: {
|
|
700
|
-
fontSize: 13,
|
|
701
|
-
fontWeight: "600",
|
|
702
|
-
color: night.color.text,
|
|
703
|
-
},
|
|
704
|
-
expandButtonSubtitle: {
|
|
705
|
-
fontSize: 11,
|
|
706
|
-
color: night.color.textSecondary,
|
|
707
|
-
marginTop: 2,
|
|
708
|
-
},
|
|
709
|
-
collapseButton: {
|
|
710
|
-
flexDirection: "row",
|
|
711
|
-
alignItems: "center",
|
|
712
|
-
justifyContent: "center",
|
|
713
|
-
gap: 6,
|
|
714
|
-
paddingVertical: 8,
|
|
715
|
-
marginBottom: 8,
|
|
716
|
-
backgroundColor: night.color.surfaceElevated,
|
|
717
|
-
borderRadius: 6,
|
|
718
|
-
borderWidth: 1,
|
|
719
|
-
borderColor: night.color.border,
|
|
720
|
-
},
|
|
721
|
-
collapseButtonText: {
|
|
722
|
-
fontSize: 12,
|
|
723
|
-
fontWeight: "500",
|
|
724
|
-
color: night.color.textSecondary,
|
|
725
|
-
},
|
|
726
|
-
sizeWarning: {
|
|
727
|
-
flexDirection: "row",
|
|
728
|
-
alignItems: "center",
|
|
729
|
-
gap: 6,
|
|
730
|
-
paddingHorizontal: 10,
|
|
731
|
-
paddingVertical: 6,
|
|
732
|
-
backgroundColor: night.color.warningSoft,
|
|
733
|
-
borderRadius: 6,
|
|
734
|
-
borderWidth: 1,
|
|
735
|
-
borderColor: night.color.warning + "30",
|
|
736
|
-
},
|
|
737
|
-
sizeWarningDanger: {
|
|
738
|
-
backgroundColor: night.color.dangerSoft,
|
|
739
|
-
borderColor: night.color.danger + "30",
|
|
740
|
-
},
|
|
741
|
-
sizeWarningText: {
|
|
742
|
-
fontSize: 11,
|
|
743
|
-
fontWeight: "500",
|
|
744
|
-
flex: 1,
|
|
745
|
-
},
|
|
746
|
-
previewScroll: {
|
|
747
|
-
maxHeight: 300,
|
|
748
|
-
},
|
|
749
|
-
previewText: {
|
|
750
|
-
fontFamily: "monospace",
|
|
751
|
-
fontSize: 11,
|
|
752
|
-
color: night.color.text,
|
|
753
|
-
lineHeight: 18,
|
|
754
|
-
},
|
|
755
|
-
mermaidHint: {
|
|
756
|
-
fontSize: 11,
|
|
757
|
-
color: night.color.textSecondary,
|
|
758
|
-
marginBottom: 8,
|
|
759
|
-
paddingHorizontal: 8,
|
|
760
|
-
paddingVertical: 6,
|
|
761
|
-
backgroundColor: "#A855F7" + "15",
|
|
762
|
-
borderRadius: 6,
|
|
763
|
-
overflow: "hidden",
|
|
764
|
-
},
|
|
765
|
-
statusLabel: {
|
|
766
|
-
fontSize: 11,
|
|
767
|
-
fontWeight: "600",
|
|
768
|
-
color: night.color.textTertiary,
|
|
769
|
-
marginRight: 8,
|
|
770
|
-
},
|
|
771
|
-
gatedContainer: {
|
|
772
|
-
flex: 1,
|
|
773
|
-
},
|
|
774
|
-
gatedContent: {
|
|
775
|
-
padding: 12,
|
|
776
|
-
gap: 12,
|
|
777
|
-
},
|
|
778
|
-
gatedPreview: {
|
|
779
|
-
// No flex: 1 so it doesn't try to fill remaining space
|
|
780
|
-
},
|
|
781
|
-
});
|