@mastra/playground-ui 16.0.0-alpha.0 → 16.0.0-alpha.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 16.0.0-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - The "Run Experiment" button is now disabled when a dataset has no items, with a tooltip explaining that items must be added first. ([#14031](https://github.com/mastra-ai/mastra/pull/14031))
8
+
9
+ - Added permission denied handling for dataset pages. Datasets now show a "Permission Denied" screen when the user lacks access, matching the behavior of agents, workflows, and other resources. ([#13876](https://github.com/mastra-ai/mastra/pull/13876))
10
+
11
+ - Updated dependencies [[`866cc2c`](https://github.com/mastra-ai/mastra/commit/866cc2cb1f0e3b314afab5194f69477fada745d1), [`6bcbf8a`](https://github.com/mastra-ai/mastra/commit/6bcbf8a6774d5a53b21d61db8a45ce2593ca1616), [`18c3a90`](https://github.com/mastra-ai/mastra/commit/18c3a90c9e48cf69500e308affeb8eba5860b2af), [`f35487b`](https://github.com/mastra-ai/mastra/commit/f35487bb2d46c636e22aa71d90025613ae38235a), [`6dc2192`](https://github.com/mastra-ai/mastra/commit/6dc21921aef0f0efab15cd0805fa3d18f277a76f), [`eeb3a3f`](https://github.com/mastra-ai/mastra/commit/eeb3a3f43aca10cf49479eed2a84b7d9ecea02ba), [`05f8d90`](https://github.com/mastra-ai/mastra/commit/05f8d9009290ce6aa03428b3add635268615db85), [`4b8da97`](https://github.com/mastra-ai/mastra/commit/4b8da97a5ce306e97869df6c39535d9069e563db), [`256df35`](https://github.com/mastra-ai/mastra/commit/256df3571d62beb3ad4971faa432927cc140e603)]:
12
+ - @mastra/core@1.11.0-alpha.1
13
+ - @mastra/client-js@1.8.0-alpha.1
14
+ - @mastra/react@0.2.10-alpha.1
15
+
3
16
  ## 16.0.0-alpha.0
4
17
 
5
18
  ### Minor Changes
package/dist/index.cjs.js CHANGED
@@ -37148,7 +37148,7 @@ function EmptyDatasetsTable({ onCreateClick }) {
37148
37148
  ) });
37149
37149
  }
37150
37150
 
37151
- function DatasetsTable({ datasets, isLoading, onCreateClick }) {
37151
+ function DatasetsTable({ datasets, isLoading, error, onCreateClick }) {
37152
37152
  const [search, setSearch] = React.useState("");
37153
37153
  const { navigate, paths } = useLinkComponent();
37154
37154
  const tableData = React.useMemo(() => datasets, [datasets]);
@@ -37159,6 +37159,9 @@ function DatasetsTable({ datasets, isLoading, onCreateClick }) {
37159
37159
  });
37160
37160
  const ths = table.getHeaderGroups()[0];
37161
37161
  const rows = table.getRowModel().rows.concat();
37162
+ if (error && compatibility.is403ForbiddenError(error)) {
37163
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(PermissionDenied, { resource: "datasets" }) });
37164
+ }
37162
37165
  if (rows.length === 0 && !isLoading) {
37163
37166
  return /* @__PURE__ */ jsxRuntime.jsx(EmptyDatasetsTable, { onCreateClick });
37164
37167
  }
@@ -40165,6 +40168,7 @@ function DatasetHeader({
40165
40168
  onDuplicateClick,
40166
40169
  onDeleteClick,
40167
40170
  experimentTriggerSlot,
40171
+ disableExperimentTrigger = false,
40168
40172
  onExperimentClick,
40169
40173
  className
40170
40174
  }) {
@@ -40190,7 +40194,16 @@ function DatasetHeader({
40190
40194
  ] })
40191
40195
  ] }),
40192
40196
  /* @__PURE__ */ jsxRuntime.jsx(MainHeader.Column, { children: /* @__PURE__ */ jsxRuntime.jsxs(ButtonsGroup, { children: [
40193
- experimentTriggerSlot ? experimentTriggerSlot : onExperimentClick ? /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", onClick: onExperimentClick, children: [
40197
+ experimentTriggerSlot ? disableExperimentTrigger ? /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
40198
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cursor-not-allowed", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none opacity-50", inert: true, "aria-disabled": "true", children: experimentTriggerSlot }) }) }),
40199
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: "Add items to the dataset before running an experiment" })
40200
+ ] }) : experimentTriggerSlot : onExperimentClick ? disableExperimentTrigger ? /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
40201
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cursor-not-allowed", children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", disabled: true, tabIndex: -1, children: [
40202
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, {}),
40203
+ "Run Experiment"
40204
+ ] }) }) }),
40205
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: "Add items to the dataset before running an experiment" })
40206
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", onClick: onExperimentClick, children: [
40194
40207
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, {}),
40195
40208
  "Run Experiment"
40196
40209
  ] }) : null,
@@ -41238,6 +41251,11 @@ function DatasetPageContent({
41238
41251
  isFetchingNextPage,
41239
41252
  hasNextPage
41240
41253
  } = useDatasetItems(datasetId, debouncedSearch || void 0, activeDatasetVersion);
41254
+ const { data: unfilteredItems = [], isLoading: isUnfilteredLoading } = useDatasetItems(
41255
+ datasetId,
41256
+ void 0,
41257
+ activeDatasetVersion
41258
+ );
41241
41259
  const [experimentsFilters, setExperimentsFilters] = React.useState({});
41242
41260
  const { data: experimentsData, isLoading: isExperimentsLoading } = useDatasetExperiments(
41243
41261
  datasetId,
@@ -41325,6 +41343,7 @@ function DatasetPageContent({
41325
41343
  onDuplicateClick: () => setDuplicateDialogOpen(true),
41326
41344
  onDeleteClick,
41327
41345
  experimentTriggerSlot,
41346
+ disableExperimentTrigger: !isUnfilteredLoading && unfilteredItems.length === 0,
41328
41347
  onExperimentClick
41329
41348
  }
41330
41349
  ),