Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/mcp/apps/panels.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion internal/ui/dist/assets/chat._threadId-BMpfip3e.js

This file was deleted.

1 change: 1 addition & 0 deletions internal/ui/dist/assets/chat._threadId-BsJLgkqj.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import{t as e}from"./chat-D8Nl9xGT.js";var t=e;export{t as component};
1 change: 0 additions & 1 deletion internal/ui/dist/assets/chat.index-BMpfip3e.js

This file was deleted.

1 change: 1 addition & 0 deletions internal/ui/dist/assets/chat.index-BsJLgkqj.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import{t as e}from"./chat-D8Nl9xGT.js";var t=e;export{t as component};

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/ui/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
document.documentElement.setAttribute("data-mantine-color-scheme", computed);
} catch (e) {}
</script>
<script type="module" crossorigin src="/assets/index-BD1wwwYv.js"></script>
<script type="module" crossorigin src="/assets/index-ZyJwWZ_-.js"></script>
<link rel="modulepreload" crossorigin href="/assets/useRouter-ByJ6_rwb.js">
<link rel="modulepreload" crossorigin href="/assets/brand-Bcp2Tp5I.js">
<link rel="modulepreload" crossorigin href="/assets/useNavigate-B1zgPEUp.js">
Expand All @@ -31,7 +31,7 @@
<link rel="modulepreload" crossorigin href="/assets/auth-C8kS8ur3.js">
<link rel="modulepreload" crossorigin href="/assets/useQuery-CEXOTfck.js">
<link rel="modulepreload" crossorigin href="/assets/theme-DdznftKI.js">
<link rel="stylesheet" crossorigin href="/assets/index-B905rHdc.css">
<link rel="stylesheet" crossorigin href="/assets/index-ByVYR1iM.css">
</head>
<body>
<div id="root"></div>
Expand Down
52 changes: 40 additions & 12 deletions ui/host/src/dashboards/chart-measurements.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,55 @@ it.each([false, true])("keeps rendered threshold labels inside the plot, clear o
for (const width of [350, 500, 800]) for (const style of ["line", "bars"] as const) {
const size = { width, height: 248 }, theme = chartThemeFor(dark);
chart.resize(size);
const panel = { id: "t", title: "Latency", viz: "timeseries" as const, unit: "ms" as const, options: { style }, thresholds: [{ value: 2000, status: "bad" as const }] };
const panel = { id: "t", title: "Latency", viz: "timeseries" as const, unit: "ms" as const, options: { style }, thresholds: [{ value: 0, status: "ok" as const }, { value: 1000, status: "warn" as const }, { value: 2000, status: "bad" as const }] };
const result = { id: "t", status: "ok" as const, elapsed_ms: 1, from_ms: 0, to_ms: 3600000, frame: {
columns: [{ name: "time", type: "time" as const, role: "time" as const }, { name: "p95", type: "number" as const, role: "measure" as const, unit: "ms" }],
values: [[0, 3600000], [10, 20]], rows: 2,
values: [[0, 3600000], [1000, 2000]], rows: 2,
} };
const option = withAnnotations(timeseriesOption(panel, result, theme, size), panel, result, { deploys: [], anomalies: [
{ namespace: "shop", service: "cart", kind: "latency", title: "Slow", severity: "bad", from: new Date(0).toISOString(), to: new Date(3600000).toISOString() },
] }, {}, theme, size);
chart.setOption({ ...option, animation: false }, { notMerge: true });
const rect = (chart as any).getModel().getComponent("grid").coordinateSystem.getRect();
const audit = nativeAudit(chart, option, size, rect);
const labels = audit.texts.filter(text => text.text === "bad 2 s");
expect(labels).toHaveLength(1);
const label = labels[0];
expect((label.left + label.right) / 2).toBeCloseTo(rect.x + rect.width / 2, 0);
expect(label.left).toBeGreaterThanOrEqual(rect.x + 4);
expect(label.right).toBeLessThanOrEqual(rect.x + rect.width);
expect(label.top).toBeGreaterThanOrEqual(rect.y);
expect(label.bottom).toBeLessThanOrEqual(rect.y + rect.height);
for (const tick of audit.plot!.y_ticks) {
expect(label.left < tick.right && label.right > tick.left && label.top < tick.bottom && label.bottom > tick.top).toBe(false);
const labels = audit.texts.filter(text => ["ok 0 ms", "warn 1 s", "bad 2 s"].includes(text.text));
expect(labels).toHaveLength(3);
for (const label of labels) {
// Native bounds include half of the 3px text halo.
expect(label.right).toBeCloseTo(rect.x + rect.width - 8 + 1.5, 0);
expect(label.left).toBeGreaterThanOrEqual(rect.x + 4);
expect(label.right).toBeLessThanOrEqual(rect.x + rect.width);
expect(label.top).toBeGreaterThanOrEqual(rect.y);
expect(label.bottom).toBeLessThanOrEqual(rect.y + rect.height);
for (const tick of [...audit.plot!.y_ticks, ...audit.texts.filter(text => text.top >= rect.y + rect.height)]) {
expect(label.left < tick.right && label.right > tick.left && label.top < tick.bottom && label.bottom > tick.top).toBe(false);
}
}
}
} finally { chart.dispose(); el.remove(); }
});

it.each([false, true])("renders thresholds only in data-driven native axis ranges (%s)", dark => {
const el = document.createElement("div"); document.body.append(el);
const chart = init(el, undefined, { renderer: "svg", width: 500, height: 248 });
const theme = chartThemeFor(dark);
try {
for (const style of ["line", "area", "bars", "stacked"] as const) for (const scale of ["linear", "log"] as const) {
const panel = { id: "t", title: "Latency", viz: "timeseries" as const, unit: "ms" as const, options: { style, scale }, thresholds: [{ value: 2000, status: "bad" as const }] };
for (const values of [[10, 20], [1000, 2000]]) {
const result = { id: "t", status: "ok" as const, elapsed_ms: 1, from_ms: 0, to_ms: 3600000, frame: {
columns: [{ name: "time", type: "time" as const, role: "time" as const }, { name: "p95", type: "number" as const, role: "measure" as const, unit: "ms" }],
values: [[0, 3600000], values], rows: 2,
} };
const option = timeseriesOption(panel, result, theme);
chart.setOption({ ...timeseriesOption({ ...panel, thresholds: [] }, result, theme), animation: false }, { notMerge: true });
const extent = () => [...(chart as any).getModel().getComponent("yAxis").axis.scale.getExtent()];
const without = extent();
chart.setOption({ ...option, animation: false }, { notMerge: true });
expect(extent()).toEqual(without);
const audit = nativeAudit(chart, option, { width: 500, height: 248 });
expect(audit.texts.filter(text => text.text === "bad 2 s")).toHaveLength(values[1] < 2000 ? 0 : 1);
if (values[1] < 2000) expect(extent()[1]).toBeLessThan(2000);
}
}
} finally { chart.dispose(); el.remove(); }
Expand Down
18 changes: 17 additions & 1 deletion ui/host/src/dashboards/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,26 @@
}

.dashboard-table {
table-layout: fixed;
table-layout: auto;
width: 100%;
}

/* Whole values determine their intrinsic column width. Only text may shrink. */
.dashboard-table td {
white-space: nowrap;
}

/* Text shrinks into leftover space, but keeps enough to recognize a name;
past that the table scrolls. */
.dashboard-table td:has(> .dashboard-dimension-nowrap) {
max-width: 0;
min-width: 14ch;
}

.dashboard-table .mantine-Badge-root {
width: max-content;
}

.dashboard-dimension-nowrap {
white-space: nowrap;
overflow: hidden;
Expand Down
4 changes: 2 additions & 2 deletions ui/host/src/dashboards/grid.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ it("hides fix without manage permission while keeping Explain answer-only", asyn

it("copies a view link without edit mode and reports success", async () => {
const writeText = vi.fn().mockResolvedValue(undefined);
vi.stubGlobal("navigator", { clipboard: { writeText } });
vi.spyOn(navigator.clipboard, "writeText").mockImplementation(writeText);
window.history.replaceState({}, "", "/dashboards/d1?edit=1&range=6h");
const { host } = await render();
await menu(host, "Requests", "Copy link");
Expand All @@ -219,7 +219,7 @@ it("copies a view link without edit mode and reports success", async () => {
});

it("shows a copyable URL when clipboard permission is denied", async () => {
vi.stubGlobal("navigator", { clipboard: { writeText: vi.fn().mockRejectedValue(new Error("Denied")) } });
vi.spyOn(navigator.clipboard, "writeText").mockRejectedValue(new Error("Denied"));
window.history.replaceState({}, "", "/dashboards/d1?edit=1");
const { host } = await render();
await menu(host, "Requests", "Copy link");
Expand Down
Loading
Loading