@ai-matrx/canvas 0.9.0 → 0.9.2

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,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.2
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/canvas/v0.9.1..npm/canvas/v0.9.2 -- apps/shared/canvas`).
7
+ No source changes intended and no consumer action required.
8
+
9
+ ## 0.9.1
10
+
11
+ Live walk of 0.9.0 (localhost, 2026-10-07): a tab spun forever when its code never arrived (the dev server was paused mid-load), and a failed one showed "This item failed to load".
12
+
13
+ - **A body whose code does not arrive is never a silent spinner.** A failed load already ended in "This item failed to load" with Try again; a load that never answers now ends the same way after `CANVAS_BODY_STALL_MS` (20s): "This item is taking a long time to load." with Try again and Close tab. Try again (both paths) asks for the code from a fresh lazy component. The tab's data (a conversation, a draft's alias) lives outside the body and is untouched.
14
+
15
+ ### Consumer action
16
+
17
+ - None.
18
+
3
19
  ## 0.9.0
4
20
 
5
21
  Live walk of 0.8.5 (localhost, 2026-10-07): the scrolling strip showed the tabs beside the current one sliced at its edges ("uick Chat", "aved items", "atchpad"), and at 375px the second tab was just "("; Quick Notes / Notifications / Quick Chat stacked in an 800px window left Notifications its header and one row.
package/dist/react.cjs CHANGED
@@ -2990,8 +2990,23 @@ var Rendered = (0, import_react8.memo)(function Rendered2({
2990
2990
  presentation
2991
2991
  }) {
2992
2992
  const props = { item, data: item.data, paneId, isFocused, isVisible, canvas, windowId, presentation };
2993
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ItemBoundary, { item, onClose: () => canvas.close(item.id), onRetry: () => resetKindComponent(kind), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react8.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "mxc-loading", "aria-busy": "true" }), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(KindRender, { kind, props }) }) });
2993
+ const [attempt, setAttempt] = (0, import_react8.useState)(0);
2994
+ const retry = () => {
2995
+ resetKindComponent(kind);
2996
+ setAttempt((n) => n + 1);
2997
+ };
2998
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ItemBoundary, { item, onClose: () => canvas.close(item.id), onRetry: retry, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react8.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(LoadingBody, { onRetry: retry, onClose: () => canvas.close(item.id) }), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(KindRender, { kind, props }) }, attempt) });
2994
2999
  });
3000
+ var CANVAS_BODY_STALL_MS = 2e4;
3001
+ function LoadingBody({ onRetry, onClose }) {
3002
+ const [stalled, setStalled] = (0, import_react8.useState)(false);
3003
+ (0, import_react8.useEffect)(() => {
3004
+ const timer = setTimeout(() => setStalled(true), CANVAS_BODY_STALL_MS);
3005
+ return () => clearTimeout(timer);
3006
+ }, []);
3007
+ if (!stalled) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "mxc-loading", "aria-busy": "true" });
3008
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ItemProblem, { message: "This item is taking a long time to load.", onRetry, onClose });
3009
+ }
2995
3010
  function KindRender({ kind, props }) {
2996
3011
  const Render = kindComponent(kind);
2997
3012
  if (!Render) throw new Error(`[@ai-matrx/canvas] kind "${kind.id}" has nothing to render.`);