@ai-matrx/content-ir-react 0.20.0 → 0.20.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,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.20.1 — 2026-10-02
4
+
5
+ G9 leftovers (nightly clone). Guard: `__tests__/directive-card-g9.test.tsx` (3 red on 0.20.0).
6
+
7
+ - **A button never wraps its label.** At 375px "Apply" broke to "Appl / y" beside
8
+ "Nothing to change". Apply, Run again, Retry, Details and Show more are `whitespace-nowrap`
9
+ (`shrink-0`); the header group wraps and the reason text is what wraps.
10
+ - **A screen-reader label never names an id.** A record row's copy control read
11
+ "Task a8a00001". `DirectiveCopyProps.label` is now type-generic ("this task") and the new
12
+ `DirectiveCopyProps.record` ({ noun, id }) lets the host swap in the record's live name.
13
+
14
+ ### Consumer action
15
+
16
+ - In `renderCopy`, when `props.record` is set, label the control with the record's live name
17
+ (the same one `renderRecord` shows), keeping `props.label` while it loads.
18
+
3
19
  ## 0.20.0 — 2026-10-02
4
20
 
5
21
  The G8A review of the action cards (nightly clone). Guard:
@@ -121,7 +121,14 @@ interface DirectiveOpenItemOptions {
121
121
  total: number;
122
122
  }
123
123
  interface DirectiveCopyProps {
124
+ /**
125
+ * What the control is called to a screen reader. Never an id: for a record it
126
+ * is type-generic ("this task"); a host with the record's live name replaces
127
+ * it through `record`.
128
+ */
124
129
  label: string;
130
+ /** The existing record this control copies, when it copies one — to name it. */
131
+ record?: DirectiveRecordRef;
125
132
  /** The value to copy — the whole shell or one item. */
126
133
  value: unknown;
127
134
  /** The item's kind, when copying an item. */
@@ -121,7 +121,14 @@ interface DirectiveOpenItemOptions {
121
121
  total: number;
122
122
  }
123
123
  interface DirectiveCopyProps {
124
+ /**
125
+ * What the control is called to a screen reader. Never an id: for a record it
126
+ * is type-generic ("this task"); a host with the record's live name replaces
127
+ * it through `record`.
128
+ */
124
129
  label: string;
130
+ /** The existing record this control copies, when it copies one — to name it. */
131
+ record?: DirectiveRecordRef;
125
132
  /** The value to copy — the whole shell or one item. */
126
133
  value: unknown;
127
134
  /** The item's kind, when copying an item. */
@@ -633,7 +633,7 @@ function ApplyDirectiveButton({
633
633
  type: "button",
634
634
  disabled: askingAgain,
635
635
  onClick: () => void handleApply(!bad),
636
- className: "inline-flex items-center gap-1 rounded px-1 py-0.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground disabled:opacity-50",
636
+ className: "inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded px-1 py-0.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground disabled:opacity-50",
637
637
  "data-apply-action": bad ? "retry" : "run-again",
638
638
  children: [
639
639
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(RotateCcwIcon, { className: "h-3 w-3" }),
@@ -673,8 +673,8 @@ function ApplyDirectiveButton({
673
673
  }
674
674
  const destructive = directive.directiveClass === "delete";
675
675
  const muted = nothingToChange && view.status === "idle";
676
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "inline-flex items-center gap-2", children: [
677
- muted ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-xs text-muted-foreground", "data-apply-nothing": "", children: "Nothing to change" }) : null,
676
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "flex min-w-0 flex-wrap items-center justify-end gap-x-2 gap-y-1", children: [
677
+ muted ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "min-w-0 text-xs text-muted-foreground", "data-apply-nothing": "", children: "Nothing to change" }) : null,
678
678
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
679
679
  "button",
680
680
  {
@@ -683,7 +683,7 @@ function ApplyDirectiveButton({
683
683
  disabled: view.status === "applying" || view.status === "asking" || items.length === 0,
684
684
  "data-apply-tone": muted ? "muted" : destructive ? "destructive" : "default",
685
685
  title: muted ? "It sets no fields, so applying it changes nothing." : void 0,
686
- className: `inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs font-medium disabled:opacity-50 ${muted ? "border-border/60 bg-background text-muted-foreground hover:bg-accent" : destructive ? "border-destructive/50 bg-background text-destructive hover:bg-destructive/10" : "border-border bg-background hover:bg-accent"}`,
686
+ className: `inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-md border px-2 py-1 text-xs font-medium disabled:opacity-50 ${muted ? "border-border/60 bg-background text-muted-foreground hover:bg-accent" : destructive ? "border-destructive/50 bg-background text-destructive hover:bg-destructive/10" : "border-border bg-background hover:bg-accent"}`,
687
687
  children: [
688
688
  view.status === "applying" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(LoaderIcon, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PlayIcon, { className: "h-3.5 w-3.5" }),
689
689
  view.status === "applying" ? `Applying${itemCount ? ` ${itemCount} ${itemCount === 1 ? "item" : "items"}` : ""}\u2026${elapsed ? ` ${elapsed}s` : ""}` : label
@@ -734,7 +734,7 @@ function FailureNotice({
734
734
  type: "button",
735
735
  onClick: () => setOpen((v) => !v),
736
736
  "aria-expanded": open,
737
- className: "ml-1 underline underline-offset-2 hover:no-underline",
737
+ className: "ml-1 whitespace-nowrap underline underline-offset-2 hover:no-underline",
738
738
  "data-apply-failure-details-toggle": true,
739
739
  children: open ? "Hide details" : "Details"
740
740
  }
@@ -888,7 +888,12 @@ function TargetRow({
888
888
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "py-1 text-xs", "data-directive-target": recordId, children: [
889
889
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
890
890
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "flex min-w-0 flex-1 items-center gap-1 px-1", children: name }),
891
- host.renderCopy?.({ label: fallback, value: item, size: "xs" })
891
+ host.renderCopy?.({
892
+ label: `this ${(0, import_content_ir3.nounLabel)(directive.noun, host.nouns).toLowerCase()}`,
893
+ value: item,
894
+ size: "xs",
895
+ record: { noun: directive.noun, id: recordId }
896
+ })
892
897
  ] }),
893
898
  isUpdate ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DirectiveChangeList, { changes, className: "mt-0.5 px-1" }) : null
894
899
  ] });
@@ -916,7 +921,7 @@ function SideEffectDirectiveCard({ directive }) {
916
921
  " ",
917
922
  total === 1 ? "item" : "items"
918
923
  ] }),
919
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "ml-auto flex items-center gap-1", children: [
924
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "ml-auto flex min-w-0 flex-wrap items-center justify-end gap-1", children: [
920
925
  host.renderCopy?.({ label: display.title, value: directive.shell, size: "icon" }),
921
926
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
922
927
  ApplyDirectiveButton,
@@ -938,7 +943,7 @@ function SideEffectDirectiveCard({ directive }) {
938
943
  {
939
944
  type: "button",
940
945
  onClick: () => setExpanded((v) => !v),
941
- className: "mt-0.5 inline-flex items-center gap-1 rounded px-1 py-0.5 text-[11px] text-muted-foreground hover:text-foreground",
946
+ className: "mt-0.5 inline-flex items-center gap-1 whitespace-nowrap rounded px-1 py-0.5 text-[11px] text-muted-foreground hover:text-foreground",
942
947
  children: [
943
948
  expanded ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ChevronDownIcon, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ChevronRightIcon, { className: "h-3 w-3" }),
944
949
  expanded ? "Show less" : `Show ${hidden} more`