fix(studio): the notice and config sub-lines get their own class names, which the monospace guard reads as prose

This commit is contained in:
yhh committed 2026-11-06 01:59:36 -08:00
1 parent 0e04e0d753
commit 7c26f0d5ec
5 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -22,7 +22,7 @@
.toast { align-items: flex-start; width: 380px; max-width: 100%; padding: 10px 10px 10px 12px; background: var(--float); box-shadow: var(--shadow-float); font: var(--w-reg) var(--fs-ui)/1.55 var(--ui); }
.toast-icon { margin-top: 1px; }
.toast-body > b { font-weight: var(--w-semi); }
.toast-body > .sub { color: var(--muted); font-size: var(--fs-meta); }
.toast-body > .toast-sub { color: var(--muted); font-size: var(--fs-meta); }
.toast-actions { gap: 2px; margin: -4px 0; }
.toast-actions .act { height: 32px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--raised); color: var(--text); font: var(--w-reg) var(--fs-ui)/1 var(--ui); }
.toast-actions .act:hover:not(:disabled) { background: var(--overlay); }
@@ -10,7 +10,7 @@
.cfgbad .cfg-card[data-lvl="warn"] .cfg-hd > .studio-icon { color: var(--warn-ink); }
.cfgbad .cfg-hd > div { flex: 1; min-width: 0; }
.cfgbad .cfg-hd b { font: var(--w-semi) var(--fs-lead)/1.4 var(--ui); }
.cfgbad .cfg-hd .sub { margin-top: 2px; color: var(--muted); font-size: var(--fs-meta); }
.cfgbad .cfg-hd .cfg-sub { margin-top: 2px; color: var(--muted); font-size: var(--fs-meta); }
.cfgbad .cfg-bd { padding: 10px 14px; }
.cfgbad .cfg-path { display: flex; align-items: center; gap: 8px; color: var(--muted); font: var(--w-reg) var(--fs-meta) var(--mono); }
.cfgbad .cfg-path > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
@@ -30,7 +30,7 @@ describe("the config banner at the top of settings", () => {
draw(problem());
const bar = await waitFor(() => { const e = document.querySelector(".cfgbad"); expect(e).toBeTruthy(); return e!; });
expect(bar.querySelector(".cfg-hd b")?.textContent).toBe("配置文件第 12 行无法解析");
expect(bar.querySelector(".cfg-hd .sub")?.textContent).toContain("上一次成功解析的配置");
expect(bar.querySelector(".cfg-hd .cfg-sub")?.textContent).toContain("上一次成功解析的配置");
expect(bar.querySelector(".cfg-path span")?.textContent).toBe("~/.reasonix/config.toml");
expect(bar.querySelector(".cfg-diff .er")?.textContent).toBe("12model = deepseek-v4-pro");
expect(bar.querySelector(".cfg-card")?.getAttribute("data-lvl")).toBe("warn");
@@ -53,7 +53,7 @@ export function ConfigTrouble({ port, onRepaired }: { port: AgentPort; onRepaire
<StudioIcon name={repairable ? "fail" : "warning"} />
<div>
<b>{problem.line ? t("app.line_line_of_the_config", { line: problem.line }) : t("app.the_config_file_does_not")}</b>
<div className="sub">
<div className="cfg-sub">
{problem.recovered === "last-known-good"
? t("app.what_is_shown_below_is")
: t("app.what_is_shown_below_is_2")}
+1 -1
View File
@@ -30,7 +30,7 @@ export function UpdateReady({ port, idle }: { port: Pick<AgentPort, "restartToVe
<button className="act ghost" data-action="update.later" onClick={() => setPutOff(version)}>{t("about.later")}</button>
<button className="act" data-primary data-action="update.restart" onClick={() => void restart()}>{t("about.restart_and_update")}</button>
</>}><b>{t("about.version_v_is_downloaded", { v: version })}</b>
<div className="sub">{says || t("about.restart_to_use_it_never_automatic")}</div>
<div className="toast-sub">{says || t("about.restart_to_use_it_never_automatic")}</div>
</ToastRow>
);
}