@tangle-network/ui 11.16.7 → 11.16.8
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,11 @@
|
|
|
1
1
|
# @tangle-network/ui
|
|
2
2
|
|
|
3
|
+
## 11.16.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c8ab512: A terminal command whose tool reported an error with nothing recorded about the command shows its "tool reported error" badge in the warning tone and sans type, so it reads as a status rather than metadata. Red stays reserved for a nonzero exit, a timeout or a signal.
|
|
8
|
+
|
|
3
9
|
## 11.16.7
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -103,7 +103,7 @@ function parseStructured(text) {
|
|
|
103
103
|
/** Exit status as a badge. Red only where the command itself is known to have
|
|
104
104
|
* failed: a nonzero exit, a timeout, or a signal. A tool that reported an
|
|
105
105
|
* error with nothing recorded about the command (no exit code, or exit 0
|
|
106
|
-
* from a runner that failed afterwards) gets
|
|
106
|
+
* from a runner that failed afterwards) gets an amber badge; its error text
|
|
107
107
|
* prints below. A clean run stays quiet green. */
|
|
108
108
|
function ExitBadge({ output, status }) {
|
|
109
109
|
if (status === "running" || status === "pending") return /* @__PURE__ */ jsxs("span", {
|
|
@@ -127,14 +127,14 @@ function ExitBadge({ output, status }) {
|
|
|
127
127
|
tone = "danger";
|
|
128
128
|
} else if (status === "error") {
|
|
129
129
|
label = exitCode === 0 ? "exit 0 · tool reported error" : "tool reported error";
|
|
130
|
-
tone = "
|
|
130
|
+
tone = "warning";
|
|
131
131
|
} else {
|
|
132
132
|
label = exitCode === 0 ? "exit 0" : null;
|
|
133
133
|
tone = "success";
|
|
134
134
|
}
|
|
135
135
|
if (label === null) return null;
|
|
136
136
|
return /* @__PURE__ */ jsx("span", {
|
|
137
|
-
className: cn("inline-flex shrink-0 items-center rounded-full border px-1.5 py-px text-[11px] font-medium tabular-nums", tone === "danger" && "border-transparent bg-[var(--surface-danger-bg)] text-[var(--surface-danger-text)]", tone === "success" && "border-transparent bg-[var(--surface-success-bg)] text-[var(--surface-success-text)]", tone === "
|
|
137
|
+
className: cn("inline-flex shrink-0 items-center rounded-full border px-1.5 py-px font-sans text-[11px] font-medium tabular-nums", tone === "danger" && "border-transparent bg-[var(--surface-danger-bg)] text-[var(--surface-danger-text)]", tone === "success" && "border-transparent bg-[var(--surface-success-bg)] text-[var(--surface-success-text)]", tone === "warning" && "border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)] text-[var(--surface-warning-text)]"),
|
|
138
138
|
children: label
|
|
139
139
|
});
|
|
140
140
|
}
|
package/package.json
CHANGED
|
@@ -13,10 +13,10 @@ function part(state: Partial<ToolPart["state"]>): ToolPart {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
describe("CommandPreview", () => {
|
|
16
|
-
it("shows
|
|
16
|
+
it("shows an amber badge, not a red exit, when a tool errored without an exit code", () => {
|
|
17
17
|
render(<CommandPreview part={part({ status: "error", output: "warning: x" })} />);
|
|
18
18
|
const badge = screen.getByText("tool reported error");
|
|
19
|
-
expect(badge.className).toContain("surface-
|
|
19
|
+
expect(badge.className).toContain("surface-warning");
|
|
20
20
|
expect(badge.className).not.toContain("surface-danger");
|
|
21
21
|
expect(screen.queryByText("error")).toBeNull();
|
|
22
22
|
});
|
|
@@ -52,13 +52,13 @@ describe("CommandPreview", () => {
|
|
|
52
52
|
expect(screen.getByText("timed out").className).toContain("surface-danger");
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
it("keeps a runner error after a clean exit
|
|
55
|
+
it("keeps a runner error after a clean exit amber, not red", () => {
|
|
56
56
|
render(
|
|
57
57
|
<CommandPreview
|
|
58
58
|
part={part({ status: "error", output: { stdout: "ok", stderr: "", exitCode: 0 } })}
|
|
59
59
|
/>,
|
|
60
60
|
);
|
|
61
|
-
expect(screen.getByText("exit 0 · tool reported error").className).toContain("surface-
|
|
61
|
+
expect(screen.getByText("exit 0 · tool reported error").className).toContain("surface-warning");
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
it("is a quiet row until opened, then a dark terminal", () => {
|
|
@@ -128,7 +128,7 @@ function parseStructured(text: string): CommandOutput | undefined {
|
|
|
128
128
|
/** Exit status as a badge. Red only where the command itself is known to have
|
|
129
129
|
* failed: a nonzero exit, a timeout, or a signal. A tool that reported an
|
|
130
130
|
* error with nothing recorded about the command (no exit code, or exit 0
|
|
131
|
-
* from a runner that failed afterwards) gets
|
|
131
|
+
* from a runner that failed afterwards) gets an amber badge; its error text
|
|
132
132
|
* prints below. A clean run stays quiet green. */
|
|
133
133
|
function ExitBadge({
|
|
134
134
|
output,
|
|
@@ -147,7 +147,7 @@ function ExitBadge({
|
|
|
147
147
|
}
|
|
148
148
|
const { exitCode, timedOut, signal } = output;
|
|
149
149
|
let label: string | null;
|
|
150
|
-
let tone: "danger" | "success" | "
|
|
150
|
+
let tone: "danger" | "success" | "warning";
|
|
151
151
|
if (timedOut) {
|
|
152
152
|
label = "timed out";
|
|
153
153
|
tone = "danger";
|
|
@@ -161,7 +161,7 @@ function ExitBadge({
|
|
|
161
161
|
// Say what is known: the tool reported an error. Nothing recorded says
|
|
162
162
|
// the command itself failed.
|
|
163
163
|
label = exitCode === 0 ? "exit 0 · tool reported error" : "tool reported error";
|
|
164
|
-
tone = "
|
|
164
|
+
tone = "warning";
|
|
165
165
|
} else {
|
|
166
166
|
label = exitCode === 0 ? "exit 0" : null;
|
|
167
167
|
tone = "success";
|
|
@@ -171,13 +171,15 @@ function ExitBadge({
|
|
|
171
171
|
<span
|
|
172
172
|
className={cn(
|
|
173
173
|
// Every badge has a border, so mixed rows keep one height.
|
|
174
|
-
"inline-flex shrink-0 items-center rounded-full border px-1.5 py-px text-[11px] font-medium tabular-nums",
|
|
174
|
+
"inline-flex shrink-0 items-center rounded-full border px-1.5 py-px font-sans text-[11px] font-medium tabular-nums",
|
|
175
175
|
tone === "danger" &&
|
|
176
176
|
"border-transparent bg-[var(--surface-danger-bg)] text-[var(--surface-danger-text)]",
|
|
177
177
|
tone === "success" &&
|
|
178
178
|
"border-transparent bg-[var(--surface-success-bg)] text-[var(--surface-success-text)]",
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
// A reported error with nothing recorded about the command deserves
|
|
180
|
+
// attention, but it is not a failed command: amber, not red.
|
|
181
|
+
tone === "warning" &&
|
|
182
|
+
"border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)] text-[var(--surface-warning-text)]",
|
|
181
183
|
)}
|
|
182
184
|
>
|
|
183
185
|
{label}
|