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: 1 addition & 0 deletions internal/ui/dist/assets/chat._threadId-BMpfip3e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import{t as e}from"./chat-DGiykfTK.js";var t=e;export{t as component};
1 change: 0 additions & 1 deletion internal/ui/dist/assets/chat._threadId-Baur0K0b.js

This file was deleted.

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

This file was deleted.

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.

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

2 changes: 1 addition & 1 deletion 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-B-OPc9cN.js"></script>
<script type="module" crossorigin src="/assets/index-BD1wwwYv.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 Down
24 changes: 21 additions & 3 deletions ui/host/src/dashboards/annotation-markers.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe("annotation scope and windows", () => {
const band = got.series[0].markArea.data[0];
expect(band[0].xAxis).toBe(0); expect(band[1].xAxis).toBe(10000);
expect(band[0].itemStyle).toEqual({ color: theme.status.warn, opacity: .09 });
expect(band[0].tooltip.formatter()).toBe(`checkout · Slow · bad · latency · ${at(-1000)} – ${at(11000)}`);
expect(band[0].tooltip.formatter()).toBe(`shop/checkout · Slow · bad · latency · ${at(-1000)} – ${at(11000)}`);
expect(got.tooltip.renderMode).toBe("html");
expect(got.series[0].markLine.silent).toBe(false); expect(got.series[0].markArea.silent).toBe(false);
});
Expand Down Expand Up @@ -125,7 +125,7 @@ it.each([false, true])("merges three overlapping kinds into one band with every
}
expect(mixedKinds.anomalies.map(episode => episode.from)).toEqual([at(4000), at(2000), at(1000)]);
});
it("merges adjacent kinds but preserves gaps, services, namespaces and clipped bounds", () => {
it("unions adjacent kinds and services without stacking fills, preserving gaps and source identities", () => {
const base = mixedKinds.anomalies[0];
const anomalies = [...mixedKinds.anomalies,
{ ...base, kind: "adjacent", from: at(9000), to: at(11000) },
Expand All @@ -134,8 +134,26 @@ it("merges adjacent kinds but preserves gaps, services, namespaces and clipped b
];
const data = { ...result, from_ms: 3000, to_ms: 15000, annotation_scope: undefined };
const areas = markers(data, "timeseries", { deploys: [], anomalies }).series[0].markArea.data;
expect(areas.map(area => area.map(bound => bound.xAxis)).sort((a, b) => a[0] - b[0])).toEqual([[3000, 11000], [4000, 9000], [4000, 9000], [12000, 14000]]);
expect(areas.map(area => area.map(bound => bound.xAxis))).toEqual([[3000, 11000], [12000, 14000]]);
const merged = areas.find(area => area[0].xAxis === 3000)!;
expect(merged[0].tooltip.formatter()).toContain("adjacent");
expect(merged[0].tooltip.formatter()).toContain(at(1000));
for (const identity of ["shop/cart", "ops/cart", "shop/checkout"]) expect(merged[0].tooltip.formatter()).toContain(identity);
});

it.each([false, true])("renders repeated 15-minute checks as one faint band with honest source bounds (%s)", dark => {
const start = Date.parse("2026-10-16T08:00:00Z");
const anomalies = Array.from({ length: 60 }, (_, i) => ({
...history.anomalies[0], from: at(start + i * 60000), to: at(start + (i + 15) * 60000),
})).reverse();
const data = { ...result, from_ms: start + 5 * 60000, to_ms: start + 60 * 60000 };
const got = withAnnotations({ series: [{ type: "line" }] }, panel, data, { deploys: [], anomalies }, {}, chartThemeFor(dark));
const areas = (got.series as { markArea: { data: Area[] } }[])[0].markArea.data;
expect(areas).toHaveLength(1);
expect(areas[0].map(bound => bound.xAxis)).toEqual([data.from_ms, data.to_ms]);
expect(areas[0][0].itemStyle.opacity).toBe(dark ? .12 : .09);
for (const source of anomalies) {
expect(areas[0][0].tooltip.formatter()).toContain(`${source.from} – ${source.to}`);
}
expect(anomalies[0].from).toBe(at(start + 59 * 60000));
});
35 changes: 34 additions & 1 deletion ui/host/src/dashboards/chart-measurements.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { init, use, setPlatformAPI } from "echarts/core";
import { BarChart, CustomChart, ScatterChart, LineChart } from "echarts/charts";
import { GraphicComponent, GridComponent, LegendComponent, MarkAreaComponent, MarkLineComponent, TooltipComponent, VisualMapComponent } from "echarts/components";
import { SVGRenderer } from "echarts/renderers";
import { LabelLayout } from "echarts/features";
import { expect,it } from "vitest";
import { analysisOption } from "../../../panels/analysis";
import { gaugeOption,barOption,chartThemeFor,timeseriesOption } from "../../../panels/compile";
Expand All @@ -10,7 +11,39 @@ import { nativeAudit } from "./chart-measurements";
// SVG in happy-dom has no canvas/font engine. Give the native renderer a
// deterministic monospace metric rather than zrender's one-em-per-character fallback.
setPlatformAPI({measureText: (text, font) => ({width: Array.from(text ?? "").length * Number(font?.match(/([\d.]+)px/)?.[1] ?? 12) * .62})});
use([BarChart,CustomChart,ScatterChart,LineChart,GraphicComponent,GridComponent,LegendComponent,MarkAreaComponent,MarkLineComponent,TooltipComponent,VisualMapComponent,SVGRenderer]);
use([LabelLayout,BarChart,CustomChart,ScatterChart,LineChart,GraphicComponent,GridComponent,LegendComponent,MarkAreaComponent,MarkLineComponent,TooltipComponent,VisualMapComponent,SVGRenderer]);
it.each([false, true])("keeps rendered threshold labels inside the plot, clear of axis ticks (%s)", dark => {
const el = document.createElement("div"); document.body.append(el);
const chart = init(el, undefined, { renderer: "svg", width: 500, height: 248 });
try {
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 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,
} };
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);
}
}
} finally { chart.dispose(); el.remove(); }
});
it.each([false,true])("native gauge text never overlaps in meter layouts at 1100/1440 layouts (%s)",dark=>{
for(const size of [{width:159,height:56},{width:238,height:56},{width:159,height:180},{width:220,height:140},{width:238,height:180},{width:320,height:180}]) {
const el=document.createElement("div");document.body.append(el);const chart=init(el,undefined,{renderer:"svg",...size});
Expand Down
Loading
Loading