@buoy-gg/highlight-updates 7.0.32 → 7.0.33

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.
@@ -110,21 +110,38 @@ function IsolatedRenderListInner({
110
110
 
111
111
  // Show empty state when no renders
112
112
  if (renders.length === 0) {
113
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
114
- testID: "buoy-highlight-empty",
115
- style: styles.emptyState,
116
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Activity, {
117
- size: 32,
118
- color: _sharedUi.night.color.textTertiary
119
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
120
- testID: "buoy-highlight-empty-title",
121
- style: styles.emptyTitle,
122
- children: "No renders tracked"
123
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
124
- testID: "buoy-highlight-empty-text",
125
- style: styles.emptyText,
126
- children: isTracking ? "Component renders will appear here" : "Enable tracking to start capturing"
127
- })]
113
+ const term = searchText.trim();
114
+
115
+ // Read straight off the tracker rather than held in state: this runs only
116
+ // on the empty branch, so it costs nothing on the hot path, and it is
117
+ // always the current truth. `totalTracked` is every component the tracker
118
+ // holds; `unsearched` is what the settings and filters allow BEFORE the
119
+ // search box.
120
+ const totalTracked = _RenderTracker.RenderTracker.getStats().totalComponents;
121
+ const unsearched = term ? _RenderTracker.RenderTracker.getFilteredRenders("").length : 0;
122
+ const content = (0, _sharedUi.resolveListEmptyState)({
123
+ subject: "components",
124
+ verb: "tracked",
125
+ search: searchText,
126
+ // The denominator is what the FILTERS left, not the raw tracker count —
127
+ // "clear the search to see them" has to be true of what you get back.
128
+ total: term ? unsearched : totalTracked,
129
+ capturing: isTracking,
130
+ blocked: term && unsearched === 0 && totalTracked > 0 ? "The active filters hide everything tracked, so there is nothing to search." : undefined,
131
+ waiting: {
132
+ // stare = "watching for a specific event; recording armed".
133
+ otto: "stare",
134
+ title: "No renders tracked",
135
+ message: "Component renders will appear here"
136
+ },
137
+ paused: {
138
+ title: "No renders tracked",
139
+ message: "Enable tracking to start capturing"
140
+ }
141
+ });
142
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolEmptyState, {
143
+ ...content,
144
+ testID: "buoy-highlight-empty"
128
145
  });
129
146
  }
130
147
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.FlatList, {
@@ -149,22 +166,6 @@ const styles = _reactNative.StyleSheet.create({
149
166
  listContent: {
150
167
  paddingTop: 8
151
168
  },
152
- emptyState: {
153
- alignItems: "center",
154
- paddingVertical: 40
155
- },
156
- emptyTitle: {
157
- color: _sharedUi.night.color.text,
158
- fontSize: 14,
159
- fontWeight: "600",
160
- marginTop: 12,
161
- marginBottom: 6
162
- },
163
- emptyText: {
164
- color: _sharedUi.night.color.textTertiary,
165
- fontSize: 12,
166
- textAlign: "center"
167
- },
168
169
  lockedBanner: {
169
170
  flexDirection: "row",
170
171
  alignItems: "center",
@@ -10,6 +10,7 @@ var _react = _interopRequireWildcard(require("react"));
10
10
  var _reactNative = require("react-native");
11
11
  var _sharedUi = require("@buoy-gg/shared-ui");
12
12
  var _dataViewer = require("@buoy-gg/shared-ui/dataViewer");
13
+ var _RenderTracker = require("../utils/RenderTracker");
13
14
  var _RenderCauseBadge = require("./RenderCauseBadge");
14
15
  var _jsxRuntime = require("react/jsx-runtime");
15
16
  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); }
@@ -96,21 +97,19 @@ function RenderHistoryViewer({
96
97
 
97
98
  // If no history, show empty state
98
99
  if (totalEvents === 0) {
99
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
100
- testID: "buoy-highlight-history-empty",
101
- style: styles.emptyContainer,
102
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Clock, {
103
- size: 32,
104
- color: _sharedUi.night.color.textTertiary
105
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
106
- testID: "buoy-highlight-history-empty-title",
107
- style: styles.emptyTitle,
108
- children: "No Render History"
109
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
110
- testID: "buoy-highlight-history-empty-text",
111
- style: styles.emptyText,
112
- children: "Enable render history tracking in settings to see render events here."
113
- })]
100
+ // The copy used to tell EVERYONE to go and enable the setting, including
101
+ // the people who already had. Asking the tracker which it is costs one
102
+ // synchronous read on a branch that renders nothing else.
103
+ const historyEnabled = _RenderTracker.RenderTracker.getSettings().enableRenderHistory;
104
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolEmptyState, {
105
+ testID: "buoy-highlight-history-empty"
106
+ // paused = the recorder is switched off; stare = armed and watching,
107
+ // which is the truth once the setting is on and this component simply
108
+ // has not re-rendered yet.
109
+ ,
110
+ otto: historyEnabled ? "stare" : "paused",
111
+ title: "No Render History",
112
+ 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."
114
113
  });
115
114
  }
116
115
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
@@ -15,7 +15,7 @@ import React, { useState, useEffect, useRef, useCallback, memo, useMemo } from "
15
15
  import { View, Text, FlatList, StyleSheet } from "react-native";
16
16
  import { RenderTracker } from "../utils/RenderTracker";
17
17
  import { RenderListItem } from "./RenderListItem";
18
- import { Activity, Lock, night, useLimit } from "@buoy-gg/shared-ui";
18
+ import { Lock, night, useLimit, ToolEmptyState, resolveListEmptyState } from "@buoy-gg/shared-ui";
19
19
 
20
20
  // Free tier limit for tracked components
21
21
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -105,21 +105,38 @@ function IsolatedRenderListInner({
105
105
 
106
106
  // Show empty state when no renders
107
107
  if (renders.length === 0) {
108
- return /*#__PURE__*/_jsxs(View, {
109
- testID: "buoy-highlight-empty",
110
- style: styles.emptyState,
111
- children: [/*#__PURE__*/_jsx(Activity, {
112
- size: 32,
113
- color: night.color.textTertiary
114
- }), /*#__PURE__*/_jsx(Text, {
115
- testID: "buoy-highlight-empty-title",
116
- style: styles.emptyTitle,
117
- children: "No renders tracked"
118
- }), /*#__PURE__*/_jsx(Text, {
119
- testID: "buoy-highlight-empty-text",
120
- style: styles.emptyText,
121
- children: isTracking ? "Component renders will appear here" : "Enable tracking to start capturing"
122
- })]
108
+ const term = searchText.trim();
109
+
110
+ // Read straight off the tracker rather than held in state: this runs only
111
+ // on the empty branch, so it costs nothing on the hot path, and it is
112
+ // always the current truth. `totalTracked` is every component the tracker
113
+ // holds; `unsearched` is what the settings and filters allow BEFORE the
114
+ // search box.
115
+ const totalTracked = RenderTracker.getStats().totalComponents;
116
+ const unsearched = term ? RenderTracker.getFilteredRenders("").length : 0;
117
+ const content = resolveListEmptyState({
118
+ subject: "components",
119
+ verb: "tracked",
120
+ search: searchText,
121
+ // The denominator is what the FILTERS left, not the raw tracker count —
122
+ // "clear the search to see them" has to be true of what you get back.
123
+ total: term ? unsearched : totalTracked,
124
+ capturing: isTracking,
125
+ blocked: term && unsearched === 0 && totalTracked > 0 ? "The active filters hide everything tracked, so there is nothing to search." : undefined,
126
+ waiting: {
127
+ // stare = "watching for a specific event; recording armed".
128
+ otto: "stare",
129
+ title: "No renders tracked",
130
+ message: "Component renders will appear here"
131
+ },
132
+ paused: {
133
+ title: "No renders tracked",
134
+ message: "Enable tracking to start capturing"
135
+ }
136
+ });
137
+ return /*#__PURE__*/_jsx(ToolEmptyState, {
138
+ ...content,
139
+ testID: "buoy-highlight-empty"
123
140
  });
124
141
  }
125
142
  return /*#__PURE__*/_jsx(FlatList, {
@@ -144,22 +161,6 @@ const styles = StyleSheet.create({
144
161
  listContent: {
145
162
  paddingTop: 8
146
163
  },
147
- emptyState: {
148
- alignItems: "center",
149
- paddingVertical: 40
150
- },
151
- emptyTitle: {
152
- color: night.color.text,
153
- fontSize: 14,
154
- fontWeight: "600",
155
- marginTop: 12,
156
- marginBottom: 6
157
- },
158
- emptyText: {
159
- color: night.color.textTertiary,
160
- fontSize: 12,
161
- textAlign: "center"
162
- },
163
164
  lockedBanner: {
164
165
  flexDirection: "row",
165
166
  alignItems: "center",
@@ -10,8 +10,9 @@
10
10
 
11
11
  import React, { useState, useCallback, useMemo } from "react";
12
12
  import { View, Text, TouchableOpacity, ScrollView, StyleSheet } from "react-native";
13
- import { Clock, GitBranch, Database, Lock, formatRelativeTime, SectionHeader, EventStepperFooter, buoyColors, night, useLimit } from "@buoy-gg/shared-ui";
13
+ import { Clock, GitBranch, Database, Lock, formatRelativeTime, SectionHeader, EventStepperFooter, buoyColors, night, useLimit, ToolEmptyState } from "@buoy-gg/shared-ui";
14
14
  import { TreeDiffViewer } from "@buoy-gg/shared-ui/dataViewer";
15
+ import { RenderTracker } from "../utils/RenderTracker";
15
16
  import { EnhancedCauseDisplay, CAUSE_CONFIG } from "./RenderCauseBadge";
16
17
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
17
18
  /**
@@ -89,21 +90,19 @@ export function RenderHistoryViewer({
89
90
 
90
91
  // If no history, show empty state
91
92
  if (totalEvents === 0) {
92
- return /*#__PURE__*/_jsxs(View, {
93
- testID: "buoy-highlight-history-empty",
94
- style: styles.emptyContainer,
95
- children: [/*#__PURE__*/_jsx(Clock, {
96
- size: 32,
97
- color: night.color.textTertiary
98
- }), /*#__PURE__*/_jsx(Text, {
99
- testID: "buoy-highlight-history-empty-title",
100
- style: styles.emptyTitle,
101
- children: "No Render History"
102
- }), /*#__PURE__*/_jsx(Text, {
103
- testID: "buoy-highlight-history-empty-text",
104
- style: styles.emptyText,
105
- children: "Enable render history tracking in settings to see render events here."
106
- })]
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."
107
106
  });
108
107
  }
109
108
  return /*#__PURE__*/_jsxs(_Fragment, {
@@ -1 +1 @@
1
- {"version":3,"file":"IsolatedRenderList.d.ts","sourceRoot":"","sources":["../../../../src/highlight-updates/components/IsolatedRenderList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAkE,MAAM,OAAO,CAAC;AAEvF,OAAO,EAAiB,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAK9F,UAAU,uBAAuB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,YAAY,CAAC;IACtB,cAAc,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;IAC5F,aAAa,EAAE,CAAC,KAAK,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAClF,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;IACrD,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AACH,iBAAS,uBAAuB,CAAC,EAC/B,UAAU,EACV,OAAO,EACP,cAAc,EACd,aAAa,EACb,eAAe,EACf,UAAU,EACV,KAAa,GACd,EAAE,uBAAuB,qBAyGzB;AAGD,eAAO,MAAM,kBAAkB,2DAAgC,CAAC;AA0ChE,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"IsolatedRenderList.d.ts","sourceRoot":"","sources":["../../../../src/highlight-updates/components/IsolatedRenderList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAkE,MAAM,OAAO,CAAC;AAEvF,OAAO,EAAiB,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAW9F,UAAU,uBAAuB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,YAAY,CAAC;IACtB,cAAc,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;IAC5F,aAAa,EAAE,CAAC,KAAK,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAClF,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;IACrD,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AACH,iBAAS,uBAAuB,CAAC,EAC/B,UAAU,EACV,OAAO,EACP,cAAc,EACd,aAAa,EACb,eAAe,EACf,UAAU,EACV,KAAa,GACd,EAAE,uBAAuB,qBAiIzB;AAGD,eAAO,MAAM,kBAAkB,2DAAgC,CAAC;AA0BhE,eAAe,kBAAkB,CAAC"}
@@ -6,7 +6,7 @@
6
6
  * Shows current state view or diff view between renders.
7
7
  */
8
8
  import React from "react";
9
- import type { TrackedRender } from "../utils/RenderTracker";
9
+ import { type TrackedRender } from "../utils/RenderTracker";
10
10
  interface RenderHistoryViewerProps {
11
11
  render: TrackedRender;
12
12
  /** If true, use external footer (modal provides it) */
@@ -1 +1 @@
1
- {"version":3,"file":"RenderHistoryViewer.d.ts","sourceRoot":"","sources":["../../../../src/highlight-updates/components/RenderHistoryViewer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAyC,MAAM,OAAO,CAAC;AAe9D,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,wBAAwB,CAAC;AAGzE,UAAU,wBAAwB;IAChC,MAAM,EAAE,aAAa,CAAC;IACtB,uDAAuD;IACvD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,wCAAwC;IACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wCAAwC;IACxC,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAqBD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,qBAA6B,EAC7B,kBAAkB,EAAE,aAAa,EACjC,kBAAkB,EAAE,gBAAgB,EACpC,KAAa,GACd,EAAE,wBAAwB,qBAyM1B;AAyRD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,kBAAsB,EACtB,kBAA6B,EAC7B,KAAa,GACd,EAAE;IACD,MAAM,EAAE,aAAa,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,4BA6CA;AA+YD,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"RenderHistoryViewer.d.ts","sourceRoot":"","sources":["../../../../src/highlight-updates/components/RenderHistoryViewer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAyC,MAAM,OAAO,CAAC;AAiB9D,OAAO,EAAiB,KAAK,aAAa,EAAoB,MAAM,wBAAwB,CAAC;AAG7F,UAAU,wBAAwB;IAChC,MAAM,EAAE,aAAa,CAAC;IACtB,uDAAuD;IACvD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,wCAAwC;IACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wCAAwC;IACxC,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAqBD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,qBAA6B,EAC7B,kBAAkB,EAAE,aAAa,EACjC,kBAAkB,EAAE,gBAAgB,EACpC,KAAa,GACd,EAAE,wBAAwB,qBAiN1B;AAyRD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,kBAAsB,EACtB,kBAA6B,EAC7B,KAAa,GACd,EAAE;IACD,MAAM,EAAE,aAAa,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,4BA6CA;AA+YD,eAAe,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/highlight-updates",
3
- "version": "7.0.32",
3
+ "version": "7.0.33",
4
4
  "description": "Render highlighter for React Native — see every render with its cause: mount, state, props, or parent. Part of Buoy devtools.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -26,14 +26,14 @@
26
26
  ],
27
27
  "sideEffects": false,
28
28
  "dependencies": {
29
- "@buoy-gg/shared-ui": "^7.0.32",
30
- "@buoy-gg/floating-tools-core": "^7.0.32"
29
+ "@buoy-gg/floating-tools-core": "^7.0.33",
30
+ "@buoy-gg/shared-ui": "^7.0.33"
31
31
  },
32
32
  "peerDependencies": {
33
- "@buoy-gg/license": "7.0.32",
33
+ "@buoy-gg/license": "7.0.33",
34
34
  "react": "*",
35
35
  "react-native": "*",
36
- "@buoy-gg/core": "^7.0.32"
36
+ "@buoy-gg/core": "^7.0.33"
37
37
  },
38
38
  "peerDependenciesMeta": {
39
39
  "@buoy-gg/core": {
@@ -44,8 +44,8 @@
44
44
  "@types/react": "^19.1.0",
45
45
  "@types/react-native": "^0.73.0",
46
46
  "typescript": "~5.8.3",
47
- "@buoy-gg/core": "^7.0.32",
48
- "@buoy-gg/license": "^7.0.32"
47
+ "@buoy-gg/core": "^7.0.33",
48
+ "@buoy-gg/license": "^7.0.33"
49
49
  },
50
50
  "react-native-builder-bob": {
51
51
  "source": "src",