@stapel/workspaces-react 0.11.1 → 0.12.0

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,62 @@
1
1
  # @stapel/workspaces-react
2
2
 
3
+ ## 0.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c5c0a11: Default skins render the error surface through core's split copy: the human
8
+ sentence as the alert's message, and the technical detail (`HTTP 500`) as a
9
+ muted, small description beside it instead of a protocol number spliced into
10
+ the sentence. Requires `@stapel/core >= 0.12.0`.
11
+
12
+ ## 0.11.2
13
+
14
+ ### Patch Changes
15
+
16
+ - 3ac8297: fix: the error surface a 500 puts on screen — readable, and in the user's language
17
+
18
+ Two defects an owner hit behind a backend 500 on a live sandbox, both fixed at
19
+ their root rather than at the one alert that showed them.
20
+
21
+ **The alert was unreadable on a dark deployment.** `@stapel/tokens-antd`'s
22
+ `readLiveCssVar` served the host's LIVE `--stapel-*` custom properties for
23
+ whatever mode the caller asked for — but those properties resolve through the
24
+ document's active `data-theme`, so they are the DOCUMENT's mode, not the
25
+ caller's. A default skin defaulting `mode` to `"light"` inside
26
+ `<html data-theme="dark">` therefore got antd's LIGHT algorithm (deriving
27
+ `--ant-color-error-bg: #fff2f0`, near-white) welded to a LIVE DARK
28
+ `--ant-color-text: #f4f5f7` — measured 1.00:1 contrast.
29
+
30
+ - `resolveThemeMode()` (new export) reads the same `data-theme` attribute
31
+ `@stapel/tokens`' `tokens.css` keys its dark block on. `mode` is now optional
32
+ on `toAntdTheme`/`toAntdThemeConfig` and defaults to it.
33
+ - `readLiveCssVar` serves a live value only when the document is in the mode
34
+ being asked for; otherwise the compiled-in default for the REQUESTED mode.
35
+ The bridge can no longer emit a blended theme.
36
+ - Every `@stapel/profiles-react` default skin defaults `mode` to
37
+ `resolveThemeMode()` instead of `"light"`, so it self-themes with no host
38
+ wiring. Pass `mode` explicitly to pin a side.
39
+
40
+ **The alert showed `Request failed with status 500`.** That is
41
+ `parseErrorEnvelope`'s own diagnostic for a response with no error envelope (a
42
+ Django 500 under `DEBUG=False` returns HTML) — the HTTP client's internals, in
43
+ English, on a Russian UI. The one-dialect machinery existed but had no rung a
44
+ query/mutation-driven skin could reach, and no catalogue behind the codes core
45
+ itself mints.
46
+
47
+ - `@stapel/core` now ships an error FLOOR (`stapel.http.*`,
48
+ `stapel.transport.failed`, `stapel.error.unknown`) in en and ru, seeded by
49
+ `createI18n` under every locale before any caller bundle — a host wires
50
+ nothing, and any pair or host bundle registered later still wins the key.
51
+ - `useErrorText()` (new export) folds ANY thrown value into that dialect in one
52
+ call, which is what a skin holding `error: unknown` needed.
53
+ - `formatFlowError` exposes the error's HTTP `{status}` to templates and widens
54
+ core's OWN `stapel.http.<status>` codes to a class-wide `stapel.http.5xx`
55
+ entry. Real backend codes are never widened — two different 404s stay two
56
+ different states.
57
+ - Default skins across profiles-react, auth-react, notifications-react and
58
+ workspaces-react now render `useErrorText(...)` instead of `error.message`.
59
+
3
60
  ## 0.11.1
4
61
 
5
62
  ### Patch Changes
@@ -0,0 +1,8 @@
1
+ import type { CSSProperties, ReactElement } from "react";
2
+ import type { FlowErrorDisplay } from "@stapel/core";
3
+ export declare function ErrorAlert(props: {
4
+ error: FlowErrorDisplay | undefined;
5
+ style?: CSSProperties | undefined;
6
+ testId?: string | undefined;
7
+ }): ReactElement | null;
8
+ //# sourceMappingURL=ErrorAlert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorAlert.d.ts","sourceRoot":"","sources":["../../src/default/ErrorAlert.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAChC,KAAK,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACpC,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,GAAG,YAAY,GAAG,IAAI,CAqBtB"}
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * The one error surface this pair's default skins render, so the split copy
4
+ * core produces reaches a screen the same way everywhere.
5
+ *
6
+ * Core's `describeFlowError` splits a failure into the sentence a person
7
+ * reads and the technical detail a support agent quotes (owner report
8
+ * 2026-08-09: the status used to be spliced into the sentence, which ended
9
+ * in a bare `" (500)"` — and a product does not read a protocol number out to
10
+ * a person). The split is only worth anything if a
11
+ * skin actually renders both halves at their own weights: `message` at
12
+ * normal weight, `detail` muted and small, where an eye skips it and a
13
+ * support agent finds it.
14
+ *
15
+ * `undefined` in — including a `detail` that core left `undefined` because
16
+ * there was nothing worth quoting — renders nothing rather than an empty
17
+ * muted line.
18
+ */
19
+ import { Alert, Typography } from "antd";
20
+ export function ErrorAlert(props) {
21
+ const { error } = props;
22
+ if (!error)
23
+ return null;
24
+ return (_jsx(Alert, { type: "error", showIcon: true, ...(props.style ? { style: props.style } : {}), ...(props.testId ? { "data-testid": props.testId } : {}), message: error.message, ...(error.detail
25
+ ? {
26
+ description: (_jsx(Typography.Text, { type: "secondary", style: { fontSize: 12 }, children: error.detail })),
27
+ }
28
+ : {}) }));
29
+ }
30
+ //# sourceMappingURL=ErrorAlert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorAlert.js","sourceRoot":"","sources":["../../src/default/ErrorAlert.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAIzC,MAAM,UAAU,UAAU,CAAC,KAI1B;IACC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO,CACL,KAAC,KAAK,IACJ,IAAI,EAAC,OAAO,EACZ,QAAQ,WACJ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAC3C,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EACzD,OAAO,EAAE,KAAK,CAAC,OAAO,KAClB,CAAC,KAAK,CAAC,MAAM;YACf,CAAC,CAAC;gBACE,WAAW,EAAE,CACX,KAAC,UAAU,CAAC,IAAI,IAAC,IAAI,EAAC,WAAW,EAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,YACtD,KAAK,CAAC,MAAM,GACG,CACnB;aACF;YACH,CAAC,CAAC,EAAE,CAAC,GACP,CACH,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MembersManager.d.ts","sourceRoot":"","sources":["../../src/default/MembersManager.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAU1C,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAID,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CA0JvE"}
1
+ {"version":3,"file":"MembersManager.d.ts","sourceRoot":"","sources":["../../src/default/MembersManager.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAW1C,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAID,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CA4JvE"}
@@ -15,14 +15,19 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
15
  * the invite dialog filters it out, as before.
16
16
  */
17
17
  import { useState } from "react";
18
- import { Alert, Button, Card, Input, Modal, Popconfirm, Select, Table, Typography } from "antd";
19
- import { useT } from "@stapel/core";
18
+ import { Button, Card, Input, Modal, Popconfirm, Select, Table, Typography } from "antd";
19
+ import { useErrorDisplay, useT } from "@stapel/core";
20
20
  import { Members } from "../headless/Members.js";
21
21
  import { RoleSelect } from "../headless/RoleSelect.js";
22
22
  import { WORKSPACES_I18N_KEYS } from "../i18n/keys.js";
23
+ import { ErrorAlert } from "./ErrorAlert.js";
23
24
  const DEFAULT_INVITE_ROLE = "member";
24
25
  export function MembersManager(props) {
25
26
  const t = useT();
27
+ // Never the raw `.message` — for a response with no error envelope that
28
+ // is the transport's own "Request failed with status 500" (owner report
29
+ // 2026-08-09). `useErrorText` folds any thrown value into the one dialect.
30
+ const errorDisplay = useErrorDisplay(WORKSPACES_I18N_KEYS.unknownError);
26
31
  const canManage = props.canManage ?? true;
27
32
  const [inviteOpen, setInviteOpen] = useState(false);
28
33
  const [emailsText, setEmailsText] = useState("");
@@ -76,7 +81,7 @@ export function MembersManager(props) {
76
81
  ]
77
82
  : []),
78
83
  ];
79
- return (_jsxs(Card, { "data-testid": "members-manager", children: [_jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: 16 }, children: [_jsxs("div", { children: [_jsx(Typography.Title, { level: 4, style: { marginTop: 0 }, children: t(WORKSPACES_I18N_KEYS.membersTitle) }), _jsx(Typography.Text, { type: "secondary", children: t(WORKSPACES_I18N_KEYS.membersSubtitle) })] }), canManage && (_jsx(Button, { type: "primary", onClick: openInvite, "data-analytics": "none", "data-analytics-reason": "local-ui-open-invite-dialog", children: t(WORKSPACES_I18N_KEYS.membersInvite) }))] }), isError && error && (_jsx(Alert, { style: { marginTop: 12 }, type: "error", showIcon: true, message: error.message })), _jsx(Table, { style: { marginTop: 16 }, size: "small", loading: isLoading, rowKey: (member) => member.id, dataSource: members, columns: columns, pagination: false }), _jsx(Modal, { title: t(WORKSPACES_I18N_KEYS.membersInviteDialogTitle), open: inviteOpen, onCancel: () => setInviteOpen(false), onOk: submitInvite, okButtonProps: { loading: isInviting, disabled: emailsText.trim().length === 0 }, children: _jsxs("div", { style: { display: "grid", gap: 12 }, children: [_jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.membersInviteEmailsLabel) }), _jsx(Input, { value: emailsText, onChange: (e) => setEmailsText(e.target.value), placeholder: t(WORKSPACES_I18N_KEYS.membersInviteEmailsPlaceholder) })] }), _jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.membersInviteRoleLabel) }), _jsx(Select, { value: inviteRole, onChange: setInviteRole, style: { width: "100%" }, loading: rolesBag.isLoading, options: inviteRoleOptions })] })] }) })] }));
84
+ return (_jsxs(Card, { "data-testid": "members-manager", children: [_jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: 16 }, children: [_jsxs("div", { children: [_jsx(Typography.Title, { level: 4, style: { marginTop: 0 }, children: t(WORKSPACES_I18N_KEYS.membersTitle) }), _jsx(Typography.Text, { type: "secondary", children: t(WORKSPACES_I18N_KEYS.membersSubtitle) })] }), canManage && (_jsx(Button, { type: "primary", onClick: openInvite, "data-analytics": "none", "data-analytics-reason": "local-ui-open-invite-dialog", children: t(WORKSPACES_I18N_KEYS.membersInvite) }))] }), isError && _jsx(ErrorAlert, { error: errorDisplay(error), style: { marginTop: 12 } }), _jsx(Table, { style: { marginTop: 16 }, size: "small", loading: isLoading, rowKey: (member) => member.id, dataSource: members, columns: columns, pagination: false }), _jsx(Modal, { title: t(WORKSPACES_I18N_KEYS.membersInviteDialogTitle), open: inviteOpen, onCancel: () => setInviteOpen(false), onOk: submitInvite, okButtonProps: { loading: isInviting, disabled: emailsText.trim().length === 0 }, children: _jsxs("div", { style: { display: "grid", gap: 12 }, children: [_jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.membersInviteEmailsLabel) }), _jsx(Input, { value: emailsText, onChange: (e) => setEmailsText(e.target.value), placeholder: t(WORKSPACES_I18N_KEYS.membersInviteEmailsPlaceholder) })] }), _jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.membersInviteRoleLabel) }), _jsx(Select, { value: inviteRole, onChange: setInviteRole, style: { width: "100%" }, loading: rolesBag.isLoading, options: inviteRoleOptions })] })] }) })] }));
80
85
  } })) }));
81
86
  }
82
87
  //# sourceMappingURL=MembersManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MembersManager.js","sourceRoot":"","sources":["../../src/default/MembersManager.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEhG,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAcvD,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAErC,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IACjB,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC;IAC1C,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,Q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,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC9C,WAAW,EAAE,CAAC,CAAC,oBAAoB,CAAC,8BAA8B,CAAC,GACnE,IACE,EACN,0BACE,KAAC,UAAU,CAAC,IAAI,cAAE,CAAC,CAAC,oBAAoB,CAAC,sBAAsB,CAAC,GAAmB,EACnF,KAAC,MAAM,IACL,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EACxB,OAAO,EAAE,QAAQ,CAAC,SAAS,EAC3B,OAAO,EAAE,iBAAiB,GAC1B,IACE,IACF,GACA,IACH,CACR,CAAC;YACJ,CAAC,GACO,CACX,GACU,CACd,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceSettings.d.ts","sourceRoot":"","sources":["../../src/default/WorkspaceSettings.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB;gEAC4D;IAC5D,SAAS,CAAC,IAAI,IAAI,CAAC;CACpB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,YAAY,CAwG7E"}
1
+ {"version":3,"file":"WorkspaceSettings.d.ts","sourceRoot":"","sources":["../../src/default/WorkspaceSettings.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAQ1C,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB;gEAC4D;IAC5D,SAAS,CAAC,IAAI,IAAI,CAAC;CACpB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,YAAY,CAwG7E"}
@@ -8,13 +8,18 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
8
  * `<MembersManager/>` (a workspace's settings page composes both).
9
9
  */
10
10
  import { useEffect, useState } from "react";
11
- import { Alert, Badge, Button, Card, Input, Popconfirm, Spin, Typography } from "antd";
12
- import { useT } from "@stapel/core";
11
+ import { Badge, Button, Card, Input, Popconfirm, Spin, Typography } from "antd";
12
+ import { useErrorDisplay, useT } from "@stapel/core";
13
13
  import { useWorkspace } from "../model/queries.js";
14
14
  import { useUpdateWorkspace, useDeleteWorkspace } from "../model/mutations.js";
15
15
  import { WORKSPACES_I18N_KEYS } from "../i18n/keys.js";
16
+ import { ErrorAlert } from "./ErrorAlert.js";
16
17
  export function WorkspaceSettings(props) {
17
18
  const t = useT();
19
+ // Never the raw `.message` — for a response with no error envelope that
20
+ // is the transport's own "Request failed with status 500" (owner report
21
+ // 2026-08-09). `useErrorText` folds any thrown value into the one dialect.
22
+ const errorDisplay = useErrorDisplay(WORKSPACES_I18N_KEYS.unknownError);
18
23
  const query = useWorkspace(props.workspaceId);
19
24
  const updateMutation = useUpdateWorkspace(props.workspaceId);
20
25
  const deleteMutation = useDeleteWorkspace();
@@ -36,9 +41,12 @@ export function WorkspaceSettings(props) {
36
41
  return _jsx(Spin, { "data-testid": "workspace-settings-loading" });
37
42
  }
38
43
  if (!workspace) {
39
- return (_jsx(Alert, { "data-testid": "workspace-settings-error", type: "error", showIcon: true, message: query.error?.message ?? t(WORKSPACES_I18N_KEYS.unknownError) }));
44
+ return (_jsx(ErrorAlert, { testId: "workspace-settings-error", error: errorDisplay(query.error) ?? {
45
+ message: t(WORKSPACES_I18N_KEYS.unknownError),
46
+ detail: undefined,
47
+ } }));
40
48
  }
41
49
  const isOwner = workspace.my_role === "owner";
42
- return (_jsxs("div", { "data-testid": "workspace-settings", style: { display: "grid", gap: 16 }, children: [_jsxs(Card, { children: [_jsx(Typography.Title, { level: 4, style: { marginTop: 0 }, children: t(WORKSPACES_I18N_KEYS.settingsTitle) }), _jsx(Typography.Text, { type: "secondary", children: t(WORKSPACES_I18N_KEYS.settingsSubtitle) }), _jsxs("div", { style: { display: "grid", gap: 12, maxWidth: 480, marginTop: 16 }, children: [_jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.fieldName) }), _jsx(Input, { value: name, onChange: (e) => setName(e.target.value), disabled: !isOwner })] }), _jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.fieldSlug) }), _jsx("div", { children: _jsx(Typography.Text, { code: true, children: workspace.slug }) })] }), _jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.fieldType) }), _jsx("div", { children: _jsx(Badge, { status: "default", text: workspace.type }) })] })] }), updateMutation.error && (_jsx(Alert, { style: { marginTop: 12 }, type: "error", showIcon: true, message: updateMutation.error.message })), _jsx(Button, { type: "primary", style: { marginTop: 16 }, loading: updateMutation.isPending, disabled: !isOwner || !name.trim(), onClick: handleSave, "data-analytics": "none", "data-analytics-reason": "business action \u2014 host app wraps with its own tracked(); pairs carry no @stapel/analytics runtime dependency by architecture", children: updateMutation.isPending ? t(WORKSPACES_I18N_KEYS.saving) : t(WORKSPACES_I18N_KEYS.save) })] }), isOwner && (_jsxs(Card, { children: [_jsx(Typography.Title, { level: 5, type: "danger", style: { marginTop: 0 }, children: t(WORKSPACES_I18N_KEYS.dangerZoneTitle) }), _jsx(Popconfirm, { title: t(WORKSPACES_I18N_KEYS.deleteWorkspaceConfirm), onConfirm: handleDelete, okButtonProps: { loading: deleteMutation.isPending, danger: true }, children: _jsx(Button, { danger: true, children: t(WORKSPACES_I18N_KEYS.deleteWorkspace) }) })] }))] }));
50
+ return (_jsxs("div", { "data-testid": "workspace-settings", style: { display: "grid", gap: 16 }, children: [_jsxs(Card, { children: [_jsx(Typography.Title, { level: 4, style: { marginTop: 0 }, children: t(WORKSPACES_I18N_KEYS.settingsTitle) }), _jsx(Typography.Text, { type: "secondary", children: t(WORKSPACES_I18N_KEYS.settingsSubtitle) }), _jsxs("div", { style: { display: "grid", gap: 12, maxWidth: 480, marginTop: 16 }, children: [_jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.fieldName) }), _jsx(Input, { value: name, onChange: (e) => setName(e.target.value), disabled: !isOwner })] }), _jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.fieldSlug) }), _jsx("div", { children: _jsx(Typography.Text, { code: true, children: workspace.slug }) })] }), _jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.fieldType) }), _jsx("div", { children: _jsx(Badge, { status: "default", text: workspace.type }) })] })] }), _jsx(ErrorAlert, { error: errorDisplay(updateMutation.error), style: { marginTop: 12 } }), _jsx(Button, { type: "primary", style: { marginTop: 16 }, loading: updateMutation.isPending, disabled: !isOwner || !name.trim(), onClick: handleSave, "data-analytics": "none", "data-analytics-reason": "business action \u2014 host app wraps with its own tracked(); pairs carry no @stapel/analytics runtime dependency by architecture", children: updateMutation.isPending ? t(WORKSPACES_I18N_KEYS.saving) : t(WORKSPACES_I18N_KEYS.save) })] }), isOwner && (_jsxs(Card, { children: [_jsx(Typography.Title, { level: 5, type: "danger", style: { marginTop: 0 }, children: t(WORKSPACES_I18N_KEYS.dangerZoneTitle) }), _jsx(Popconfirm, { title: t(WORKSPACES_I18N_KEYS.deleteWorkspaceConfirm), onConfirm: handleDelete, okButtonProps: { loading: deleteMutation.isPending, danger: true }, children: _jsx(Button, { danger: true, children: t(WORKSPACES_I18N_KEYS.deleteWorkspace) }) })] }))] }));
43
51
  }
44
52
  //# sourceMappingURL=WorkspaceSettings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceSettings.js","sourceRoot":"","sources":["../../src/default/WorkspaceSettings.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAA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,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAClF,IACJ,EAEN,OAAO,IAAI,CACV,MAAC,IAAI,eACH,KAAC,UAAU,CAAC,KAAK,IAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,YAC9D,CAAC,CAAC,oBAAoB,CAAC,eAAe,CAAC,GACvB,EACnB,KAAC,UAAU,IACT,KAAK,EAAE,CAAC,CAAC,oBAAoB,CAAC,sBAAsB,CAAC,EACrD,SAAS,EAAE,YAAY,EACvB,aAAa,EAAE,EAAE,OAAO,EAAE,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,YAElE,KAAC,MAAM,IAAC,MAAM,kBAAE,CAAC,CAAC,oBAAoB,CAAC,eAAe,CAAC,GAAU,GACtD,IACR,CACR,IACG,CACP,CAAC;AACJ,CAAC"}
package/llms.txt CHANGED
@@ -1,4 +1,4 @@
1
- # @stapel/workspaces-react 0.11.1
1
+ # @stapel/workspaces-react 0.12.0
2
2
 
3
3
  Headless React flow pair for stapel-workspaces (contract >=0.20 <0.21) — business + state, zero visual opinion.
4
4
  Built on @stapel/core: typed client + StapelApiError envelope, auth token refresh,
package/manifest.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$generated": "by scripts/gen-manifest.mjs — do not edit; drift-gated (pnpm gen:manifest:check)",
3
3
  "package": "@stapel/workspaces-react",
4
- "version": "0.11.1",
4
+ "version": "0.12.0",
5
5
  "backend": {
6
6
  "module": "stapel-workspaces",
7
7
  "contract": ">=0.20 <0.21"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stapel/workspaces-react",
3
- "version": "0.11.1",
3
+ "version": "0.12.0",
4
4
  "description": "Headless React flow pair for stapel-workspaces: typed API client, TanStack Query hooks, flow machines, headless components, and i18n keys. Zero visual opinion.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -58,7 +58,7 @@
58
58
  }
59
59
  ],
60
60
  "peerDependencies": {
61
- "@stapel/core": ">=0.3.0 <1.0.0",
61
+ "@stapel/core": ">=0.12.0 <1.0.0",
62
62
  "@tanstack/react-query": "^5.0.0",
63
63
  "antd": ">=5.20.0 <7",
64
64
  "react": ">=19"
@@ -82,9 +82,9 @@
82
82
  "size-limit": "^11.2.0",
83
83
  "typescript": "^5.8.3",
84
84
  "vitest": "^3.2.4",
85
- "@stapel/core": "^0.10.0",
86
- "@stapel/tokens": "^0.5.0",
87
- "@stapel/showcase": "^0.2.0"
85
+ "@stapel/core": "^0.12.0",
86
+ "@stapel/showcase": "^0.2.0",
87
+ "@stapel/tokens": "^0.5.0"
88
88
  },
89
89
  "engines": {
90
90
  "node": ">=22"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$generated": "by scripts/gen-events.mjs — do not edit; drift-gated (pnpm gen:events:check)",
3
3
  "package": "@stapel/workspaces-react",
4
- "version": "0.11.1",
4
+ "version": "0.12.0",
5
5
  "defined": [],
6
6
  "flows": []
7
7
  }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The one error surface this pair's default skins render, so the split copy
3
+ * core produces reaches a screen the same way everywhere.
4
+ *
5
+ * Core's `describeFlowError` splits a failure into the sentence a person
6
+ * reads and the technical detail a support agent quotes (owner report
7
+ * 2026-08-09: the status used to be spliced into the sentence, which ended
8
+ * in a bare `" (500)"` — and a product does not read a protocol number out to
9
+ * a person). The split is only worth anything if a
10
+ * skin actually renders both halves at their own weights: `message` at
11
+ * normal weight, `detail` muted and small, where an eye skips it and a
12
+ * support agent finds it.
13
+ *
14
+ * `undefined` in — including a `detail` that core left `undefined` because
15
+ * there was nothing worth quoting — renders nothing rather than an empty
16
+ * muted line.
17
+ */
18
+ import { Alert, Typography } from "antd";
19
+ import type { CSSProperties, ReactElement } from "react";
20
+ import type { FlowErrorDisplay } from "@stapel/core";
21
+
22
+ export function ErrorAlert(props: {
23
+ error: FlowErrorDisplay | undefined;
24
+ style?: CSSProperties | undefined;
25
+ testId?: string | undefined;
26
+ }): ReactElement | null {
27
+ const { error } = props;
28
+ if (!error) return null;
29
+ return (
30
+ <Alert
31
+ type="error"
32
+ showIcon
33
+ {...(props.style ? { style: props.style } : {})}
34
+ {...(props.testId ? { "data-testid": props.testId } : {})}
35
+ message={error.message}
36
+ {...(error.detail
37
+ ? {
38
+ description: (
39
+ <Typography.Text type="secondary" style={{ fontSize: 12 }}>
40
+ {error.detail}
41
+ </Typography.Text>
42
+ ),
43
+ }
44
+ : {})}
45
+ />
46
+ );
47
+ }
@@ -15,14 +15,15 @@
15
15
  */
16
16
  import { useState } from "react";
17
17
  import type { ReactElement } from "react";
18
- import { Alert, Button, Card, Input, Modal, Popconfirm, Select, Table, Typography } from "antd";
18
+ import { Button, Card, Input, Modal, Popconfirm, Select, Table, Typography } from "antd";
19
19
  import type { TableProps } from "antd";
20
- import { useT } from "@stapel/core";
20
+ import { useErrorDisplay, useT } from "@stapel/core";
21
21
  import { Members } from "../headless/Members.js";
22
22
  import { RoleSelect } from "../headless/RoleSelect.js";
23
23
  import type { RoleSelectBag } from "../headless/RoleSelect.js";
24
24
  import type { Member } from "../api/types.js";
25
25
  import { WORKSPACES_I18N_KEYS } from "../i18n/keys.js";
26
+ import { ErrorAlert } from "./ErrorAlert.js";
26
27
 
27
28
  export interface MembersManagerProps {
28
29
  workspaceId: string;
@@ -40,6 +41,10 @@ const DEFAULT_INVITE_ROLE = "member";
40
41
 
41
42
  export function MembersManager(props: MembersManagerProps): ReactElement {
42
43
  const t = useT();
44
+ // Never the raw `.message` — for a response with no error envelope that
45
+ // is the transport's own "Request failed with status 500" (owner report
46
+ // 2026-08-09). `useErrorText` folds any thrown value into the one dialect.
47
+ const errorDisplay = useErrorDisplay(WORKSPACES_I18N_KEYS.unknownError);
43
48
  const canManage = props.canManage ?? true;
44
49
  const [inviteOpen, setInviteOpen] = useState(false);
45
50
  const [emailsText, setEmailsText] = useState("");
@@ -143,9 +148,7 @@ export function MembersManager(props: MembersManagerProps): ReactElement {
143
148
  )}
144
149
  </div>
145
150
 
146
- {isError && error && (
147
- <Alert style={{ marginTop: 12 }} type="error" showIcon message={error.message} />
148
- )}
151
+ {isError && <ErrorAlert error={errorDisplay(error)} style={{ marginTop: 12 }} />}
149
152
 
150
153
  <Table<Member>
151
154
  style={{ marginTop: 16 }}
@@ -8,11 +8,12 @@
8
8
  */
9
9
  import { useEffect, useState } from "react";
10
10
  import type { ReactElement } from "react";
11
- import { Alert, Badge, Button, Card, Input, Popconfirm, Spin, Typography } from "antd";
12
- import { useT } from "@stapel/core";
11
+ import { Badge, Button, Card, Input, Popconfirm, Spin, Typography } from "antd";
12
+ import { useErrorDisplay, useT } from "@stapel/core";
13
13
  import { useWorkspace } from "../model/queries.js";
14
14
  import { useUpdateWorkspace, useDeleteWorkspace } from "../model/mutations.js";
15
15
  import { WORKSPACES_I18N_KEYS } from "../i18n/keys.js";
16
+ import { ErrorAlert } from "./ErrorAlert.js";
16
17
 
17
18
  export interface WorkspaceSettingsProps {
18
19
  workspaceId: string;
@@ -23,6 +24,10 @@ export interface WorkspaceSettingsProps {
23
24
 
24
25
  export function WorkspaceSettings(props: WorkspaceSettingsProps): ReactElement {
25
26
  const t = useT();
27
+ // Never the raw `.message` — for a response with no error envelope that
28
+ // is the transport's own "Request failed with status 500" (owner report
29
+ // 2026-08-09). `useErrorText` folds any thrown value into the one dialect.
30
+ const errorDisplay = useErrorDisplay(WORKSPACES_I18N_KEYS.unknownError);
26
31
  const query = useWorkspace(props.workspaceId);
27
32
  const updateMutation = useUpdateWorkspace(props.workspaceId);
28
33
  const deleteMutation = useDeleteWorkspace();
@@ -49,11 +54,14 @@ export function WorkspaceSettings(props: WorkspaceSettingsProps): ReactElement {
49
54
  }
50
55
  if (!workspace) {
51
56
  return (
52
- <Alert
53
- data-testid="workspace-settings-error"
54
- type="error"
55
- showIcon
56
- message={query.error?.message ?? t(WORKSPACES_I18N_KEYS.unknownError)}
57
+ <ErrorAlert
58
+ testId="workspace-settings-error"
59
+ error={
60
+ errorDisplay(query.error) ?? {
61
+ message: t(WORKSPACES_I18N_KEYS.unknownError),
62
+ detail: undefined,
63
+ }
64
+ }
57
65
  />
58
66
  );
59
67
  }
@@ -87,14 +95,7 @@ export function WorkspaceSettings(props: WorkspaceSettingsProps): ReactElement {
87
95
  </div>
88
96
  </div>
89
97
 
90
- {updateMutation.error && (
91
- <Alert
92
- style={{ marginTop: 12 }}
93
- type="error"
94
- showIcon
95
- message={updateMutation.error.message}
96
- />
97
- )}
98
+ <ErrorAlert error={errorDisplay(updateMutation.error)} style={{ marginTop: 12 }} />
98
99
 
99
100
  <Button
100
101
  type="primary"