fix(onetalk): narrow action status tooltip width

This commit is contained in:
YBF
2026-09-15 12:02:34 +08:00
parent 22e0212e05
commit c168d83d97
2 changed files with 6 additions and 1 deletions
@@ -53,6 +53,7 @@ const statusRowStyles = (color: TooltipColor): string => {
"border-radius: 6px",
"background: " + theme.background,
"color: " + theme.text,
"white-space: normal",
"font-size: 13px",
"line-height: 20px",
"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
@@ -95,7 +96,7 @@ const createStatusContainer = (document: Document): HTMLDivElement => {
"display: flex",
"flex-direction: column",
"gap: 8px",
"width: min(600px, calc(100vw - 96px))",
"width: min(400px, calc(100vw - 96px))",
"pointer-events: none",
].join(";");
return container;
@@ -89,12 +89,16 @@ test("starts one neutral status row and does not duplicate its id", () => {
assert.equal(container.getAttribute("aria-live"), "polite");
assert.match(container.style.cssText, /position: fixed/u);
assert.match(container.style.cssText, /top: 0/u);
assert.match(container.style.cssText, /transform: translateX\(-50%\)/u);
assert.doesNotMatch(container.style.cssText, /scale\(/u);
assert.match(container.style.cssText, /width: min\(400px, calc\(100vw - 96px\)\)/u);
assert.match(container.style.cssText, /pointer-events: none/u);
assert.equal(container.children.length, 1);
assert.equal(container.children[0].textContent, "正在收集所有对话历史");
assert.equal(container.children[0].dataset.tmcActionStatusId, "collect-history");
assert.equal(container.children[0].getAttribute("data-tmc-action-status-color"), "neutral");
assert.match(container.children[0].style.cssText, /background: #f5f5f5/u);
assert.match(container.children[0].style.cssText, /white-space: normal/u);
});
test("updates only its existing id and preserves insertion order", () => {