@buoy-gg/react-query 7.0.32 → 7.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/lib/commonjs/react-query/components/QueryBrowserMode.js +17 -1
  2. package/lib/commonjs/react-query/components/modals/MutationBrowserFooter.js +7 -19
  3. package/lib/commonjs/react-query/components/modals/QueryBrowserFooter.js +7 -19
  4. package/lib/commonjs/react-query/components/modals/ReactQueryModalHeader.js +29 -59
  5. package/lib/commonjs/react-query/components/query-browser/MutationStatusCount.js +51 -87
  6. package/lib/commonjs/react-query/components/query-browser/MutationsList.js +5 -7
  7. package/lib/commonjs/react-query/components/query-browser/QueryBrowser.js +9 -17
  8. package/lib/commonjs/react-query/components/query-browser/QueryStatusCount.js +66 -112
  9. package/lib/commonjs/react-query/components/query-browser/StorageStatusCount.js +22 -67
  10. package/lib/commonjs/react-query/stores/reactQueryEventStore.js +13 -22
  11. package/lib/commonjs/react-query/sync/snapshotProvider.js +17 -62
  12. package/lib/module/react-query/components/QueryBrowserMode.js +17 -1
  13. package/lib/module/react-query/components/modals/MutationBrowserFooter.js +8 -20
  14. package/lib/module/react-query/components/modals/QueryBrowserFooter.js +8 -20
  15. package/lib/module/react-query/components/modals/ReactQueryModalHeader.js +31 -61
  16. package/lib/module/react-query/components/query-browser/MutationStatusCount.js +51 -87
  17. package/lib/module/react-query/components/query-browser/MutationsList.js +7 -9
  18. package/lib/module/react-query/components/query-browser/QueryBrowser.js +11 -19
  19. package/lib/module/react-query/components/query-browser/QueryStatusCount.js +66 -112
  20. package/lib/module/react-query/components/query-browser/StorageStatusCount.js +22 -67
  21. package/lib/module/react-query/stores/reactQueryEventStore.js +13 -22
  22. package/lib/module/react-query/sync/snapshotProvider.js +18 -63
  23. package/lib/typescript/react-query/components/QueryBrowserMode.d.ts.map +1 -1
  24. package/lib/typescript/react-query/components/modals/MutationBrowserFooter.d.ts.map +1 -1
  25. package/lib/typescript/react-query/components/modals/QueryBrowserFooter.d.ts.map +1 -1
  26. package/lib/typescript/react-query/components/modals/ReactQueryModalHeader.d.ts.map +1 -1
  27. package/lib/typescript/react-query/components/query-browser/MutationStatusCount.d.ts.map +1 -1
  28. package/lib/typescript/react-query/components/query-browser/MutationsList.d.ts.map +1 -1
  29. package/lib/typescript/react-query/components/query-browser/QueryBrowser.d.ts +7 -1
  30. package/lib/typescript/react-query/components/query-browser/QueryBrowser.d.ts.map +1 -1
  31. package/lib/typescript/react-query/components/query-browser/QueryStatusCount.d.ts.map +1 -1
  32. package/lib/typescript/react-query/components/query-browser/StorageStatusCount.d.ts.map +1 -1
  33. package/lib/typescript/react-query/stores/reactQueryEventStore.d.ts +3 -8
  34. package/lib/typescript/react-query/stores/reactQueryEventStore.d.ts.map +1 -1
  35. package/lib/typescript/react-query/sync/snapshotProvider.d.ts.map +1 -1
  36. package/package.json +3 -3
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.QueryBrowserMode = QueryBrowserMode;
7
+ var _sharedUi = require("@buoy-gg/shared-ui");
7
8
  var _reactNative = require("react-native");
8
9
  var _react = require("react");
9
10
  var _index = require("./query-browser/index");
@@ -63,7 +64,22 @@ function QueryBrowserMode({
63
64
  searchText: searchText,
64
65
  ignoredPatterns: ignoredPatterns,
65
66
  includedPatterns: includedPatterns,
66
- emptyStateMessage: searchText ? `No queries found matching "${searchText}"` : activeFilter ? `No ${activeFilter} queries found` : hasIncludeFilters ? `No queries match your "include only" filters. ${includedPatterns.size} pattern(s) active.` : hasExcludeFilters ? `No queries match the current filters. ${ignoredPatterns.size} pattern(s) excluded.` : "No React Query queries are currently active.\n\nTo see queries here:\n• Make API calls using useQuery\n• Ensure queries are within QueryClientProvider\n• Check console for debugging info",
67
+ emptyState: (0, _sharedUi.resolveListEmptyState)({
68
+ subject: "queries",
69
+ verb: "active",
70
+ search: searchText,
71
+ total: allQueries.length,
72
+ // Include/exclude patterns and the status filter are all "your
73
+ // filters hid it", but each names the control that undoes it.
74
+ blocked: activeFilter ? `No ${activeFilter} queries. Pick another status to see the rest.` : hasIncludeFilters ? `No queries match your "include only" filters. ${includedPatterns.size} pattern(s) active.` : hasExcludeFilters ? `No queries match the current filters. ${ignoredPatterns.size} pattern(s) excluded.` : undefined,
75
+ waiting: {
76
+ // scanning = the cache was inspected and came back empty; this is
77
+ // a setup problem, not a stream that has not started.
78
+ otto: "scanning",
79
+ title: "No queries found",
80
+ message: "No React Query queries are currently active.\n\nTo see queries here:\n• Make API calls using useQuery\n• Ensure queries are within QueryClientProvider\n• Check console for debugging info"
81
+ }
82
+ }),
67
83
  contentContainerStyle: styles.queryListContent
68
84
  })]
69
85
  });
@@ -33,13 +33,12 @@ function MutationBrowserFooter({
33
33
  const paddingBottom = (0, _react.useMemo)(() => {
34
34
  return !isFloatingMode ? insets.bottom : 0;
35
35
  }, [isFloatingMode, insets.bottom]);
36
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
36
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolFooter, {
37
37
  // Force re-render with key change
38
- style: [styles.filterFooter, {
39
- paddingBottom
40
- },
41
- // Remove border radius when docked to bottom
42
- !isFloatingMode && styles.dockedFooter],
38
+ floating: isFloatingMode,
39
+ safeArea: false,
40
+ paddingBottom: paddingBottom,
41
+ style: styles.filterFooter,
43
42
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
44
43
  style: styles.filterContainer,
45
44
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MutationStatusCount.default, {
@@ -52,19 +51,8 @@ function MutationBrowserFooter({
52
51
  }
53
52
  const styles = _reactNative.StyleSheet.create({
54
53
  filterFooter: {
55
- borderTopWidth: 1,
56
- borderTopColor: _sharedUi.night.color.border,
57
- paddingVertical: 8,
58
- paddingHorizontal: 0,
59
- // Transparent so the night sheet's star field shows through.
60
- // Night glass bar — matches the shared EventStepperFooter backing.
61
- backgroundColor: "rgba(5, 5, 5, 0.92)",
62
- borderBottomLeftRadius: 14,
63
- borderBottomRightRadius: 14
64
- },
65
- dockedFooter: {
66
- borderBottomLeftRadius: 0,
67
- borderBottomRightRadius: 0
54
+ paddingTop: 8,
55
+ paddingHorizontal: 0
68
56
  },
69
57
  filterContainer: {
70
58
  minHeight: 32,
@@ -29,12 +29,11 @@ function QueryBrowserFooter({
29
29
  const insets = (0, _sharedUi.useSafeAreaInsets)({
30
30
  minBottom: 16
31
31
  });
32
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
33
- style: [styles.filterFooter, {
34
- paddingBottom: !isFloatingMode ? insets.bottom : 0
35
- },
36
- // Remove border radius when docked to bottom
37
- !isFloatingMode && styles.dockedFooter],
32
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolFooter, {
33
+ floating: isFloatingMode,
34
+ safeArea: false,
35
+ paddingBottom: !isFloatingMode ? insets.bottom : 0,
36
+ style: styles.filterFooter,
38
37
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
39
38
  style: styles.filterContainer,
40
39
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatusCount.default, {
@@ -47,19 +46,8 @@ function QueryBrowserFooter({
47
46
  }
48
47
  const styles = _reactNative.StyleSheet.create({
49
48
  filterFooter: {
50
- borderTopWidth: 1,
51
- borderTopColor: _sharedUi.night.color.border,
52
- paddingVertical: 8,
53
- paddingHorizontal: 0,
54
- // Transparent so the night sheet's star field shows through.
55
- // Night glass bar — matches the shared EventStepperFooter backing.
56
- backgroundColor: "rgba(5, 5, 5, 0.92)",
57
- borderBottomLeftRadius: 14,
58
- borderBottomRightRadius: 14
59
- },
60
- dockedFooter: {
61
- borderBottomLeftRadius: 0,
62
- borderBottomRightRadius: 0
49
+ paddingTop: 8,
50
+ paddingHorizontal: 0
63
51
  },
64
52
  filterContainer: {
65
53
  minHeight: 32,
@@ -27,6 +27,12 @@ function ReactQueryModalHeader({
27
27
  showWifiToggle = false
28
28
  }) {
29
29
  const [isSearchActive, setIsSearchActive] = (0, _react.useState)(false);
30
+ // True while the header's clear ✕ is being pressed. With a mouse, pressing
31
+ // the ✕ blurs the input FIRST, and the blur handler closes search — which
32
+ // unmounts the ✕ before its own press can fire, so the query was never
33
+ // cleared (desktop). Press-in lands before the blur, so the blur handler can
34
+ // tell this dismissal apart from a click elsewhere.
35
+ const clearPressRef = (0, _react.useRef)(false);
30
36
  const searchInputRef = (0, _react.useRef)(null);
31
37
 
32
38
  // Auto-focus search input when search becomes active
@@ -84,42 +90,29 @@ function ReactQueryModalHeader({
84
90
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Content, {
85
91
  title: "",
86
92
  noMargin: true,
87
- children: isSearchActive ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
88
- style: styles.headerSearchContainer,
89
- testID: "buoy-rq-search-field",
90
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Search, {
91
- size: 14,
92
- color: _sharedUi.night.color.textSecondary
93
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
94
- ref: searchInputRef,
95
- testID: "buoy-rq-search",
96
- style: styles.headerSearchInput,
97
- placeholder: "Search query keys...",
98
- placeholderTextColor: _sharedUi.night.color.textTertiary,
99
- value: searchText,
100
- onChangeText: handleSearch,
101
- onSubmitEditing: () => setIsSearchActive(false),
102
- onBlur: () => setIsSearchActive(false),
103
- "sentry-label": "ignore react query search header",
104
- accessibilityLabel: "Search queries and mutations",
105
- autoCapitalize: "none",
106
- autoCorrect: false,
107
- returnKeyType: "search"
108
- }), searchText.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
109
- onPress: () => {
110
- handleSearch("");
111
- setIsSearchActive(false);
112
- },
113
- "sentry-label": "ignore clear search header",
114
- testID: "buoy-rq-search-clear",
115
- accessibilityRole: "button",
116
- accessibilityLabel: "Clear search",
117
- style: styles.headerSearchClear,
118
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.X, {
119
- size: 14,
120
- color: _sharedUi.night.color.textSecondary
121
- })
122
- }) : null]
93
+ children: isSearchActive ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Search, {
94
+ value: searchText,
95
+ onChangeText: handleSearch,
96
+ onCancel: () => {
97
+ handleSearch("");
98
+ setIsSearchActive(false);
99
+ },
100
+ onDismiss: () => setIsSearchActive(false),
101
+ dismissOnBlur: true,
102
+ clearOnlyWhenText: true,
103
+ placeholder: "Search query keys...",
104
+ accessibilityLabel: "Search queries and mutations",
105
+ iconSize: 14
106
+ // These handles predate the shared field and are the reverse of
107
+ // its convention (container = "-field", input = bare); kept as-is
108
+ // so the e2e suite keeps its targets.
109
+ ,
110
+ testID: "buoy-rq-search",
111
+ containerTestID: "buoy-rq-search-field",
112
+ clearTestID: "buoy-rq-search-clear",
113
+ inputProps: {
114
+ "sentry-label": "ignore react query search header"
115
+ }
123
116
  }) : showWifiToggle ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
124
117
  style: styles.tabRow,
125
118
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
@@ -188,29 +181,6 @@ const styles = _reactNative.StyleSheet.create({
188
181
  tabSelectorWrap: {
189
182
  flex: 1
190
183
  },
191
- headerSearchContainer: {
192
- flexDirection: "row",
193
- alignItems: "center",
194
- backgroundColor: _sharedUi.night.color.surfaceElevated,
195
- borderRadius: 6,
196
- paddingHorizontal: 8,
197
- paddingVertical: 4,
198
- gap: 6,
199
- marginHorizontal: 12,
200
- marginVertical: 8
201
- },
202
- headerSearchInput: {
203
- flex: 1,
204
- color: _sharedUi.night.color.text,
205
- fontSize: 13,
206
- fontFamily: "monospace",
207
- padding: 0,
208
- margin: 0,
209
- minHeight: 18
210
- },
211
- headerSearchClear: {
212
- padding: 2
213
- },
214
184
  headerActionButton: {
215
185
  padding: 6,
216
186
  borderRadius: 4
@@ -4,10 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _reactNative = require("react-native");
7
+ var _sharedUi = require("@buoy-gg/shared-ui");
8
8
  var _QueryStatus = _interopRequireDefault(require("./QueryStatus"));
9
9
  var _useQueryStatusCounts = require("../../hooks/useQueryStatusCounts");
10
- var _react = require("react");
11
10
  var _jsxRuntime = require("react/jsx-runtime");
12
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
12
  /**
@@ -25,96 +24,61 @@ const MutationStatusCount = ({
25
24
  error,
26
25
  paused
27
26
  } = (0, _useQueryStatusCounts.useMutationStatusCounts)();
28
- const [isScrolling, setIsScrolling] = (0, _react.useState)(false);
29
- const touchStartX = (0, _react.useRef)(0);
30
- const touchStartY = (0, _react.useRef)(0);
27
+ const {
28
+ scrollProps,
29
+ onTouchStart: handleTouchStart,
30
+ isTap
31
+ } = (0, _sharedUi.useChipTap)();
31
32
  const handleFilterClick = (filter, event) => {
32
- if (event) {
33
- const dx = Math.abs(event.nativeEvent.pageX - touchStartX.current);
34
- const dy = Math.abs(event.nativeEvent.pageY - touchStartY.current);
35
- if (dx > 5 || dy > 5 || isScrolling) {
36
- return;
37
- }
38
- }
33
+ if (!isTap(event)) return;
39
34
  if (onFilterChange) {
40
35
  onFilterChange(activeFilter === filter ? null : filter);
41
36
  }
42
37
  };
43
- const handleTouchStart = event => {
44
- touchStartX.current = event.nativeEvent.pageX;
45
- touchStartY.current = event.nativeEvent.pageY;
46
- };
47
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
48
- style: styles.mutationStatusContainer,
49
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
50
- "sentry-label": "ignore devtools mutation status count scroll",
51
- horizontal: true,
52
- showsHorizontalScrollIndicator: false,
53
- style: styles.scrollView,
54
- contentContainerStyle: styles.scrollContent,
55
- onScrollBeginDrag: () => setIsScrolling(true),
56
- onScrollEndDrag: () => setTimeout(() => setIsScrolling(false), 300),
57
- onMomentumScrollBegin: () => setIsScrolling(true),
58
- onMomentumScrollEnd: () => setTimeout(() => setIsScrolling(false), 300),
59
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
60
- label: "Pending",
61
- color: "blue",
62
- count: pending,
63
- isActive: activeFilter === "pending",
64
- onPress: event => handleFilterClick("pending", event),
65
- onTouchStart: handleTouchStart,
66
- testID: "buoy-rq-mstatus-pending",
67
- showLabel: true,
68
- size: size
69
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
70
- label: "Success",
71
- color: "green",
72
- count: success,
73
- isActive: activeFilter === "success",
74
- onPress: event => handleFilterClick("success", event),
75
- onTouchStart: handleTouchStart,
76
- testID: "buoy-rq-mstatus-success",
77
- showLabel: true,
78
- size: size
79
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
80
- label: "Error",
81
- color: "red",
82
- count: error,
83
- isActive: activeFilter === "error",
84
- onPress: event => handleFilterClick("error", event),
85
- onTouchStart: handleTouchStart,
86
- testID: "buoy-rq-mstatus-error",
87
- showLabel: true,
88
- size: size
89
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
90
- label: "Paused",
91
- color: "purple",
92
- count: paused,
93
- isActive: activeFilter === "paused",
94
- onPress: event => handleFilterClick("paused", event),
95
- onTouchStart: handleTouchStart,
96
- testID: "buoy-rq-mstatus-paused",
97
- showLabel: true,
98
- size: size
99
- })]
100
- })
38
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_sharedUi.ChipStrip, {
39
+ scrollProps: scrollProps,
40
+ sentryLabel: "ignore devtools mutation status count scroll",
41
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
42
+ label: "Pending",
43
+ color: "blue",
44
+ count: pending,
45
+ isActive: activeFilter === "pending",
46
+ onPress: event => handleFilterClick("pending", event),
47
+ onTouchStart: handleTouchStart,
48
+ testID: "buoy-rq-mstatus-pending",
49
+ showLabel: true,
50
+ size: size
51
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
52
+ label: "Success",
53
+ color: "green",
54
+ count: success,
55
+ isActive: activeFilter === "success",
56
+ onPress: event => handleFilterClick("success", event),
57
+ onTouchStart: handleTouchStart,
58
+ testID: "buoy-rq-mstatus-success",
59
+ showLabel: true,
60
+ size: size
61
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
62
+ label: "Error",
63
+ color: "red",
64
+ count: error,
65
+ isActive: activeFilter === "error",
66
+ onPress: event => handleFilterClick("error", event),
67
+ onTouchStart: handleTouchStart,
68
+ testID: "buoy-rq-mstatus-error",
69
+ showLabel: true,
70
+ size: size
71
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
72
+ label: "Paused",
73
+ color: "purple",
74
+ count: paused,
75
+ isActive: activeFilter === "paused",
76
+ onPress: event => handleFilterClick("paused", event),
77
+ onTouchStart: handleTouchStart,
78
+ testID: "buoy-rq-mstatus-paused",
79
+ showLabel: true,
80
+ size: size
81
+ })]
101
82
  });
102
83
  };
103
- const styles = _reactNative.StyleSheet.create({
104
- mutationStatusContainer: {
105
- flex: 1,
106
- minWidth: 0
107
- },
108
- scrollView: {
109
- flex: 1
110
- },
111
- scrollContent: {
112
- flexDirection: "row",
113
- alignItems: "center",
114
- gap: 8,
115
- paddingHorizontal: 4,
116
- paddingVertical: 4,
117
- flexGrow: 1
118
- }
119
- });
120
84
  var _default = exports.default = MutationStatusCount;
@@ -135,13 +135,11 @@ function MutationsList({
135
135
  windowSize: 10,
136
136
  scrollEnabled: false
137
137
  })
138
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
139
- style: styles.emptyContainer,
140
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
141
- style: styles.emptyText,
142
- testID: "buoy-rq-mutations-empty",
143
- children: activeFilter ? `No ${activeFilter} mutations found` : "No mutations found"
144
- })
138
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolEmptyState, {
139
+ testID: "buoy-rq-mutations-empty",
140
+ otto: activeFilter ? "filtering" : "scanning",
141
+ title: "No mutations found",
142
+ message: activeFilter ? `No ${activeFilter} mutations. Pick another status to see the rest.` : "Mutations run through useMutation will appear here."
145
143
  }), selectedMutation && !hideInfoPanel && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
146
144
  style: [styles.mutationInfo, {
147
145
  height: infoHeightAnim
@@ -20,6 +20,7 @@ function QueryBrowser({
20
20
  onQuerySelect,
21
21
  activeFilter,
22
22
  emptyStateMessage,
23
+ emptyState,
23
24
  contentContainerStyle,
24
25
  queries: externalQueries,
25
26
  searchText = "",
@@ -98,12 +99,12 @@ function QueryBrowser({
98
99
  onQuerySelect(query);
99
100
  }, [selectedQuery?.queryHash, onQuerySelect]);
100
101
  if (filteredQueries.length === 0) {
101
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
102
- style: styles.emptyContainer,
103
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
104
- style: styles.emptyText,
105
- testID: "buoy-rq-empty",
106
- children: emptyStateMessage || (activeFilter ? `No ${activeFilter} queries found` : "No queries found")
102
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolEmptyState, {
103
+ testID: "buoy-rq-empty",
104
+ ...(emptyState ?? {
105
+ otto: "empty",
106
+ title: "No queries found",
107
+ message: emptyStateMessage || (activeFilter ? `No ${activeFilter} queries found` : "No queries found")
107
108
  })
108
109
  });
109
110
  }
@@ -130,17 +131,8 @@ function QueryBrowser({
130
131
  isSelected: selectedQuery?.queryHash === query.queryHash,
131
132
  onSelect: handleQuerySelect
132
133
  }),
133
- showsVerticalScrollIndicator: true
134
- // Clipped cells fail Detox's hittability check even when they are on
135
- // screen, so e2e bundles (Metro with EXPO_PUBLIC_E2E=1) turn clipping
136
- // off. Inlined at bundle time; a non-inlining bundler keeps prod
137
- // behavior.
138
- ,
139
- removeClippedSubviews: !(typeof process !== "undefined" && process.env?.EXPO_PUBLIC_E2E),
140
- initialNumToRender: 12,
141
- maxToRenderPerBatch: 8,
142
- windowSize: 5,
143
- updateCellsBatchingPeriod: 50
134
+ showsVerticalScrollIndicator: true,
135
+ ..._sharedUi.EVENT_LIST_PRESET
144
136
  })
145
137
  );
146
138
  }
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _react = require("react");
8
- var _reactNative = require("react-native");
7
+ var _sharedUi = require("@buoy-gg/shared-ui");
9
8
  var _QueryStatus = _interopRequireDefault(require("./QueryStatus"));
10
9
  var _useQueryStatusCounts = _interopRequireDefault(require("../../hooks/useQueryStatusCounts"));
11
10
  var _jsxRuntime = require("react/jsx-runtime");
@@ -25,122 +24,77 @@ const QueryStatusCount = ({
25
24
  paused,
26
25
  inactive
27
26
  } = (0, _useQueryStatusCounts.default)();
28
-
29
- // Scroll state management like ChipTabs
30
- const [isScrolling, setIsScrolling] = (0, _react.useState)(false);
31
- const touchStartX = (0, _react.useRef)(0);
32
- const touchStartY = (0, _react.useRef)(0);
27
+ const {
28
+ scrollProps,
29
+ onTouchStart: handleTouchStart,
30
+ isTap
31
+ } = (0, _sharedUi.useChipTap)();
33
32
  const handleFilterClick = (filter, event) => {
34
- if (event) {
35
- // Calculate distance moved during touch (like ChipTabs)
36
- const dx = Math.abs(event.nativeEvent.pageX - touchStartX.current);
37
- const dy = Math.abs(event.nativeEvent.pageY - touchStartY.current);
38
-
39
- // If touch moved more than 5px in any direction, it's a swipe, not a tap
40
- if (dx > 5 || dy > 5 || isScrolling) {
41
- return; // Don't trigger filter change
42
- }
43
- }
33
+ if (!isTap(event)) return;
44
34
  if (onFilterChange) {
45
35
  // Toggle filter: if already active, clear it; otherwise set it
46
36
  onFilterChange(activeFilter === filter ? null : filter);
47
37
  }
48
38
  };
49
- const handleTouchStart = event => {
50
- touchStartX.current = event.nativeEvent.pageX;
51
- touchStartY.current = event.nativeEvent.pageY;
52
- };
53
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
54
- style: styles.queryStatusContainer,
55
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
56
- "sentry-label": "ignore devtools query status count scroll",
57
- horizontal: true,
58
- showsHorizontalScrollIndicator: false,
59
- style: styles.scrollView,
60
- contentContainerStyle: styles.scrollContent,
61
- onScrollBeginDrag: () => setIsScrolling(true),
62
- onScrollEndDrag: () => setTimeout(() => setIsScrolling(false), 300),
63
- onMomentumScrollBegin: () => setIsScrolling(true),
64
- onMomentumScrollEnd: () => setTimeout(() => setIsScrolling(false), 300),
65
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
66
- label: "Fresh",
67
- color: "green",
68
- count: fresh,
69
- isActive: activeFilter === "fresh",
70
- onPress: event => handleFilterClick("fresh", event),
71
- onTouchStart: handleTouchStart,
72
- testID: "buoy-rq-status-fresh",
73
- showLabel: true // Always show labels now
74
- ,
75
- size: size
76
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
77
- label: "Loading",
78
- color: "blue",
79
- count: fetching,
80
- isActive: activeFilter === "fetching",
81
- onPress: event => handleFilterClick("fetching", event),
82
- onTouchStart: handleTouchStart,
83
- testID: "buoy-rq-status-fetching",
84
- showLabel: true // Always show labels now
85
- ,
86
- size: size
87
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
88
- label: "Paused",
89
- color: "purple",
90
- count: paused,
91
- isActive: activeFilter === "paused",
92
- onPress: event => handleFilterClick("paused", event),
93
- onTouchStart: handleTouchStart,
94
- testID: "buoy-rq-status-paused",
95
- showLabel: true // Always show labels now
96
- ,
97
- size: size
98
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
99
- label: "Stale",
100
- color: "yellow",
101
- count: stale,
102
- isActive: activeFilter === "stale",
103
- onPress: event => handleFilterClick("stale", event),
104
- onTouchStart: handleTouchStart,
105
- testID: "buoy-rq-status-stale",
106
- showLabel: true // Always show labels now
107
- ,
108
- size: size
109
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
110
- label: "Idle",
111
- color: "gray",
112
- count: inactive,
113
- isActive: activeFilter === "inactive",
114
- onPress: event => handleFilterClick("inactive", event),
115
- onTouchStart: handleTouchStart,
116
- testID: "buoy-rq-status-inactive",
117
- showLabel: true // Always show labels now
118
- ,
119
- size: size
120
- })]
121
- })
39
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_sharedUi.ChipStrip, {
40
+ scrollProps: scrollProps,
41
+ sentryLabel: "ignore devtools query status count scroll",
42
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
43
+ label: "Fresh",
44
+ color: "green",
45
+ count: fresh,
46
+ isActive: activeFilter === "fresh",
47
+ onPress: event => handleFilterClick("fresh", event),
48
+ onTouchStart: handleTouchStart,
49
+ testID: "buoy-rq-status-fresh",
50
+ showLabel: true // Always show labels now
51
+ ,
52
+ size: size
53
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
54
+ label: "Loading",
55
+ color: "blue",
56
+ count: fetching,
57
+ isActive: activeFilter === "fetching",
58
+ onPress: event => handleFilterClick("fetching", event),
59
+ onTouchStart: handleTouchStart,
60
+ testID: "buoy-rq-status-fetching",
61
+ showLabel: true // Always show labels now
62
+ ,
63
+ size: size
64
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
65
+ label: "Paused",
66
+ color: "purple",
67
+ count: paused,
68
+ isActive: activeFilter === "paused",
69
+ onPress: event => handleFilterClick("paused", event),
70
+ onTouchStart: handleTouchStart,
71
+ testID: "buoy-rq-status-paused",
72
+ showLabel: true // Always show labels now
73
+ ,
74
+ size: size
75
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
76
+ label: "Stale",
77
+ color: "yellow",
78
+ count: stale,
79
+ isActive: activeFilter === "stale",
80
+ onPress: event => handleFilterClick("stale", event),
81
+ onTouchStart: handleTouchStart,
82
+ testID: "buoy-rq-status-stale",
83
+ showLabel: true // Always show labels now
84
+ ,
85
+ size: size
86
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryStatus.default, {
87
+ label: "Idle",
88
+ color: "gray",
89
+ count: inactive,
90
+ isActive: activeFilter === "inactive",
91
+ onPress: event => handleFilterClick("inactive", event),
92
+ onTouchStart: handleTouchStart,
93
+ testID: "buoy-rq-status-inactive",
94
+ showLabel: true // Always show labels now
95
+ ,
96
+ size: size
97
+ })]
122
98
  });
123
99
  };
124
- const styles = _reactNative.StyleSheet.create({
125
- queryStatusContainer: {
126
- // Container for ScrollView - take full width
127
- flex: 1,
128
- minWidth: 0
129
- },
130
- scrollView: {
131
- // ScrollView itself styles
132
- flex: 1
133
- },
134
- scrollContent: {
135
- // ScrollView content styles
136
- flexDirection: "row",
137
- alignItems: "center",
138
- gap: 8,
139
- // Spacing between chips
140
- paddingHorizontal: 4,
141
- // Small padding on ends
142
- paddingVertical: 4,
143
- flexGrow: 1 // Allow content to grow to fill available space
144
- }
145
- });
146
100
  var _default = exports.default = QueryStatusCount;