mirror of
https://github.com/esengine/DeepSeek-Reasonix.git
synced 2026-11-07 10:45:59 -10:00
fix(studio): the context details card follows the Chat-Tools board: K for thousands, the one-line hint, MCP counted as connected and tools, a plain Manage MCP, values in the interface face
This commit is contained in:
1 parent
77d875db8d
commit
aadd62e2e5
6 files changed
+13
-7
No files matched your search
@@ -98,3 +98,7 @@
|
||||
.hero .herostart { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
|
||||
.hero .herostart button { height: 28px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-pill); background: transparent; color: var(--muted); font: var(--w-reg) var(--fs-meta) var(--ui); cursor: pointer; }
|
||||
.hero .herostart button:hover { background: var(--overlay); color: var(--text); }
|
||||
.chrome-context-card:not(.studio-overview-card) > .chrome-context-hint { order: 3; margin: 0; padding: 6px 14px 10px; color: var(--faint); font: var(--w-med) var(--fs-meta)/1.4 var(--ui); }
|
||||
.chrome-context-card:not(.studio-overview-card) > .chrome-context-foot > .manage { color: var(--link); font: var(--w-med) var(--fs-meta)/1 var(--ui); white-space: nowrap; }
|
||||
.chrome-context-card:not(.studio-overview-card) > .chrome-context-foot { font: var(--w-med) var(--fs-meta)/1.4 var(--ui); }
|
||||
.chrome-context-card:not(.studio-overview-card) > .chrome-context-parts :is(b, .chrome-context-more) { color: var(--muted); font: var(--w-med) var(--fs-meta)/1 var(--ui); }
|
||||
@@ -130,7 +130,7 @@ export const COMPOSER: Messages = {
|
||||
"composer.local_branches": { zh: "本地分支", en: "Local branches" },
|
||||
"composer.make_it_a_steer": { zh: "改为插话", en: "Make it a steer" },
|
||||
"composer.make_name_the_default_model": { zh: "将 {name} 设为默认模型", en: "Make {name} the default model" },
|
||||
"composer.manage_mcp_and_tools": { zh: "管理 MCP 与工具", en: "Manage MCP and tools" },
|
||||
"composer.manage_mcp": { zh: "管理 MCP", en: "Manage MCP" },
|
||||
"composer.manage_models_and_connections": { zh: "管理模型与连接", en: "Manage models and connections" },
|
||||
"composer.maximum": { zh: "极致", en: "Maximum" },
|
||||
"composer.minimal": { zh: "最轻量", en: "Minimal" },
|
||||
@@ -177,6 +177,7 @@ export const COMPOSER: Messages = {
|
||||
"composer.auto_approve": { zh: "自动批准", en: "Auto-approve" },
|
||||
"composer.once_trusted_edits_and_commands": { zh: "信任后,在此文件夹里的编辑和命令不再逐条询问(桌面端和终端都是)。系统沙盒把命令的写入限制在此文件夹、你额外允许写入的目录、临时目录和工具链缓存内;网络与拒绝规则照常生效。", en: "Once trusted, edits and commands in this folder run without asking each time, here and in the terminal. The OS sandbox limits what commands write to this folder, the directories you allowed writes to, temp and toolchain caches; network and deny rules still apply." },
|
||||
"composer.only_levels_actually_supported_by": { zh: "仅显示当前模型实际支持的档位。", en: "Only levels actually supported by this model are shown." },
|
||||
"composer.open_a_class_for_its_largest": { zh: "点一类展开其中最大的几项", en: "Open a class for its largest items" },
|
||||
"composer.open_the_session_overview": { zh: "查看会话概览", en: "Open the session overview" },
|
||||
"composer.past_conversation_read_only_reference": { zh: "历史会话 · 只读资料", en: "Past conversation · read-only reference" },
|
||||
"composer.pasted_text": { zh: "粘贴的文本", en: "pasted text" },
|
||||
|
||||
@@ -63,7 +63,7 @@ it("says where the window folds on its own, beside the capacity", () => {
|
||||
render(card(breakdown({ window: 128_000, compact_at: 115_000 })));
|
||||
const total = document.querySelector(".chrome-context-total")!;
|
||||
expect(total.textContent).toContain("模型容量");
|
||||
expect(total.textContent).toContain("到 115k 自动压缩");
|
||||
expect(total.textContent).toContain("到 115K 自动压缩");
|
||||
});
|
||||
|
||||
it("says nothing about a fold the kernel has no threshold for", () => {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { t } from "../i18n";
|
||||
import type { ContextBreakdown, McpEntry } from "../port/port";
|
||||
import { CompactNow, type CompactAction } from "./CompactNow";
|
||||
|
||||
const compact = (n: number): string => n >= 1_000_000 ? `${(n / 1_000_000).toFixed(1)}M` : n >= 1_000 ? `${Math.round(n / 100) / 10}k` : String(n);
|
||||
const compact = (n: number): string => n >= 1_000_000 ? `${(n / 1_000_000).toFixed(1)}M` : n >= 1_000 ? `${Math.round(n / 100) / 10}K` : String(n);
|
||||
|
||||
export function ContextSummaryCard({ context, mcp, percent, onManage, compact: action, className = "" }: {
|
||||
context: ContextBreakdown | null;
|
||||
@@ -43,6 +43,7 @@ export function ContextSummaryCard({ context, mcp, percent, onManage, compact: a
|
||||
: <b>{compact(value)}</b>}
|
||||
</div>
|
||||
))}</div>
|
||||
{!opened && parts.some(([, , key]) => holdersOf(key).length > 0) && <p className="chrome-context-hint">{t("composer.open_a_class_for_its_largest")}</p>}
|
||||
{opened && (
|
||||
<ul className="chrome-context-items" aria-labelledby="chrome-context-items-title">
|
||||
<li id="chrome-context-items-title" className="head">{t("composer.largest_items_in_name", { name: opened[0] })}</li>
|
||||
@@ -59,10 +60,10 @@ export function ContextSummaryCard({ context, mcp, percent, onManage, compact: a
|
||||
) : <p>{t("composer.no_context_data_yet")}</p>}
|
||||
<footer className="chrome-context-foot">
|
||||
<span title={active.map((server) => `${server.name} · ${server.state === "ready" ? `${server.tools || 0} ${t("composer.tools")}` : t("composer.waiting_to_connect")}`).join("\n") || undefined}>
|
||||
MCP · {ready.length} / {active.length} {t("composer.connected")} · {tools} {t("composer.tools")}
|
||||
MCP · {ready.length} {t("composer.connected")} · {tools} {t("composer.tools")}
|
||||
</span>
|
||||
{action && <CompactNow action={action} usage={context ? { used: context.used, window: context.window } : undefined} />}
|
||||
<button type="button" className="manage" data-action="settings.section" data-value="ext" onClick={onManage}>{t("composer.manage_mcp_and_tools")}</button>
|
||||
<button type="button" className="manage" data-action="settings.section" data-value="ext" onClick={onManage}>{t("composer.manage_mcp")}</button>
|
||||
</footer>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -133,7 +133,7 @@ it("reports a transport refusal and restores the action for retry without queuei
|
||||
|
||||
it("keeps the adjacent MCP management action working", async () => {
|
||||
const pane = await mount();
|
||||
fireEvent.click(pane.card().getByRole("button", { name: "管理 MCP 与工具" }));
|
||||
fireEvent.click(pane.card().getByRole("button", { name: "管理 MCP" }));
|
||||
expect(pane.settings).toHaveBeenCalledExactlyOnceWith("extensions");
|
||||
});
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ describe("a pane's view", () => {
|
||||
vi.spyOn(port, "context").mockImplementation(async () => ({ ...await context(), window }));
|
||||
const all = { ...props, rt: rtOf("p1"), port: port as AgentPort };
|
||||
const view = render(<Pane {...all} />);
|
||||
await waitFor(() => expect(document.querySelector(".chrome-context-total")?.textContent).toContain("160k"));
|
||||
await waitFor(() => expect(document.querySelector(".chrome-context-total")?.textContent).toContain("160K"));
|
||||
|
||||
window = 1_000_000;
|
||||
view.rerender(boxOf("p1", <Harness {...all} pulse={1} />));
|
||||
|
||||
Reference in new issue
Block a user