feat(webui): distinguish context compaction reasons (NAN-324) (#6389)

* feat(webui): distinguish context compaction reasons (NAN-324)

* fix(webui): describe idle compaction cancellation as interruption

* docs: omit compaction notice details from configuration guide

* fix(i18n): make compaction notices read naturally

* fix(i18n): keep CJK compaction notices concise

* fix(i18n): describe idle compaction as unfinished
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-22 16:13:25 +08:00
1 parent 084b6bb394
commit bc5c58d239
38 files changed
+540 -23

No files matched your search

+9
View File
@@ -434,6 +434,15 @@ describe("webui i18n", () => {
expect(notice?.textContent).toBe(copy[phase]);
expect(notice).toHaveAttribute("aria-busy", String(phase === "started"));
}
for (const reason of ["idle", "context_pressure", "manual", "provider_native"] as const) {
for (const phase of ["started", "succeeded", "failed", "cancelled"] as const) {
rerender(<ContextCompactionNotice compaction={{ id: "compact-1", reason, phase, announce: true }} />);
const notice = container.querySelector("[data-context-compaction]");
expect(copy.reasons[reason][phase]).toBeTruthy();
expect(notice?.textContent).toBe(copy.reasons[reason][phase]);
expect(notice).toHaveAttribute("aria-busy", String(phase === "started"));
}
}
for (const compactReply of ["empty", "failed"] as const) {
rerender(<MessageBubble message={{
id: "reply", role: "assistant", content: "original command reply",