@buoy-gg/highlight-updates 7.0.41 → 7.0.42
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/README.md +11 -71
- package/lib/commonjs/highlight-updates/HighlightUpdatesOverlay.js +1 -281
- package/lib/commonjs/highlight-updates/components/HighlightFilterView.js +1 -1474
- package/lib/commonjs/highlight-updates/components/HighlightUpdatesModal.js +1 -641
- package/lib/commonjs/highlight-updates/components/IdentifierBadge.js +1 -273
- package/lib/commonjs/highlight-updates/components/IsolatedRenderList.js +1 -188
- package/lib/commonjs/highlight-updates/components/ModalHeaderContent.js +1 -293
- package/lib/commonjs/highlight-updates/components/RenderCauseBadge.js +1 -508
- package/lib/commonjs/highlight-updates/components/RenderDetailView.js +1 -846
- package/lib/commonjs/highlight-updates/components/RenderHistoryViewer.js +1 -915
- package/lib/commonjs/highlight-updates/components/RenderListItem.js +1 -235
- package/lib/commonjs/highlight-updates/components/RendersCopySettingsView.js +1 -469
- package/lib/commonjs/highlight-updates/components/StatsDisplay.js +1 -73
- package/lib/commonjs/highlight-updates/types/copySettings.js +1 -107
- package/lib/commonjs/highlight-updates/utils/CommitProfiler.js +1 -455
- package/lib/commonjs/highlight-updates/utils/HighlightUpdatesController.js +1 -1929
- package/lib/commonjs/highlight-updates/utils/PerformanceLogger.js +26 -359
- package/lib/commonjs/highlight-updates/utils/ProfilerInterceptor.js +1 -371
- package/lib/commonjs/highlight-updates/utils/RenderCauseDetector.js +5 -1840
- package/lib/commonjs/highlight-updates/utils/RenderTracker.js +1 -952
- package/lib/commonjs/highlight-updates/utils/ViewTypeMapper.js +1 -264
- package/lib/commonjs/highlight-updates/utils/copySettingsStorage.js +1 -32
- package/lib/commonjs/highlight-updates/utils/devtoolsComponentNames.js +1 -188
- package/lib/commonjs/highlight-updates/utils/namedComposite.js +1 -41
- package/lib/commonjs/highlight-updates/utils/ownStateChanged.js +1 -103
- package/lib/commonjs/highlight-updates/utils/rawEventEmitter.js +1 -50
- package/lib/commonjs/highlight-updates/utils/rawEventEmitter.web.js +1 -12
- package/lib/commonjs/highlight-updates/utils/renderExportFormatter.js +1 -58
- package/lib/commonjs/highlight-updates/utils/rendersExportFormatter.js +1 -485
- package/lib/commonjs/highlight-updates/utils/screenElements.js +1 -1269
- package/lib/commonjs/highlight-updates/utils/tapMatch.js +1 -83
- package/lib/commonjs/highlight-updates/utils/testIDs.js +1 -68
- package/lib/commonjs/highlight-updates/utils/touchCapture.js +1 -277
- package/lib/commonjs/index.js +1 -429
- package/lib/commonjs/preset.js +1 -278
- package/lib/commonjs/sync/highlightUpdatesSyncAdapter.js +1 -235
- package/lib/module/highlight-updates/HighlightUpdatesOverlay.js +1 -274
- package/lib/module/highlight-updates/components/HighlightFilterView.js +1 -1468
- package/lib/module/highlight-updates/components/HighlightUpdatesModal.js +1 -634
- package/lib/module/highlight-updates/components/IdentifierBadge.js +1 -265
- package/lib/module/highlight-updates/components/IsolatedRenderList.js +1 -183
- package/lib/module/highlight-updates/components/ModalHeaderContent.js +1 -288
- package/lib/module/highlight-updates/components/RenderCauseBadge.js +1 -499
- package/lib/module/highlight-updates/components/RenderDetailView.js +1 -840
- package/lib/module/highlight-updates/components/RenderHistoryViewer.js +1 -908
- package/lib/module/highlight-updates/components/RenderListItem.js +1 -230
- package/lib/module/highlight-updates/components/RendersCopySettingsView.js +1 -465
- package/lib/module/highlight-updates/components/StatsDisplay.js +1 -70
- package/lib/module/highlight-updates/types/copySettings.js +1 -102
- package/lib/module/highlight-updates/utils/CommitProfiler.js +1 -451
- package/lib/module/highlight-updates/utils/HighlightUpdatesController.js +1 -1925
- package/lib/module/highlight-updates/utils/PerformanceLogger.js +26 -353
- package/lib/module/highlight-updates/utils/ProfilerInterceptor.js +1 -358
- package/lib/module/highlight-updates/utils/RenderCauseDetector.js +5 -1830
- package/lib/module/highlight-updates/utils/RenderTracker.js +1 -949
- package/lib/module/highlight-updates/utils/ViewTypeMapper.js +1 -255
- package/lib/module/highlight-updates/utils/copySettingsStorage.js +1 -26
- package/lib/module/highlight-updates/utils/devtoolsComponentNames.js +1 -178
- package/lib/module/highlight-updates/utils/namedComposite.js +1 -36
- package/lib/module/highlight-updates/utils/ownStateChanged.js +1 -98
- package/lib/module/highlight-updates/utils/rawEventEmitter.js +1 -46
- package/lib/module/highlight-updates/utils/rawEventEmitter.web.js +1 -3
- package/lib/module/highlight-updates/utils/renderExportFormatter.js +1 -54
- package/lib/module/highlight-updates/utils/rendersExportFormatter.js +1 -478
- package/lib/module/highlight-updates/utils/screenElements.js +1 -1263
- package/lib/module/highlight-updates/utils/tapMatch.js +1 -76
- package/lib/module/highlight-updates/utils/testIDs.js +1 -60
- package/lib/module/highlight-updates/utils/touchCapture.js +1 -270
- package/lib/module/index.js +1 -130
- package/lib/module/preset.js +1 -272
- package/lib/module/sync/highlightUpdatesSyncAdapter.js +1 -230
- package/lib/web/index.mjs +28 -29
- package/package.json +7 -7
- package/lib/typescript/highlight-updates/HighlightUpdatesOverlay.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/HighlightFilterView.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/HighlightUpdatesModal.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/IdentifierBadge.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/IsolatedRenderList.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/ModalHeaderContent.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/RenderCauseBadge.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/RenderDetailView.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/RenderHistoryViewer.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/RenderListItem.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/RendersCopySettingsView.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/StatsDisplay.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/types/copySettings.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/CommitProfiler.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/PerformanceLogger.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/ProfilerInterceptor.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/RenderCauseDetector.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/RenderTracker.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/ViewTypeMapper.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/copySettingsStorage.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/devtoolsComponentNames.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/namedComposite.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/ownStateChanged.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/rawEventEmitter.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/rawEventEmitter.web.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/renderExportFormatter.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/rendersExportFormatter.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/screenElements.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/tapMatch.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/testIDs.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/touchCapture.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
- package/lib/typescript/sync/highlightUpdatesSyncAdapter.d.ts.map +0 -1
|
@@ -1,908 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* RenderHistoryViewer
|
|
5
|
-
*
|
|
6
|
-
* Displays render history for a component with event stepping.
|
|
7
|
-
* Allows navigating through render events chronologically.
|
|
8
|
-
* Shows current state view or diff view between renders.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import React, { useState, useCallback, useMemo } from "react";
|
|
12
|
-
import { View, Text, TouchableOpacity, ScrollView, StyleSheet } from "react-native";
|
|
13
|
-
import { Clock, GitBranch, Database, Lock, formatRelativeTime, SectionHeader, EventStepperFooter, buoyColors, night, useLimit, ToolEmptyState, monoFont } from "@buoy-gg/shared-ui";
|
|
14
|
-
import { TreeDiffViewer } from "@buoy-gg/shared-ui/dataViewer";
|
|
15
|
-
import { RenderTracker } from "../utils/RenderTracker";
|
|
16
|
-
import { EnhancedCauseDisplay, CAUSE_CONFIG } from "./RenderCauseBadge";
|
|
17
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
|
-
/**
|
|
19
|
-
* `HH:MM:SS.mmm` — the same shape Redux, Zustand and Jotai print for the same
|
|
20
|
-
* job, and for the same reason: the milliseconds are the point.
|
|
21
|
-
*
|
|
22
|
-
* Built by hand rather than from `toLocaleTimeString`, which appends the day
|
|
23
|
-
* period on a 12-hour locale — so concatenating the milliseconds to the end of
|
|
24
|
-
* it produced "8:21:44 AM.351", with the fraction attached to the wrong part
|
|
25
|
-
* of the time. It also made the string depend on the hour of day, which is a
|
|
26
|
-
* fine way to have a test that only passes after 10am.
|
|
27
|
-
*/
|
|
28
|
-
function formatTimeWithMs(timestamp) {
|
|
29
|
-
const date = new Date(timestamp);
|
|
30
|
-
const h = date.getHours().toString().padStart(2, "0");
|
|
31
|
-
const m = date.getMinutes().toString().padStart(2, "0");
|
|
32
|
-
const s = date.getSeconds().toString().padStart(2, "0");
|
|
33
|
-
const ms = date.getMilliseconds().toString().padStart(3, "0");
|
|
34
|
-
return `${h}:${m}:${s}.${ms}`;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Main RenderHistoryViewer component
|
|
39
|
-
*/
|
|
40
|
-
export function RenderHistoryViewer({
|
|
41
|
-
render,
|
|
42
|
-
disableInternalFooter = false,
|
|
43
|
-
selectedEventIndex: externalIndex,
|
|
44
|
-
onEventIndexChange: externalOnChange,
|
|
45
|
-
isPro = false
|
|
46
|
-
}) {
|
|
47
|
-
// Internal state for event index when not controlled externally
|
|
48
|
-
const [internalIndex, setInternalIndex] = useState(0);
|
|
49
|
-
|
|
50
|
-
// Use external or internal state
|
|
51
|
-
const selectedEventIndex = externalIndex ?? internalIndex;
|
|
52
|
-
const onEventIndexChange = externalOnChange ?? setInternalIndex;
|
|
53
|
-
|
|
54
|
-
// View mode: "current" shows selected event, "diff" shows comparison
|
|
55
|
-
const [activeView, setActiveView] = useState("current");
|
|
56
|
-
|
|
57
|
-
// Get all events sorted by timestamp (oldest first)
|
|
58
|
-
const allEvents = useMemo(() => {
|
|
59
|
-
if (!render.renderHistory || render.renderHistory.length === 0) {
|
|
60
|
-
return [];
|
|
61
|
-
}
|
|
62
|
-
return [...render.renderHistory].sort((a, b) => a.timestamp - b.timestamp);
|
|
63
|
-
}, [render.renderHistory]);
|
|
64
|
-
|
|
65
|
-
// `isPro` stays a prop so callers can force the unlimited view; the tier cap
|
|
66
|
-
// applies otherwise. useLimit() already returns Infinity for Pro, so the two
|
|
67
|
-
// agree — this only preserves the prop contract for cross-package callers.
|
|
68
|
-
const tierLimit = useLimit("highlightUpdates.historyEvents");
|
|
69
|
-
const eventLimit = isPro ? Infinity : tierLimit;
|
|
70
|
-
|
|
71
|
-
// Show the most recent N events (negative index clamps to 0, so an
|
|
72
|
-
// unlimited tier returns the whole list).
|
|
73
|
-
const events = useMemo(() => allEvents.slice(-eventLimit), [allEvents, eventLimit]);
|
|
74
|
-
const lockedEventCount = useMemo(() => Math.max(0, allEvents.length - eventLimit), [allEvents.length, eventLimit]);
|
|
75
|
-
const totalEvents = events.length;
|
|
76
|
-
const currentEvent = events[selectedEventIndex];
|
|
77
|
-
const previousEvent = selectedEventIndex > 0 ? events[selectedEventIndex - 1] : null;
|
|
78
|
-
|
|
79
|
-
// Navigation handlers
|
|
80
|
-
const goToPrevious = useCallback(() => {
|
|
81
|
-
if (selectedEventIndex > 0) {
|
|
82
|
-
onEventIndexChange(selectedEventIndex - 1);
|
|
83
|
-
}
|
|
84
|
-
}, [selectedEventIndex, onEventIndexChange]);
|
|
85
|
-
const goToNext = useCallback(() => {
|
|
86
|
-
if (selectedEventIndex < totalEvents - 1) {
|
|
87
|
-
onEventIndexChange(selectedEventIndex + 1);
|
|
88
|
-
}
|
|
89
|
-
}, [selectedEventIndex, totalEvents, onEventIndexChange]);
|
|
90
|
-
|
|
91
|
-
// If no history, show empty state
|
|
92
|
-
if (totalEvents === 0) {
|
|
93
|
-
// The copy used to tell EVERYONE to go and enable the setting, including
|
|
94
|
-
// the people who already had. Asking the tracker which it is costs one
|
|
95
|
-
// synchronous read on a branch that renders nothing else.
|
|
96
|
-
const historyEnabled = RenderTracker.getSettings().enableRenderHistory;
|
|
97
|
-
return /*#__PURE__*/_jsx(ToolEmptyState, {
|
|
98
|
-
testID: "buoy-highlight-history-empty"
|
|
99
|
-
// paused = the recorder is switched off; stare = armed and watching,
|
|
100
|
-
// which is the truth once the setting is on and this component simply
|
|
101
|
-
// has not re-rendered yet.
|
|
102
|
-
,
|
|
103
|
-
otto: historyEnabled ? "stare" : "paused",
|
|
104
|
-
title: "No Render History",
|
|
105
|
-
message: historyEnabled ? "History is on and armed — this component has not re-rendered since. Interact with the app to record one." : "Enable render history tracking in settings to see render events here."
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
109
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
110
|
-
style: [styles.container, {
|
|
111
|
-
paddingBottom: !disableInternalFooter && totalEvents > 1 ? 80 : 0
|
|
112
|
-
}],
|
|
113
|
-
children: [lockedEventCount > 0 && /*#__PURE__*/_jsxs(View, {
|
|
114
|
-
testID: "buoy-highlight-history-locked",
|
|
115
|
-
style: styles.lockedBanner,
|
|
116
|
-
children: [/*#__PURE__*/_jsx(Lock, {
|
|
117
|
-
size: 14,
|
|
118
|
-
color: night.color.warning
|
|
119
|
-
}), /*#__PURE__*/_jsxs(Text, {
|
|
120
|
-
testID: "buoy-highlight-history-locked-text",
|
|
121
|
-
style: styles.lockedBannerText,
|
|
122
|
-
children: [lockedEventCount, " older ", lockedEventCount === 1 ? 'render' : 'renders', " locked"]
|
|
123
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
124
|
-
style: styles.lockedBannerSubtext,
|
|
125
|
-
children: "Upgrade to Pro"
|
|
126
|
-
})]
|
|
127
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
128
|
-
style: styles.viewToggleContainer,
|
|
129
|
-
children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
130
|
-
testID: "buoy-highlight-history-mode-current",
|
|
131
|
-
accessibilityRole: "button",
|
|
132
|
-
accessibilityLabel: "Current state",
|
|
133
|
-
style: [styles.viewToggleCard, activeView === "current" && styles.viewToggleCardActive],
|
|
134
|
-
onPress: () => setActiveView("current"),
|
|
135
|
-
activeOpacity: 0.8,
|
|
136
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
137
|
-
style: styles.viewToggleContent,
|
|
138
|
-
children: [/*#__PURE__*/_jsx(Database, {
|
|
139
|
-
size: 16,
|
|
140
|
-
color: activeView === "current" ? night.color.accent : night.color.textSecondary
|
|
141
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
142
|
-
style: [styles.viewToggleLabel, activeView === "current" && styles.viewToggleLabelActive],
|
|
143
|
-
children: "CURRENT STATE"
|
|
144
|
-
})]
|
|
145
|
-
}), /*#__PURE__*/_jsxs(Text, {
|
|
146
|
-
style: [styles.viewToggleDescription, activeView === "current" && {
|
|
147
|
-
color: night.color.text
|
|
148
|
-
}],
|
|
149
|
-
children: ["View render #", currentEvent?.renderNumber ?? 0, " details"]
|
|
150
|
-
})]
|
|
151
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
152
|
-
testID: "buoy-highlight-history-mode-diff",
|
|
153
|
-
accessibilityLabel: "Diff view, coming soon",
|
|
154
|
-
style: [styles.viewToggleCard, styles.viewToggleCardDisabled],
|
|
155
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
156
|
-
style: styles.viewToggleContent,
|
|
157
|
-
children: [/*#__PURE__*/_jsx(GitBranch, {
|
|
158
|
-
size: 16,
|
|
159
|
-
color: night.color.textTertiary
|
|
160
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
161
|
-
style: [styles.viewToggleLabel, styles.viewToggleLabelDisabled],
|
|
162
|
-
children: "DIFF VIEW"
|
|
163
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
164
|
-
style: styles.todoBadge,
|
|
165
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
166
|
-
style: styles.todoBadgeText,
|
|
167
|
-
children: "TODO"
|
|
168
|
-
})
|
|
169
|
-
})]
|
|
170
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
171
|
-
style: [styles.viewToggleDescription, {
|
|
172
|
-
color: night.color.textTertiary
|
|
173
|
-
}],
|
|
174
|
-
children: "Compare renders side by side (coming soon)"
|
|
175
|
-
})]
|
|
176
|
-
})]
|
|
177
|
-
}), /*#__PURE__*/_jsx(ScrollView, {
|
|
178
|
-
testID: "buoy-highlight-history-scroll",
|
|
179
|
-
style: styles.contentScroll,
|
|
180
|
-
contentContainerStyle: styles.contentContainer,
|
|
181
|
-
showsVerticalScrollIndicator: false,
|
|
182
|
-
children: activeView === "current" ? /*#__PURE__*/_jsx(CurrentStateView, {
|
|
183
|
-
event: currentEvent,
|
|
184
|
-
render: render
|
|
185
|
-
}) : /*#__PURE__*/_jsx(DiffView, {
|
|
186
|
-
previousEvent: previousEvent,
|
|
187
|
-
currentEvent: currentEvent,
|
|
188
|
-
render: render
|
|
189
|
-
})
|
|
190
|
-
})]
|
|
191
|
-
}), !disableInternalFooter && /*#__PURE__*/_jsx(EventStepperFooter, {
|
|
192
|
-
currentIndex: selectedEventIndex,
|
|
193
|
-
totalItems: totalEvents,
|
|
194
|
-
onPrevious: goToPrevious,
|
|
195
|
-
onNext: goToNext,
|
|
196
|
-
itemLabel: "Render",
|
|
197
|
-
subtitle: formatRelativeTime(new Date(currentEvent?.timestamp ?? Date.now()))
|
|
198
|
-
})]
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Current State View - shows details of the selected render event
|
|
204
|
-
*/
|
|
205
|
-
function CurrentStateView({
|
|
206
|
-
event,
|
|
207
|
-
render
|
|
208
|
-
}) {
|
|
209
|
-
if (!event) {
|
|
210
|
-
return /*#__PURE__*/_jsx(View, {
|
|
211
|
-
testID: "buoy-highlight-history-no-event",
|
|
212
|
-
style: styles.noEventContainer,
|
|
213
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
214
|
-
style: styles.noEventText,
|
|
215
|
-
children: "No event selected"
|
|
216
|
-
})
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
const causeConfig = CAUSE_CONFIG[event.cause.type];
|
|
220
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
221
|
-
style: styles.currentStateContainer,
|
|
222
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
223
|
-
style: styles.eventHeader,
|
|
224
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
225
|
-
style: styles.eventHeaderLeft,
|
|
226
|
-
children: [/*#__PURE__*/_jsxs(Text, {
|
|
227
|
-
testID: "buoy-highlight-history-event-title",
|
|
228
|
-
style: styles.eventTitle,
|
|
229
|
-
children: ["Render #", event.renderNumber]
|
|
230
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
231
|
-
testID: "buoy-highlight-history-event-time",
|
|
232
|
-
style: styles.eventTime,
|
|
233
|
-
children: formatTimeWithMs(event.timestamp)
|
|
234
|
-
})]
|
|
235
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
236
|
-
style: [styles.eventBadge, {
|
|
237
|
-
backgroundColor: render.color + "30"
|
|
238
|
-
}],
|
|
239
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
240
|
-
style: [styles.eventBadgeDot, {
|
|
241
|
-
backgroundColor: render.color
|
|
242
|
-
}]
|
|
243
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
244
|
-
testID: "buoy-highlight-history-event-cause",
|
|
245
|
-
style: [styles.eventBadgeText, {
|
|
246
|
-
color: render.color
|
|
247
|
-
}],
|
|
248
|
-
children: event.cause.type.toUpperCase()
|
|
249
|
-
})]
|
|
250
|
-
})]
|
|
251
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
252
|
-
style: styles.section,
|
|
253
|
-
children: [/*#__PURE__*/_jsxs(SectionHeader, {
|
|
254
|
-
children: [/*#__PURE__*/_jsx(SectionHeader.Icon, {
|
|
255
|
-
icon: Clock,
|
|
256
|
-
color: causeConfig.color,
|
|
257
|
-
size: 12
|
|
258
|
-
}), /*#__PURE__*/_jsx(SectionHeader.Title, {
|
|
259
|
-
children: "WHY DID THIS RENDER?"
|
|
260
|
-
})]
|
|
261
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
262
|
-
style: styles.sectionContent,
|
|
263
|
-
children: /*#__PURE__*/_jsx(EnhancedCauseDisplay, {
|
|
264
|
-
cause: event.cause,
|
|
265
|
-
nativeType: render.viewType
|
|
266
|
-
})
|
|
267
|
-
})]
|
|
268
|
-
}), event.capturedProps && Object.keys(event.capturedProps).length > 0 && /*#__PURE__*/_jsxs(View, {
|
|
269
|
-
style: styles.section,
|
|
270
|
-
children: [/*#__PURE__*/_jsxs(SectionHeader, {
|
|
271
|
-
children: [/*#__PURE__*/_jsx(SectionHeader.Icon, {
|
|
272
|
-
icon: Database,
|
|
273
|
-
color: night.color.accent,
|
|
274
|
-
size: 12
|
|
275
|
-
}), /*#__PURE__*/_jsx(SectionHeader.Title, {
|
|
276
|
-
children: "CAPTURED PROPS"
|
|
277
|
-
})]
|
|
278
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
279
|
-
style: styles.sectionContent,
|
|
280
|
-
children: /*#__PURE__*/_jsx(ScrollView, {
|
|
281
|
-
horizontal: true,
|
|
282
|
-
showsHorizontalScrollIndicator: false,
|
|
283
|
-
style: styles.propsScrollView,
|
|
284
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
285
|
-
testID: "buoy-highlight-history-props",
|
|
286
|
-
style: styles.propsJson,
|
|
287
|
-
children: JSON.stringify(event.capturedProps, null, 2)
|
|
288
|
-
})
|
|
289
|
-
})
|
|
290
|
-
})]
|
|
291
|
-
})]
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* Diff mode types
|
|
297
|
-
*/
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Diff View - shows comparison between two render events
|
|
301
|
-
*/
|
|
302
|
-
function DiffView({
|
|
303
|
-
previousEvent,
|
|
304
|
-
currentEvent,
|
|
305
|
-
render
|
|
306
|
-
}) {
|
|
307
|
-
// Diff mode tab state
|
|
308
|
-
const [diffMode, setDiffMode] = useState("props");
|
|
309
|
-
if (!previousEvent || !currentEvent) {
|
|
310
|
-
return /*#__PURE__*/_jsx(View, {
|
|
311
|
-
style: styles.noEventContainer,
|
|
312
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
313
|
-
style: styles.noEventText,
|
|
314
|
-
children: "Select an event with a previous event to compare"
|
|
315
|
-
})
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
const prevCauseConfig = CAUSE_CONFIG[previousEvent.cause.type];
|
|
319
|
-
const currCauseConfig = CAUSE_CONFIG[currentEvent.cause.type];
|
|
320
|
-
|
|
321
|
-
// Check what data is available for diff
|
|
322
|
-
const hasPropsData = previousEvent.capturedProps && currentEvent.capturedProps;
|
|
323
|
-
const hasStateData = previousEvent.capturedState && currentEvent.capturedState;
|
|
324
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
325
|
-
style: styles.diffContainer,
|
|
326
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
327
|
-
style: styles.compareBar,
|
|
328
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
329
|
-
style: styles.compareSide,
|
|
330
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
331
|
-
style: styles.compareLabelRow,
|
|
332
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
333
|
-
style: [styles.compareLabel, {
|
|
334
|
-
color: buoyColors.warning
|
|
335
|
-
}],
|
|
336
|
-
children: "PREV"
|
|
337
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
338
|
-
style: [styles.compareActionBadge, {
|
|
339
|
-
backgroundColor: `${prevCauseConfig.color}20`
|
|
340
|
-
}],
|
|
341
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
342
|
-
style: [styles.compareActionText, {
|
|
343
|
-
color: prevCauseConfig.color
|
|
344
|
-
}],
|
|
345
|
-
children: previousEvent.cause.type.toUpperCase()
|
|
346
|
-
})
|
|
347
|
-
})]
|
|
348
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
349
|
-
style: styles.compareMeta,
|
|
350
|
-
children: [/*#__PURE__*/_jsxs(Text, {
|
|
351
|
-
style: styles.compareIndex,
|
|
352
|
-
children: ["#", previousEvent.renderNumber]
|
|
353
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
354
|
-
style: styles.compareTime,
|
|
355
|
-
children: formatTimeWithMs(previousEvent.timestamp)
|
|
356
|
-
})]
|
|
357
|
-
})]
|
|
358
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
359
|
-
style: styles.compareDivider,
|
|
360
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
361
|
-
style: styles.compareArrow,
|
|
362
|
-
children: "\u2192"
|
|
363
|
-
})
|
|
364
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
365
|
-
style: styles.compareSide,
|
|
366
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
367
|
-
style: styles.compareLabelRow,
|
|
368
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
369
|
-
style: [styles.compareLabel, {
|
|
370
|
-
color: buoyColors.success
|
|
371
|
-
}],
|
|
372
|
-
children: "CUR"
|
|
373
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
374
|
-
style: [styles.compareActionBadge, {
|
|
375
|
-
backgroundColor: `${currCauseConfig.color}20`
|
|
376
|
-
}],
|
|
377
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
378
|
-
style: [styles.compareActionText, {
|
|
379
|
-
color: currCauseConfig.color
|
|
380
|
-
}],
|
|
381
|
-
children: currentEvent.cause.type.toUpperCase()
|
|
382
|
-
})
|
|
383
|
-
})]
|
|
384
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
385
|
-
style: styles.compareMeta,
|
|
386
|
-
children: [/*#__PURE__*/_jsxs(Text, {
|
|
387
|
-
style: styles.compareIndex,
|
|
388
|
-
children: ["#", currentEvent.renderNumber]
|
|
389
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
390
|
-
style: styles.compareTime,
|
|
391
|
-
children: formatTimeWithMs(currentEvent.timestamp)
|
|
392
|
-
})]
|
|
393
|
-
})]
|
|
394
|
-
})]
|
|
395
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
396
|
-
style: styles.diffModeTabs,
|
|
397
|
-
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
398
|
-
style: [styles.diffModeTab, diffMode === "cause" && styles.diffModeTabActive],
|
|
399
|
-
onPress: () => setDiffMode("cause"),
|
|
400
|
-
activeOpacity: 0.7,
|
|
401
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
402
|
-
style: [styles.diffModeTabText, diffMode === "cause" && styles.diffModeTabTextActive],
|
|
403
|
-
children: "CAUSE"
|
|
404
|
-
})
|
|
405
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
406
|
-
style: [styles.diffModeTab, diffMode === "props" && styles.diffModeTabActive, !hasPropsData && styles.diffModeTabDisabled],
|
|
407
|
-
onPress: () => hasPropsData && setDiffMode("props"),
|
|
408
|
-
activeOpacity: hasPropsData ? 0.7 : 1,
|
|
409
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
410
|
-
style: [styles.diffModeTabText, diffMode === "props" && styles.diffModeTabTextActive, !hasPropsData && styles.diffModeTabTextDisabled],
|
|
411
|
-
children: "PROPS"
|
|
412
|
-
})
|
|
413
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
414
|
-
style: [styles.diffModeTab, diffMode === "state" && styles.diffModeTabActive, !hasStateData && styles.diffModeTabDisabled],
|
|
415
|
-
onPress: () => hasStateData && setDiffMode("state"),
|
|
416
|
-
activeOpacity: hasStateData ? 0.7 : 1,
|
|
417
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
418
|
-
style: [styles.diffModeTabText, diffMode === "state" && styles.diffModeTabTextActive, !hasStateData && styles.diffModeTabTextDisabled],
|
|
419
|
-
children: "STATE"
|
|
420
|
-
})
|
|
421
|
-
})]
|
|
422
|
-
}), diffMode === "cause" && /*#__PURE__*/_jsx(View, {
|
|
423
|
-
style: styles.diffSummary,
|
|
424
|
-
children: /*#__PURE__*/_jsx(EnhancedCauseDisplay, {
|
|
425
|
-
cause: currentEvent.cause,
|
|
426
|
-
nativeType: render.viewType
|
|
427
|
-
})
|
|
428
|
-
}), diffMode === "props" && /*#__PURE__*/_jsx(View, {
|
|
429
|
-
style: styles.treeDiffContainer,
|
|
430
|
-
children: hasPropsData ? /*#__PURE__*/_jsx(TreeDiffViewer, {
|
|
431
|
-
oldValue: previousEvent.capturedProps,
|
|
432
|
-
newValue: currentEvent.capturedProps,
|
|
433
|
-
theme: "dark",
|
|
434
|
-
showUnchanged: true
|
|
435
|
-
}) : /*#__PURE__*/_jsxs(View, {
|
|
436
|
-
style: styles.noDiffData,
|
|
437
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
438
|
-
style: styles.noDiffDataTitle,
|
|
439
|
-
children: "Props Not Captured"
|
|
440
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
441
|
-
style: styles.noDiffDataText,
|
|
442
|
-
children: "Enable \"Capture Props on Render\" in settings to see props diff."
|
|
443
|
-
})]
|
|
444
|
-
})
|
|
445
|
-
}), diffMode === "state" && /*#__PURE__*/_jsx(View, {
|
|
446
|
-
style: styles.treeDiffContainer,
|
|
447
|
-
children: hasStateData ? /*#__PURE__*/_jsx(TreeDiffViewer, {
|
|
448
|
-
oldValue: previousEvent.capturedState,
|
|
449
|
-
newValue: currentEvent.capturedState,
|
|
450
|
-
theme: "dark",
|
|
451
|
-
showUnchanged: true
|
|
452
|
-
}) : /*#__PURE__*/_jsxs(View, {
|
|
453
|
-
style: styles.noDiffData,
|
|
454
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
455
|
-
style: styles.noDiffDataTitle,
|
|
456
|
-
children: "State Not Captured"
|
|
457
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
458
|
-
style: styles.noDiffDataText,
|
|
459
|
-
children: "Enable \"Capture State on Render\" in settings to see state diff."
|
|
460
|
-
})]
|
|
461
|
-
})
|
|
462
|
-
})]
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
/**
|
|
467
|
-
* External footer component for modal integration
|
|
468
|
-
* Uses renderHistory for events (only available when history tracking is enabled)
|
|
469
|
-
*/
|
|
470
|
-
export function RenderHistoryFooter({
|
|
471
|
-
render,
|
|
472
|
-
selectedEventIndex = 0,
|
|
473
|
-
onEventIndexChange = () => {},
|
|
474
|
-
isPro = false
|
|
475
|
-
}) {
|
|
476
|
-
// Get all events from render history (sorted by timestamp)
|
|
477
|
-
const allEvents = useMemo(() => {
|
|
478
|
-
if (!render.renderHistory || render.renderHistory.length === 0) {
|
|
479
|
-
return [];
|
|
480
|
-
}
|
|
481
|
-
return [...render.renderHistory].sort((a, b) => a.timestamp - b.timestamp);
|
|
482
|
-
}, [render.renderHistory]);
|
|
483
|
-
|
|
484
|
-
// Same cap as RenderHistoryViewer above; `isPro` remains a caller override.
|
|
485
|
-
const tierLimit = useLimit("highlightUpdates.historyEvents");
|
|
486
|
-
const eventLimit = isPro ? Infinity : tierLimit;
|
|
487
|
-
|
|
488
|
-
// Most recent N (negative index clamps to 0, so unlimited returns all).
|
|
489
|
-
const events = useMemo(() => allEvents.slice(-eventLimit), [allEvents, eventLimit]);
|
|
490
|
-
const totalEvents = events.length;
|
|
491
|
-
const currentEvent = events[selectedEventIndex];
|
|
492
|
-
const goToPrevious = useCallback(() => {
|
|
493
|
-
onEventIndexChange(Math.max(0, selectedEventIndex - 1));
|
|
494
|
-
}, [selectedEventIndex, onEventIndexChange]);
|
|
495
|
-
const goToNext = useCallback(() => {
|
|
496
|
-
onEventIndexChange(Math.min(totalEvents - 1, selectedEventIndex + 1));
|
|
497
|
-
}, [selectedEventIndex, totalEvents, onEventIndexChange]);
|
|
498
|
-
|
|
499
|
-
// Don't render if no history events (history tracking might be disabled)
|
|
500
|
-
if (totalEvents <= 1) {
|
|
501
|
-
return null;
|
|
502
|
-
}
|
|
503
|
-
return /*#__PURE__*/_jsx(EventStepperFooter, {
|
|
504
|
-
currentIndex: selectedEventIndex,
|
|
505
|
-
totalItems: totalEvents,
|
|
506
|
-
onPrevious: goToPrevious,
|
|
507
|
-
onNext: goToNext,
|
|
508
|
-
itemLabel: "Render",
|
|
509
|
-
subtitle: currentEvent ? formatRelativeTime(new Date(currentEvent.timestamp)) : undefined
|
|
510
|
-
});
|
|
511
|
-
}
|
|
512
|
-
const styles = StyleSheet.create({
|
|
513
|
-
container: {
|
|
514
|
-
flex: 1,
|
|
515
|
-
// Transparent so JsModal's ToolBackground shows through (the modal paints opaque base beneath it).
|
|
516
|
-
backgroundColor: "transparent"
|
|
517
|
-
},
|
|
518
|
-
emptyContainer: {
|
|
519
|
-
flex: 1,
|
|
520
|
-
alignItems: "center",
|
|
521
|
-
justifyContent: "center",
|
|
522
|
-
padding: 32,
|
|
523
|
-
gap: 12
|
|
524
|
-
},
|
|
525
|
-
emptyTitle: {
|
|
526
|
-
fontSize: 16,
|
|
527
|
-
fontWeight: "600",
|
|
528
|
-
color: night.color.text
|
|
529
|
-
},
|
|
530
|
-
emptyText: {
|
|
531
|
-
fontSize: 13,
|
|
532
|
-
color: night.color.textSecondary,
|
|
533
|
-
textAlign: "center",
|
|
534
|
-
lineHeight: 18
|
|
535
|
-
},
|
|
536
|
-
viewToggleContainer: {
|
|
537
|
-
flexDirection: "row",
|
|
538
|
-
padding: 12,
|
|
539
|
-
gap: 8
|
|
540
|
-
},
|
|
541
|
-
viewToggleCard: {
|
|
542
|
-
flex: 1,
|
|
543
|
-
backgroundColor: night.color.surface,
|
|
544
|
-
borderRadius: 8,
|
|
545
|
-
borderWidth: 1,
|
|
546
|
-
borderColor: night.color.border,
|
|
547
|
-
padding: 10,
|
|
548
|
-
gap: 4
|
|
549
|
-
},
|
|
550
|
-
viewToggleCardActive: {
|
|
551
|
-
borderColor: night.color.accentBorderStrong,
|
|
552
|
-
backgroundColor: night.color.accentSoft
|
|
553
|
-
},
|
|
554
|
-
viewToggleCardDisabled: {
|
|
555
|
-
opacity: 0.5
|
|
556
|
-
},
|
|
557
|
-
todoBadge: {
|
|
558
|
-
backgroundColor: night.color.fillSecondary,
|
|
559
|
-
paddingHorizontal: 6,
|
|
560
|
-
paddingVertical: 2,
|
|
561
|
-
borderRadius: 4,
|
|
562
|
-
marginLeft: 4
|
|
563
|
-
},
|
|
564
|
-
todoBadgeText: {
|
|
565
|
-
fontSize: 9,
|
|
566
|
-
fontWeight: "700",
|
|
567
|
-
color: night.color.textTertiary,
|
|
568
|
-
letterSpacing: 0.3
|
|
569
|
-
},
|
|
570
|
-
viewToggleContent: {
|
|
571
|
-
flexDirection: "row",
|
|
572
|
-
alignItems: "center",
|
|
573
|
-
gap: 6
|
|
574
|
-
},
|
|
575
|
-
viewToggleLabel: {
|
|
576
|
-
fontSize: 10,
|
|
577
|
-
fontWeight: "700",
|
|
578
|
-
color: night.color.textSecondary,
|
|
579
|
-
letterSpacing: 0.5
|
|
580
|
-
},
|
|
581
|
-
viewToggleLabelActive: {
|
|
582
|
-
color: night.color.accent
|
|
583
|
-
},
|
|
584
|
-
viewToggleLabelDisabled: {
|
|
585
|
-
color: night.color.textTertiary
|
|
586
|
-
},
|
|
587
|
-
viewToggleDescription: {
|
|
588
|
-
fontSize: 11,
|
|
589
|
-
color: night.color.textTertiary,
|
|
590
|
-
marginTop: 2
|
|
591
|
-
},
|
|
592
|
-
contentScroll: {
|
|
593
|
-
flex: 1
|
|
594
|
-
},
|
|
595
|
-
contentContainer: {
|
|
596
|
-
padding: 12,
|
|
597
|
-
paddingTop: 0
|
|
598
|
-
},
|
|
599
|
-
noEventContainer: {
|
|
600
|
-
padding: 24,
|
|
601
|
-
alignItems: "center"
|
|
602
|
-
},
|
|
603
|
-
noEventText: {
|
|
604
|
-
fontSize: 13,
|
|
605
|
-
color: night.color.textTertiary
|
|
606
|
-
},
|
|
607
|
-
currentStateContainer: {
|
|
608
|
-
gap: 12
|
|
609
|
-
},
|
|
610
|
-
eventHeader: {
|
|
611
|
-
flexDirection: "row",
|
|
612
|
-
alignItems: "center",
|
|
613
|
-
justifyContent: "space-between",
|
|
614
|
-
backgroundColor: night.color.surface,
|
|
615
|
-
borderRadius: 8,
|
|
616
|
-
borderWidth: 1,
|
|
617
|
-
borderColor: night.color.border,
|
|
618
|
-
padding: 12
|
|
619
|
-
},
|
|
620
|
-
eventHeaderLeft: {
|
|
621
|
-
gap: 2
|
|
622
|
-
},
|
|
623
|
-
eventTitle: {
|
|
624
|
-
fontSize: 15,
|
|
625
|
-
fontWeight: "700",
|
|
626
|
-
color: night.color.text
|
|
627
|
-
},
|
|
628
|
-
eventTime: {
|
|
629
|
-
fontSize: 11,
|
|
630
|
-
color: night.color.textTertiary,
|
|
631
|
-
fontFamily: monoFont
|
|
632
|
-
},
|
|
633
|
-
eventBadge: {
|
|
634
|
-
flexDirection: "row",
|
|
635
|
-
alignItems: "center",
|
|
636
|
-
paddingHorizontal: 10,
|
|
637
|
-
paddingVertical: 4,
|
|
638
|
-
borderRadius: 12,
|
|
639
|
-
gap: 6
|
|
640
|
-
},
|
|
641
|
-
eventBadgeDot: {
|
|
642
|
-
width: 6,
|
|
643
|
-
height: 6,
|
|
644
|
-
borderRadius: 3
|
|
645
|
-
},
|
|
646
|
-
eventBadgeText: {
|
|
647
|
-
fontSize: 10,
|
|
648
|
-
fontWeight: "700",
|
|
649
|
-
fontFamily: monoFont
|
|
650
|
-
},
|
|
651
|
-
section: {
|
|
652
|
-
backgroundColor: night.color.surface,
|
|
653
|
-
borderRadius: 8,
|
|
654
|
-
borderWidth: 1,
|
|
655
|
-
borderColor: night.color.border,
|
|
656
|
-
overflow: "hidden"
|
|
657
|
-
},
|
|
658
|
-
sectionContent: {
|
|
659
|
-
padding: 12,
|
|
660
|
-
paddingTop: 8
|
|
661
|
-
},
|
|
662
|
-
causeContainer: {
|
|
663
|
-
marginBottom: 12
|
|
664
|
-
},
|
|
665
|
-
changedList: {
|
|
666
|
-
marginBottom: 12,
|
|
667
|
-
paddingLeft: 4
|
|
668
|
-
},
|
|
669
|
-
changedListTitle: {
|
|
670
|
-
fontSize: 11,
|
|
671
|
-
fontWeight: "600",
|
|
672
|
-
color: night.color.textSecondary,
|
|
673
|
-
marginBottom: 6
|
|
674
|
-
},
|
|
675
|
-
changedItem: {
|
|
676
|
-
fontSize: 12,
|
|
677
|
-
color: night.color.text,
|
|
678
|
-
fontFamily: monoFont,
|
|
679
|
-
marginBottom: 3,
|
|
680
|
-
paddingLeft: 8
|
|
681
|
-
},
|
|
682
|
-
propsScrollView: {
|
|
683
|
-
maxHeight: 150
|
|
684
|
-
},
|
|
685
|
-
propsJson: {
|
|
686
|
-
fontSize: 11,
|
|
687
|
-
fontFamily: monoFont,
|
|
688
|
-
color: night.color.text,
|
|
689
|
-
// Inset code box — the night track color.
|
|
690
|
-
backgroundColor: night.color.bg,
|
|
691
|
-
padding: 10,
|
|
692
|
-
borderRadius: 6
|
|
693
|
-
},
|
|
694
|
-
diffContainer: {
|
|
695
|
-
gap: 12
|
|
696
|
-
},
|
|
697
|
-
compareBar: {
|
|
698
|
-
flexDirection: "row",
|
|
699
|
-
backgroundColor: night.color.surface,
|
|
700
|
-
borderRadius: 8,
|
|
701
|
-
borderWidth: 1,
|
|
702
|
-
borderColor: night.color.border,
|
|
703
|
-
padding: 10
|
|
704
|
-
},
|
|
705
|
-
compareSide: {
|
|
706
|
-
flex: 1,
|
|
707
|
-
gap: 4
|
|
708
|
-
},
|
|
709
|
-
compareLabelRow: {
|
|
710
|
-
flexDirection: "row",
|
|
711
|
-
alignItems: "center",
|
|
712
|
-
gap: 8
|
|
713
|
-
},
|
|
714
|
-
compareLabel: {
|
|
715
|
-
fontSize: 10,
|
|
716
|
-
fontWeight: "700",
|
|
717
|
-
letterSpacing: 0.5
|
|
718
|
-
},
|
|
719
|
-
compareActionBadge: {
|
|
720
|
-
paddingHorizontal: 6,
|
|
721
|
-
paddingVertical: 2,
|
|
722
|
-
borderRadius: 4
|
|
723
|
-
},
|
|
724
|
-
compareActionText: {
|
|
725
|
-
fontSize: 9,
|
|
726
|
-
fontWeight: "600"
|
|
727
|
-
},
|
|
728
|
-
compareMeta: {
|
|
729
|
-
flexDirection: "row",
|
|
730
|
-
alignItems: "center",
|
|
731
|
-
gap: 6
|
|
732
|
-
},
|
|
733
|
-
compareIndex: {
|
|
734
|
-
fontSize: 12,
|
|
735
|
-
fontWeight: "600",
|
|
736
|
-
color: night.color.text
|
|
737
|
-
},
|
|
738
|
-
compareTime: {
|
|
739
|
-
fontSize: 10,
|
|
740
|
-
color: night.color.textTertiary,
|
|
741
|
-
fontFamily: monoFont
|
|
742
|
-
},
|
|
743
|
-
compareDivider: {
|
|
744
|
-
width: 30,
|
|
745
|
-
alignItems: "center",
|
|
746
|
-
justifyContent: "center"
|
|
747
|
-
},
|
|
748
|
-
compareArrow: {
|
|
749
|
-
fontSize: 16,
|
|
750
|
-
color: night.color.textTertiary
|
|
751
|
-
},
|
|
752
|
-
diffSummary: {
|
|
753
|
-
backgroundColor: night.color.surface,
|
|
754
|
-
borderRadius: 8,
|
|
755
|
-
borderWidth: 1,
|
|
756
|
-
borderColor: night.color.border,
|
|
757
|
-
padding: 12
|
|
758
|
-
},
|
|
759
|
-
diffSummaryTitle: {
|
|
760
|
-
fontSize: 11,
|
|
761
|
-
fontWeight: "600",
|
|
762
|
-
color: night.color.textSecondary,
|
|
763
|
-
marginBottom: 8
|
|
764
|
-
},
|
|
765
|
-
diffChanges: {
|
|
766
|
-
gap: 4
|
|
767
|
-
},
|
|
768
|
-
diffChangeItem: {
|
|
769
|
-
flexDirection: "row",
|
|
770
|
-
alignItems: "center",
|
|
771
|
-
gap: 6
|
|
772
|
-
},
|
|
773
|
-
diffChangeIcon: {
|
|
774
|
-
fontSize: 12,
|
|
775
|
-
fontWeight: "700",
|
|
776
|
-
color: night.color.warning,
|
|
777
|
-
fontFamily: monoFont
|
|
778
|
-
},
|
|
779
|
-
diffChangeKey: {
|
|
780
|
-
fontSize: 12,
|
|
781
|
-
color: night.color.text,
|
|
782
|
-
fontFamily: monoFont
|
|
783
|
-
},
|
|
784
|
-
diffNoChanges: {
|
|
785
|
-
fontSize: 12,
|
|
786
|
-
color: night.color.textTertiary,
|
|
787
|
-
fontStyle: "italic"
|
|
788
|
-
},
|
|
789
|
-
diffPlaceholder: {
|
|
790
|
-
fontSize: 12,
|
|
791
|
-
color: night.color.textTertiary,
|
|
792
|
-
fontStyle: "italic",
|
|
793
|
-
textAlign: "center",
|
|
794
|
-
padding: 16
|
|
795
|
-
},
|
|
796
|
-
// Diff mode tabs
|
|
797
|
-
diffModeTabs: {
|
|
798
|
-
flexDirection: "row",
|
|
799
|
-
backgroundColor: night.color.surface,
|
|
800
|
-
borderRadius: 8,
|
|
801
|
-
borderWidth: 1,
|
|
802
|
-
borderColor: night.color.border,
|
|
803
|
-
padding: 4,
|
|
804
|
-
gap: 4
|
|
805
|
-
},
|
|
806
|
-
diffModeTab: {
|
|
807
|
-
flex: 1,
|
|
808
|
-
paddingVertical: 8,
|
|
809
|
-
paddingHorizontal: 12,
|
|
810
|
-
borderRadius: 6,
|
|
811
|
-
alignItems: "center"
|
|
812
|
-
},
|
|
813
|
-
diffModeTabActive: {
|
|
814
|
-
backgroundColor: night.color.accentSoft
|
|
815
|
-
},
|
|
816
|
-
diffModeTabDisabled: {
|
|
817
|
-
opacity: 0.4
|
|
818
|
-
},
|
|
819
|
-
diffModeTabText: {
|
|
820
|
-
fontSize: 10,
|
|
821
|
-
fontWeight: "600",
|
|
822
|
-
color: night.color.textSecondary,
|
|
823
|
-
letterSpacing: 0.5
|
|
824
|
-
},
|
|
825
|
-
diffModeTabTextActive: {
|
|
826
|
-
color: night.color.accent
|
|
827
|
-
},
|
|
828
|
-
diffModeTabTextDisabled: {
|
|
829
|
-
color: night.color.textTertiary
|
|
830
|
-
},
|
|
831
|
-
// Cause diff styles
|
|
832
|
-
causeDiffContainer: {
|
|
833
|
-
gap: 8,
|
|
834
|
-
marginBottom: 12
|
|
835
|
-
},
|
|
836
|
-
causeDiffRow: {
|
|
837
|
-
flexDirection: "row",
|
|
838
|
-
alignItems: "center",
|
|
839
|
-
gap: 8
|
|
840
|
-
},
|
|
841
|
-
causeDiffLabel: {
|
|
842
|
-
fontSize: 11,
|
|
843
|
-
fontWeight: "600",
|
|
844
|
-
color: night.color.textSecondary,
|
|
845
|
-
minWidth: 80
|
|
846
|
-
},
|
|
847
|
-
causeDiffValue: {
|
|
848
|
-
fontSize: 12,
|
|
849
|
-
color: night.color.text,
|
|
850
|
-
fontFamily: monoFont,
|
|
851
|
-
fontWeight: "500"
|
|
852
|
-
},
|
|
853
|
-
diffChangesTitle: {
|
|
854
|
-
fontSize: 11,
|
|
855
|
-
fontWeight: "600",
|
|
856
|
-
color: night.color.textSecondary,
|
|
857
|
-
marginBottom: 6
|
|
858
|
-
},
|
|
859
|
-
// Tree diff container
|
|
860
|
-
treeDiffContainer: {
|
|
861
|
-
backgroundColor: night.color.surface,
|
|
862
|
-
borderRadius: 8,
|
|
863
|
-
borderWidth: 1,
|
|
864
|
-
borderColor: night.color.border,
|
|
865
|
-
overflow: "hidden",
|
|
866
|
-
minHeight: 150
|
|
867
|
-
},
|
|
868
|
-
noDiffData: {
|
|
869
|
-
padding: 24,
|
|
870
|
-
alignItems: "center",
|
|
871
|
-
gap: 8
|
|
872
|
-
},
|
|
873
|
-
noDiffDataTitle: {
|
|
874
|
-
fontSize: 13,
|
|
875
|
-
fontWeight: "600",
|
|
876
|
-
color: night.color.text
|
|
877
|
-
},
|
|
878
|
-
noDiffDataText: {
|
|
879
|
-
fontSize: 12,
|
|
880
|
-
color: night.color.textTertiary,
|
|
881
|
-
textAlign: "center",
|
|
882
|
-
lineHeight: 18
|
|
883
|
-
},
|
|
884
|
-
lockedBanner: {
|
|
885
|
-
flexDirection: "row",
|
|
886
|
-
alignItems: "center",
|
|
887
|
-
justifyContent: "center",
|
|
888
|
-
paddingVertical: 10,
|
|
889
|
-
paddingHorizontal: 16,
|
|
890
|
-
marginHorizontal: 12,
|
|
891
|
-
marginTop: 8,
|
|
892
|
-
backgroundColor: night.color.warningSoft,
|
|
893
|
-
borderRadius: 8,
|
|
894
|
-
borderWidth: 1,
|
|
895
|
-
borderColor: night.color.warning + "30",
|
|
896
|
-
gap: 8
|
|
897
|
-
},
|
|
898
|
-
lockedBannerText: {
|
|
899
|
-
color: night.color.warning,
|
|
900
|
-
fontSize: 13,
|
|
901
|
-
fontWeight: "500"
|
|
902
|
-
},
|
|
903
|
-
lockedBannerSubtext: {
|
|
904
|
-
color: night.color.textTertiary,
|
|
905
|
-
fontSize: 12
|
|
906
|
-
}
|
|
907
|
-
});
|
|
908
|
-
export default RenderHistoryViewer;
|
|
1
|
+
"use strict";import te,{useState as k,useCallback as w,useMemo as x}from"react";import{View as r,Text as l,TouchableOpacity as v,ScrollView as L,StyleSheet as _}from"react-native";import{Clock as J,GitBranch as G,Database as A,Lock as K,formatRelativeTime as W,SectionHeader as T,EventStepperFooter as P,buoyColors as V,night as t,useLimit as N,ToolEmptyState as Y,monoFont as y}from"@buoy-gg/shared-ui";import{TreeDiffViewer as F}from"@buoy-gg/shared-ui/dataViewer";import{RenderTracker as q}from"../utils/RenderTracker";import{EnhancedCauseDisplay as E,CAUSE_CONFIG as H}from"./RenderCauseBadge";import{jsx as o,jsxs as n,Fragment as Q}from"react/jsx-runtime";function B(i){const a=new Date(i);const g=a.getHours().toString().padStart(2,"0");const d=a.getMinutes().toString().padStart(2,"0");const f=a.getSeconds().toString().padStart(2,"0");const h=a.getMilliseconds().toString().padStart(3,"0");return`${g}:${d}:${f}.${h}`}export function RenderHistoryViewer({render:i,disableInternalFooter:a=false,selectedEventIndex:g,onEventIndexChange:d,isPro:f=false}){const[h,m]=k(0);const c=g??h;const s=d??m;const[p,I]=k("current");const u=x(()=>{if(!i.renderHistory||i.renderHistory.length===0){return[]}return[...i.renderHistory].sort((D,$)=>D.timestamp-$.timestamp)},[i.renderHistory]);const z=N("highlightUpdates.historyEvents");const b=f?Infinity:z;const R=x(()=>u.slice(-b),[u,b]);const M=x(()=>Math.max(0,u.length-b),[u.length,b]);const S=R.length;const C=R[c];const U=c>0?R[c-1]:null;const O=w(()=>{if(c>0){s(c-1)}},[c,s]);const j=w(()=>{if(c<S-1){s(c+1)}},[c,S,s]);if(S===0){const D=q.getSettings().enableRenderHistory;return o(Y,{testID:"buoy-highlight-history-empty",otto:D?"stare":"paused",title:"No Render History",message:D?"History is on and armed \u2014 this component has not re-rendered since. Interact with the app to record one.":"Enable render history tracking in settings to see render events here."})}return n(Q,{children:[n(r,{style:[e.container,{paddingBottom:!a&&S>1?80:0}],children:[M>0&&n(r,{testID:"buoy-highlight-history-locked",style:e.lockedBanner,children:[o(K,{size:14,color:t.color.warning}),n(l,{testID:"buoy-highlight-history-locked-text",style:e.lockedBannerText,children:[M," older ",M===1?"render":"renders"," locked"]}),o(l,{style:e.lockedBannerSubtext,children:"Upgrade to Pro"})]}),n(r,{style:e.viewToggleContainer,children:[n(v,{testID:"buoy-highlight-history-mode-current",accessibilityRole:"button",accessibilityLabel:"Current state",style:[e.viewToggleCard,p==="current"&&e.viewToggleCardActive],onPress:()=>I("current"),activeOpacity:.8,children:[n(r,{style:e.viewToggleContent,children:[o(A,{size:16,color:p==="current"?t.color.accent:t.color.textSecondary}),o(l,{style:[e.viewToggleLabel,p==="current"&&e.viewToggleLabelActive],children:"CURRENT STATE"})]}),n(l,{style:[e.viewToggleDescription,p==="current"&&{color:t.color.text}],children:["View render #",C?.renderNumber??0," details"]})]}),n(r,{testID:"buoy-highlight-history-mode-diff",accessibilityLabel:"Diff view, coming soon",style:[e.viewToggleCard,e.viewToggleCardDisabled],children:[n(r,{style:e.viewToggleContent,children:[o(G,{size:16,color:t.color.textTertiary}),o(l,{style:[e.viewToggleLabel,e.viewToggleLabelDisabled],children:"DIFF VIEW"}),o(r,{style:e.todoBadge,children:o(l,{style:e.todoBadgeText,children:"TODO"})})]}),o(l,{style:[e.viewToggleDescription,{color:t.color.textTertiary}],children:"Compare renders side by side (coming soon)"})]})]}),o(L,{testID:"buoy-highlight-history-scroll",style:e.contentScroll,contentContainerStyle:e.contentContainer,showsVerticalScrollIndicator:false,children:p==="current"?o(X,{event:C,render:i}):o(Z,{previousEvent:U,currentEvent:C,render:i})})]}),!a&&o(P,{currentIndex:c,totalItems:S,onPrevious:O,onNext:j,itemLabel:"Render",subtitle:W(new Date(C?.timestamp??Date.now()))})]})}function X({event:i,render:a}){if(!i){return o(r,{testID:"buoy-highlight-history-no-event",style:e.noEventContainer,children:o(l,{style:e.noEventText,children:"No event selected"})})}const g=H[i.cause.type];return n(r,{style:e.currentStateContainer,children:[n(r,{style:e.eventHeader,children:[n(r,{style:e.eventHeaderLeft,children:[n(l,{testID:"buoy-highlight-history-event-title",style:e.eventTitle,children:["Render #",i.renderNumber]}),o(l,{testID:"buoy-highlight-history-event-time",style:e.eventTime,children:B(i.timestamp)})]}),n(r,{style:[e.eventBadge,{backgroundColor:a.color+"30"}],children:[o(r,{style:[e.eventBadgeDot,{backgroundColor:a.color}]}),o(l,{testID:"buoy-highlight-history-event-cause",style:[e.eventBadgeText,{color:a.color}],children:i.cause.type.toUpperCase()})]})]}),n(r,{style:e.section,children:[n(T,{children:[o(T.Icon,{icon:J,color:g.color,size:12}),o(T.Title,{children:"WHY DID THIS RENDER?"})]}),o(r,{style:e.sectionContent,children:o(E,{cause:i.cause,nativeType:a.viewType})})]}),i.capturedProps&&Object.keys(i.capturedProps).length>0&&n(r,{style:e.section,children:[n(T,{children:[o(T.Icon,{icon:A,color:t.color.accent,size:12}),o(T.Title,{children:"CAPTURED PROPS"})]}),o(r,{style:e.sectionContent,children:o(L,{horizontal:true,showsHorizontalScrollIndicator:false,style:e.propsScrollView,children:o(l,{testID:"buoy-highlight-history-props",style:e.propsJson,children:JSON.stringify(i.capturedProps,null,2)})})})]})]})}function Z({previousEvent:i,currentEvent:a,render:g}){const[d,f]=k("props");if(!i||!a){return o(r,{style:e.noEventContainer,children:o(l,{style:e.noEventText,children:"Select an event with a previous event to compare"})})}const h=H[i.cause.type];const m=H[a.cause.type];const c=i.capturedProps&&a.capturedProps;const s=i.capturedState&&a.capturedState;return n(r,{style:e.diffContainer,children:[n(r,{style:e.compareBar,children:[n(r,{style:e.compareSide,children:[n(r,{style:e.compareLabelRow,children:[o(l,{style:[e.compareLabel,{color:V.warning}],children:"PREV"}),o(r,{style:[e.compareActionBadge,{backgroundColor:`${h.color}20`}],children:o(l,{style:[e.compareActionText,{color:h.color}],children:i.cause.type.toUpperCase()})})]}),n(r,{style:e.compareMeta,children:[n(l,{style:e.compareIndex,children:["#",i.renderNumber]}),o(l,{style:e.compareTime,children:B(i.timestamp)})]})]}),o(r,{style:e.compareDivider,children:o(l,{style:e.compareArrow,children:"\u2192"})}),n(r,{style:e.compareSide,children:[n(r,{style:e.compareLabelRow,children:[o(l,{style:[e.compareLabel,{color:V.success}],children:"CUR"}),o(r,{style:[e.compareActionBadge,{backgroundColor:`${m.color}20`}],children:o(l,{style:[e.compareActionText,{color:m.color}],children:a.cause.type.toUpperCase()})})]}),n(r,{style:e.compareMeta,children:[n(l,{style:e.compareIndex,children:["#",a.renderNumber]}),o(l,{style:e.compareTime,children:B(a.timestamp)})]})]})]}),n(r,{style:e.diffModeTabs,children:[o(v,{style:[e.diffModeTab,d==="cause"&&e.diffModeTabActive],onPress:()=>f("cause"),activeOpacity:.7,children:o(l,{style:[e.diffModeTabText,d==="cause"&&e.diffModeTabTextActive],children:"CAUSE"})}),o(v,{style:[e.diffModeTab,d==="props"&&e.diffModeTabActive,!c&&e.diffModeTabDisabled],onPress:()=>c&&f("props"),activeOpacity:c?.7:1,children:o(l,{style:[e.diffModeTabText,d==="props"&&e.diffModeTabTextActive,!c&&e.diffModeTabTextDisabled],children:"PROPS"})}),o(v,{style:[e.diffModeTab,d==="state"&&e.diffModeTabActive,!s&&e.diffModeTabDisabled],onPress:()=>s&&f("state"),activeOpacity:s?.7:1,children:o(l,{style:[e.diffModeTabText,d==="state"&&e.diffModeTabTextActive,!s&&e.diffModeTabTextDisabled],children:"STATE"})})]}),d==="cause"&&o(r,{style:e.diffSummary,children:o(E,{cause:a.cause,nativeType:g.viewType})}),d==="props"&&o(r,{style:e.treeDiffContainer,children:c?o(F,{oldValue:i.capturedProps,newValue:a.capturedProps,theme:"dark",showUnchanged:true}):n(r,{style:e.noDiffData,children:[o(l,{style:e.noDiffDataTitle,children:"Props Not Captured"}),o(l,{style:e.noDiffDataText,children:'Enable "Capture Props on Render" in settings to see props diff.'})]})}),d==="state"&&o(r,{style:e.treeDiffContainer,children:s?o(F,{oldValue:i.capturedState,newValue:a.capturedState,theme:"dark",showUnchanged:true}):n(r,{style:e.noDiffData,children:[o(l,{style:e.noDiffDataTitle,children:"State Not Captured"}),o(l,{style:e.noDiffDataText,children:'Enable "Capture State on Render" in settings to see state diff.'})]})})]})}export function RenderHistoryFooter({render:i,selectedEventIndex:a=0,onEventIndexChange:g=()=>{},isPro:d=false}){const f=x(()=>{if(!i.renderHistory||i.renderHistory.length===0){return[]}return[...i.renderHistory].sort((z,b)=>z.timestamp-b.timestamp)},[i.renderHistory]);const h=N("highlightUpdates.historyEvents");const m=d?Infinity:h;const c=x(()=>f.slice(-m),[f,m]);const s=c.length;const p=c[a];const I=w(()=>{g(Math.max(0,a-1))},[a,g]);const u=w(()=>{g(Math.min(s-1,a+1))},[a,s,g]);if(s<=1){return null}return o(P,{currentIndex:a,totalItems:s,onPrevious:I,onNext:u,itemLabel:"Render",subtitle:p?W(new Date(p.timestamp)):void 0})}const e=_.create({container:{flex:1,backgroundColor:"transparent"},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",padding:32,gap:12},emptyTitle:{fontSize:16,fontWeight:"600",color:t.color.text},emptyText:{fontSize:13,color:t.color.textSecondary,textAlign:"center",lineHeight:18},viewToggleContainer:{flexDirection:"row",padding:12,gap:8},viewToggleCard:{flex:1,backgroundColor:t.color.surface,borderRadius:8,borderWidth:1,borderColor:t.color.border,padding:10,gap:4},viewToggleCardActive:{borderColor:t.color.accentBorderStrong,backgroundColor:t.color.accentSoft},viewToggleCardDisabled:{opacity:.5},todoBadge:{backgroundColor:t.color.fillSecondary,paddingHorizontal:6,paddingVertical:2,borderRadius:4,marginLeft:4},todoBadgeText:{fontSize:9,fontWeight:"700",color:t.color.textTertiary,letterSpacing:.3},viewToggleContent:{flexDirection:"row",alignItems:"center",gap:6},viewToggleLabel:{fontSize:10,fontWeight:"700",color:t.color.textSecondary,letterSpacing:.5},viewToggleLabelActive:{color:t.color.accent},viewToggleLabelDisabled:{color:t.color.textTertiary},viewToggleDescription:{fontSize:11,color:t.color.textTertiary,marginTop:2},contentScroll:{flex:1},contentContainer:{padding:12,paddingTop:0},noEventContainer:{padding:24,alignItems:"center"},noEventText:{fontSize:13,color:t.color.textTertiary},currentStateContainer:{gap:12},eventHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:t.color.surface,borderRadius:8,borderWidth:1,borderColor:t.color.border,padding:12},eventHeaderLeft:{gap:2},eventTitle:{fontSize:15,fontWeight:"700",color:t.color.text},eventTime:{fontSize:11,color:t.color.textTertiary,fontFamily:y},eventBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:10,paddingVertical:4,borderRadius:12,gap:6},eventBadgeDot:{width:6,height:6,borderRadius:3},eventBadgeText:{fontSize:10,fontWeight:"700",fontFamily:y},section:{backgroundColor:t.color.surface,borderRadius:8,borderWidth:1,borderColor:t.color.border,overflow:"hidden"},sectionContent:{padding:12,paddingTop:8},causeContainer:{marginBottom:12},changedList:{marginBottom:12,paddingLeft:4},changedListTitle:{fontSize:11,fontWeight:"600",color:t.color.textSecondary,marginBottom:6},changedItem:{fontSize:12,color:t.color.text,fontFamily:y,marginBottom:3,paddingLeft:8},propsScrollView:{maxHeight:150},propsJson:{fontSize:11,fontFamily:y,color:t.color.text,backgroundColor:t.color.bg,padding:10,borderRadius:6},diffContainer:{gap:12},compareBar:{flexDirection:"row",backgroundColor:t.color.surface,borderRadius:8,borderWidth:1,borderColor:t.color.border,padding:10},compareSide:{flex:1,gap:4},compareLabelRow:{flexDirection:"row",alignItems:"center",gap:8},compareLabel:{fontSize:10,fontWeight:"700",letterSpacing:.5},compareActionBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},compareActionText:{fontSize:9,fontWeight:"600"},compareMeta:{flexDirection:"row",alignItems:"center",gap:6},compareIndex:{fontSize:12,fontWeight:"600",color:t.color.text},compareTime:{fontSize:10,color:t.color.textTertiary,fontFamily:y},compareDivider:{width:30,alignItems:"center",justifyContent:"center"},compareArrow:{fontSize:16,color:t.color.textTertiary},diffSummary:{backgroundColor:t.color.surface,borderRadius:8,borderWidth:1,borderColor:t.color.border,padding:12},diffSummaryTitle:{fontSize:11,fontWeight:"600",color:t.color.textSecondary,marginBottom:8},diffChanges:{gap:4},diffChangeItem:{flexDirection:"row",alignItems:"center",gap:6},diffChangeIcon:{fontSize:12,fontWeight:"700",color:t.color.warning,fontFamily:y},diffChangeKey:{fontSize:12,color:t.color.text,fontFamily:y},diffNoChanges:{fontSize:12,color:t.color.textTertiary,fontStyle:"italic"},diffPlaceholder:{fontSize:12,color:t.color.textTertiary,fontStyle:"italic",textAlign:"center",padding:16},diffModeTabs:{flexDirection:"row",backgroundColor:t.color.surface,borderRadius:8,borderWidth:1,borderColor:t.color.border,padding:4,gap:4},diffModeTab:{flex:1,paddingVertical:8,paddingHorizontal:12,borderRadius:6,alignItems:"center"},diffModeTabActive:{backgroundColor:t.color.accentSoft},diffModeTabDisabled:{opacity:.4},diffModeTabText:{fontSize:10,fontWeight:"600",color:t.color.textSecondary,letterSpacing:.5},diffModeTabTextActive:{color:t.color.accent},diffModeTabTextDisabled:{color:t.color.textTertiary},causeDiffContainer:{gap:8,marginBottom:12},causeDiffRow:{flexDirection:"row",alignItems:"center",gap:8},causeDiffLabel:{fontSize:11,fontWeight:"600",color:t.color.textSecondary,minWidth:80},causeDiffValue:{fontSize:12,color:t.color.text,fontFamily:y,fontWeight:"500"},diffChangesTitle:{fontSize:11,fontWeight:"600",color:t.color.textSecondary,marginBottom:6},treeDiffContainer:{backgroundColor:t.color.surface,borderRadius:8,borderWidth:1,borderColor:t.color.border,overflow:"hidden",minHeight:150},noDiffData:{padding:24,alignItems:"center",gap:8},noDiffDataTitle:{fontSize:13,fontWeight:"600",color:t.color.text},noDiffDataText:{fontSize:12,color:t.color.textTertiary,textAlign:"center",lineHeight:18},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:10,paddingHorizontal:16,marginHorizontal:12,marginTop:8,backgroundColor:t.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:t.color.warning+"30",gap:8},lockedBannerText:{color:t.color.warning,fontSize:13,fontWeight:"500"},lockedBannerSubtext:{color:t.color.textTertiary,fontSize:12}});export default RenderHistoryViewer;
|