From c2a519518dcd79dbb27fba5cafd6bf95a93c327d Mon Sep 17 00:00:00 2001 From: tangzhixiong613-jpg <340458552+tangzhixiong613-jpg@users.noreply.github.com> Date: Sun, 15 Nov 2026 16:54:35 +0000 Subject: [PATCH 1/4] =?UTF-8?q?T-1266=20Cry=20Bot=20=E5=B1=8F=E5=B9=95?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=EF=BC=9A=E6=9C=AA=E5=88=86=E9=85=8D=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E5=8E=BB=E9=87=8D=E3=80=81=E6=8C=89=E9=92=AE=E9=97=B4?= =?UTF-8?q?=E8=B7=9D=E3=80=81=E5=85=B1=E7=94=A8=E6=A8=A1=E5=BC=8F=E6=94=B9?= =?UTF-8?q?=E5=8F=AB=E5=85=B1=E7=94=A8=E7=94=B5=E8=84=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- .../T-1266-screen-panel-polish/brief.md | 34 +++++++++++ shared/place-view.test.ts | 17 ++++++ shared/place-view.ts | 17 ++++-- src/components/AssignLocalVmScreen.tsx | 2 +- src/components/ComputerPanel.takeover.test.ts | 59 ++++++++++++++++++- src/components/ComputerPanel.tsx | 10 ++-- src/components/WorksOnGrid.tsx | 4 +- .../remote-desktop-panel.screen.test.ts | 19 +++++- src/components/remote-desktop-panel.tsx | 3 +- src/lib/place-view.ts | 8 ++- src/lib/place.ts | 10 +++- src/locales/en.json | 5 ++ src/locales/source-hashes.json | 7 ++- src/locales/zh.json | 5 ++ 14 files changed, 177 insertions(+), 23 deletions(-) create mode 100644 docs/tasks/T-1200/T-1266-screen-panel-polish/brief.md diff --git a/docs/tasks/T-1200/T-1266-screen-panel-polish/brief.md b/docs/tasks/T-1200/T-1266-screen-panel-polish/brief.md new file mode 100644 index 00000000..b9014216 --- /dev/null +++ b/docs/tasks/T-1200/T-1266-screen-panel-polish/brief.md @@ -0,0 +1,34 @@ +## 运行环境(云沙箱,必读) +- 开工先在 worktree 根目录运行 依赖准备脚本(镜像自带,把预装依赖链进 node_modules),之后 `pnpm exec tsc` 才可用。 +- 这里没有 systemd、Docker,`systemd-run --scope ... --` 前缀一律去掉直接运行;一次只跑一个测试文件。 +- 报告只写三样:改了什么(文件列表与 git status 一致)、为什么、测试命令与结果摘要。 +- 不提交 git。 +- 本仓库是公开仓库:代码、注释、报告里不得出现内部域名、IP、邮箱、人名、真实钥匙、沙箱主目录绝对路径。 + +# T-1266:Cry Bot 屏幕面板三处小问题(T-1253 上线截图发现) + +## 现象(共用电脑模式:`config.localVm.mode === "shared"` 且屏数 > 1;智能体工作位置选「vm」但还没分到屏) +1. 「这个智能体目前没有分配屏幕。」出现两次:`src/components/AssignLocalVmScreen.tsx` 在按钮上方有一行 `role="status"` 提示,同时下面的预览框(`src/components/ComputerPanel.tsx` 约 1300 行一带,`vm-waiting` 阶段的空态)里又显示同一句。 +2. 「现在分配屏幕」按钮底边紧贴下面的预览框,没有间距,手机 390 宽度更明显。 +3. 下方「工作位置」卡里,选中的「vm」选项仍叫「私有桌面」,卡片底部说明仍是 `place.view.vm.line`「本设备上的私有 Linux 桌面,与你自己的屏幕分开。」。共用模式下智能体用的是共用电脑里的一块屏,这个叫法和说明都不对。T-1248 只把网格里的小字描述换成了 `computer.dest.vmScreenDesc`(见 `src/lib/place.ts` 的 `vmDescriptionKey`),标题和底部说明漏了。 + +## 要改的 +1. 去重:未分配屏幕时这句话只出现一次。保留预览框里的空态提示或按钮上方那行二选一(建议保留按钮上方那行,因为排队位置、出错提示也在那里;预览框在这种状态下不要再重复这句话,可以只留图标或换成不重复的简短说明)。排队中(有 queue_position)的提示照常。 +2. 间距:「现在分配屏幕」按钮(含出错提示)与下面预览框之间留出和面板其他块一致的间距(例如 mb-3 / gap-3 一类),桌面和 390/360 手机都不能贴边。 +3. 共用模式叫法:与 `vmDescriptionKey` 同一判定口径(抽成一个共用的判定函数,不要再写一份字符串比较),共用模式下: + - 工作位置网格里 vm 选项的标题改用新文案键(中文「共用电脑」,英文「Shared computer」); + - 卡片底部说明(place view 的 vm 那行,`shared/place-view.ts` / `src/lib/place-view.ts`)改用新说明(中文「共用电脑里分给它的一块屏幕,与你自己的屏幕分开。」,英文对应);短说明同理如有显示。 + - 面板里其他在共用模式下仍会显示「私有桌面」的地方(例如 `remote-desktop-panel.tsx` 266 行、`ComputerPanel.tsx` 1297 行在未分到屏号时的回退文字),一并按同一判定改成共用叫法。 + - 非共用模式(按智能体私有桌面、单屏共享)保持现状不变。 + - 新文案键按仓库现有规矩补齐 zh/en、`src/locales/source-hashes.json` 及相关文案测试;iOS 端若用到同一键,按仓库已有做法同步。 +4. 不改服务端逻辑,不改分配/排队流程。 + +## 测试(沉淀进仓库) +- `AssignLocalVmScreen` / `ComputerPanel` 现有测试(如 `src/components/ComputerPanel.takeover.test.ts`、`src/components/remote-desktop-panel.screen.test.ts`)里补用例:未分配屏幕时那句话在渲染结果里只出现一次;排队提示不受影响。 +- `WorksOnGrid` / place view 相关单测补用例:共用多屏模式 vm 选项标题与底部说明为共用叫法;按智能体模式仍为「私有桌面」。 +- 跑改动相关的测试文件和 `pnpm exec tsc`,报告里写结果摘要。 + +## 验收 +- 共用多屏模式、智能体未分屏:提示只出现一次;按钮与预览框之间有明显间距(1440 桌面、390、360 手机)。 +- 共用多屏模式:工作位置卡选中项显示「共用电脑」,底部说明不再出现「私有 Linux 桌面」。 +- 按智能体模式下文案与之前一致。 diff --git a/shared/place-view.test.ts b/shared/place-view.test.ts index 659e1346..bb2c126e 100644 --- a/shared/place-view.test.ts +++ b/shared/place-view.test.ts @@ -274,3 +274,20 @@ it("omits Boat setup and team desktop hints under provider lock while retaining expect(placeView(facts({ providerLock: true, backend: "vps" })).state).toBe("vps"); expect(placeView(facts({ providerLock: true, place: "vm" })).state).toBe("vm"); }); + + +it("describes shared VM screens without changing the private desktop view", () => { + const shared = placeView(facts({ place: "vm", sharedVmScreen: true })); + expect(shared).toMatchObject({ + state: "vm", short: "A screen in a shared computer", + line: "A screen assigned to this bot in a shared computer, separate from your own screen.", + }); + expect(shared.action).toEqual({ id: "open-vm-settings", label: "Shared computer settings" }); + for (const sharedVmScreen of [false, undefined]) { + expect(placeView(facts({ place: "vm", sharedVmScreen }))).toMatchObject({ + short: en["place.view.vm.short"], line: en["place.view.vm.line"], action: { id: "open-vm-settings", label: en["place.action.openVmSettings"] }, + }); + } + expect(placeView(facts({ place: "vm", sharedVmScreen: true, engine: { ...facts().engine, computer: false } })).line) + .toContain("can't use a shared computer"); +}); diff --git a/shared/place-view.ts b/shared/place-view.ts index 3ee5d5a6..c660c209 100644 --- a/shared/place-view.ts +++ b/shared/place-view.ts @@ -79,6 +79,8 @@ export type ServerKind = "my-cloud" | "mac" | "pc" | "linux" | "remote"; export interface PlaceFacts { /** The place to describe: Auto, Off, or one of the four places. */ place: Place | "auto" | "off"; + /** The local desktop is one of multiple screens in a shared computer. */ + sharedVmScreen?: boolean; server: ServerKind; bot: string; /** Desktop only: signed in to a paid Cry Bot Cloud plan (the desktop bridge). */ @@ -174,6 +176,10 @@ export const PLACE_EN = { "place.view.local.line": "Uses your screen, mouse, and keyboard.", "place.view.localUnavailable.short": "Can't use it yet", "place.view.localUnavailable.line": "{reason}", + "place.action.openSharedVmSettings": "Shared computer settings", + "place.view.vmScreen.short": "A screen in a shared computer", + "place.view.vmScreen.line": "A screen assigned to this bot in a shared computer, separate from your own screen.", + "place.view.vmScreenCannot.line": "{model} can't use a shared computer. Choose a model that supports computer use.", "place.view.vm.short": "Separate from your screen", "place.view.vm.line": "A private Linux desktop on this device, separate from your own screen.", "place.view.vmCannot.short": "Not with this model", @@ -396,6 +402,8 @@ function templateParams(params: PlaceParams, locale: string): Record + return

{queuePosition ? t("vm.screens.queued", { position: queuePosition }) : t(pending ? "settings.updates.opening" : "vm.screens.unassignedBot")} {queuePosition ? ` ${t("vm.screens.queueDetail")}` : null} diff --git a/src/components/ComputerPanel.takeover.test.ts b/src/components/ComputerPanel.takeover.test.ts index 46d0f131..d865f6a9 100644 --- a/src/components/ComputerPanel.takeover.test.ts +++ b/src/components/ComputerPanel.takeover.test.ts @@ -5,10 +5,11 @@ import { flushSync } from "react-dom"; import { createRoot, type Root } from "react-dom/client"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { ApiError } from "@/state/api"; -import { t } from "@/lib/i18n"; +import { setLocale, t } from "@/lib/i18n"; import type { Action, AppState, Bot, InstanceInfo } from "@/state/store"; const fixture = vi.hoisted(() => ({ + advanced: false, vm: {} as Record, vmRequests: [] as string[], vmForegroundRequests: 0, @@ -54,7 +55,7 @@ vi.mock("./DesktopCapabilities", async (importOriginal) => ({ }, }), })); -vi.mock("@/lib/interface-mode", () => ({ useAdvancedMode: () => false, setAdvancedMode: () => {} })); +vi.mock("@/lib/interface-mode", () => ({ useAdvancedMode: () => fixture.advanced, setAdvancedMode: () => {} })); vi.mock("./CloudScreenPreview", () => ({ CloudScreenPreview: ({ onOpen }: { onOpen: () => void }) => createElement("button", { "data-preview": "", onClick: onOpen }, "preview"), })); @@ -203,6 +204,8 @@ beforeEach(() => { setItem: (key: string, value: string) => void saved.set(key, value), removeItem: (key: string) => void saved.delete(key), }); + fixture.advanced = false; + setLocale("en"); fixture.vm = {}; fixture.vmRequests = []; fixture.vmForegroundRequests = 0; @@ -235,6 +238,7 @@ beforeEach(() => { })); }); afterEach(() => { + setLocale("en"); root?.unmount(); root = null; document.body.innerHTML = ""; @@ -759,3 +763,54 @@ it.each([ expect(resolved).not.toHaveBeenCalled(); expect(fixture.controls).toHaveLength(taking ? 1 : 0); }); + + +it.each(["en", "zh"] as const)("shows one unassigned or queued message in %s", async locale => { + vi.useFakeTimers(); + setLocale(locale); + fixture.vm = { mode: "shared", screen: null }; + state.config = { ...state.config!, localVm: { mode: "shared", screens: 4, maxInstances: 1 } }; + await open(makeBot({ computer: "vm" })); + expect(document.body.textContent!.split(t("vm.screens.unassignedBot"))).toHaveLength(2); + const assignment = document.querySelector('[role="status"]')!.parentElement!; + expect(assignment.classList.contains("mb-3")).toBe(true); + fixture.assignment = { screen: null, queue_position: 2 }; + await press(t("vm.screens.assignNow")); + expect(document.body.textContent!.split(t("vm.screens.queued", { position: 2 }))).toHaveLength(2); + expect(document.body.textContent).toContain(t("vm.screens.queueDetail")); + expect(document.body.textContent).not.toContain(t("vm.screens.unassignedBot")); + fixture.vm = { statusError: "Assignment unavailable" }; + await vi.advanceTimersByTimeAsync(2000); + await settle(); + expect(assignment.querySelector('[role="alert"]')?.textContent).toBe("Assignment unavailable"); + expect(assignment.classList.contains("mb-3")).toBe(true); +}); + +it.each([ + ["shared", 4, true], ["shared", 1, false], ["shared", undefined, false], ["per-bot", 4, false], +] as const)("uses the correct VM title and footer for %s with %s screens", async (mode, screens, shared) => { + vi.useFakeTimers(); + fixture.vm = { mode, screen: null }; + state.config = { ...state.config!, localVm: { mode, screens, maxInstances: 1 } }; + await open(makeBot({ computer: "vm" })); + for (const locale of ["en", "zh"] as const) { + setLocale(locale); + for (const advanced of [false, true]) { + fixture.advanced = advanced; + draw(); + await settle(); + const selected = [...document.querySelectorAll('button[aria-pressed="true"]')]; + expect(selected.some(node => node.textContent?.includes(t(shared ? "vm.dest.shared" : "vm.dest.vm")))).toBe(true); + expect(document.querySelector('[data-testid="place-line"]')?.textContent).toContain(t(shared ? "place.view.vmScreen.line" : "place.view.vm.line")); + if (shared) expect(document.body.textContent).not.toContain(t("vm.dest.vm")); + } + } +}); + +it("uses the shared title when a ready VM response omits its screen number", async () => { + vi.useFakeTimers(); + state.config = { ...state.config!, localVm: { mode: "shared", screens: 4, maxInstances: 1 } }; + await open(makeBot({ computer: "vm" })); + expect(document.body.textContent).toContain("Shared computer"); + expect(document.body.textContent).not.toContain("Private desktop"); +}); diff --git a/src/components/ComputerPanel.tsx b/src/components/ComputerPanel.tsx index c7dd0ba7..fcadacfd 100644 --- a/src/components/ComputerPanel.tsx +++ b/src/components/ComputerPanel.tsx @@ -11,7 +11,7 @@ import { api, ApiError, currentTaskBot, useStore, type Bot, type ConfigStatus } import { setAdvancedMode, useAdvancedMode } from "@/lib/interface-mode"; import { SIMPLE_ONLY } from "@/lib/simple-only"; import { ComputerFilesPane } from "./ComputerFilesPane"; -import { effectivePlace, personPin, placeLabelKey, placeOffered } from "@/lib/place"; +import { effectivePlace, personPin, placeLabelKey, placeOffered, vmLabelKey } from "@/lib/place"; import type { CloudBackend } from "../../shared/wire"; import { KeyRow } from "./keys/KeyRow"; import { openKeySettings } from "./keys/key-focus"; import { cn } from "@/lib/cn"; @@ -1129,7 +1129,7 @@ export function ComputerPanel({ const disabled = Boolean(managedBy) || placeBlocked(view); const issue = !managedBy && placeHasIssue(view); const unavailableTitle = managedBy ?? (issue ? view.line : mode === "browser" ? t("computer.browserOnlyTitle") : undefined); - return { mode, labelKey, descriptionKey, Icon, simpleLabel: providerLock && mode === "cloud" ? t("botAccess.cloud.selfHostedVps") : worksOnSimpleLabel(mode ?? undefined, capabilities.host.platform), selected, managedBy, disabled, unavailableTitle, view, issue }; + return { mode, labelKey, descriptionKey, Icon, simpleLabel: providerLock && mode === "cloud" ? t("botAccess.cloud.selfHostedVps") : worksOnSimpleLabel(mode ?? undefined, capabilities.host.platform, state.config), selected, managedBy, disabled, unavailableTitle, view, issue }; }); const worksOnView = placeOptions.find(({ selected }) => selected)?.view ?? autoView; const runPlaceAction = (id: PlaceActionId) => { @@ -1294,7 +1294,7 @@ export function ComputerPanel({ {currentTeamComputer && {autoView.short}} {phase === "local" && {t("computer.badge.local")}} {liveHere && {t("computer.inControl")}} - {phase === "vm" && !liveHere && {vmStatus?.screen?.screen ? t("vm.screens.number", { screen: vmStatus.screen.screen }) : t("vm.dest.vm")}} + {phase === "vm" && !liveHere && {vmStatus?.screen?.screen ? t("vm.screens.number", { screen: vmStatus.screen.screen }) : t(vmLabelKey(state.config))}} {(phase === "show-ready-boat" || phase === "show-sleeping-boat" || phase === "show-pending-boat") && ( {t("computer.badge.autoBoat")} )} @@ -1367,7 +1367,7 @@ export function ComputerPanel({ ) : ( )} - + {phase !== "vm-waiting" && {currentTeamComputer ? autoView.line : cloudPreviewReady @@ -1385,7 +1385,7 @@ export function ComputerPanel({ : vmResumable ? t(pending === "vm-start" ? "vm.setup.starting" : "computer.phase.vmStopped") : emptyState[phase]} - + } {currentTeamComputer && placeActionButton(autoView)} {bot.computer === "cloud" && (phase === "unconfigured" || phase === "error") && cloudView.action?.id !== "add-boat-key" && placeActionButton(cloudView)} { setError(null); setRetry((n) => n + 1); }} view={{ computer: bot.computer, cloudBackend, canManage: canManageCloud, busy: profileBot.busy === true, pending: pending !== null, phase, boatState, refusal: cloudRefused?.state }} /> diff --git a/src/components/WorksOnGrid.tsx b/src/components/WorksOnGrid.tsx index 4c1ecf4f..7cd1f371 100644 --- a/src/components/WorksOnGrid.tsx +++ b/src/components/WorksOnGrid.tsx @@ -5,7 +5,7 @@ import type { PlaceView } from "../../shared/place-view"; import { cn } from "@/lib/cn"; import { t } from "@/lib/i18n"; import { pageOnRemoteServer } from "@/lib/local-computer"; -import { placeOffered, vmDescriptionKey, type Place } from "@/lib/place"; +import { placeOffered, vmLabelKey, vmDescriptionKey, type Place } from "@/lib/place"; import type { LocaleKey } from "@/locales"; export type WorksOnMode = Place | "off" | null; @@ -21,7 +21,7 @@ const WORKS_ON_CHOICES = [ export function worksOnChoices(config: Partial> | null | undefined, capabilities: DesktopCapabilities): ReadonlyArray { return WORKS_ON_CHOICES.map((choice): readonly [WorksOnMode, LocaleKey, LocaleKey, LucideIcon] => config?.providerLock && choice[0] === "cloud" - ? ["cloud", "botAccess.cloud.selfHostedVps", "botAccess.cloud.vpsDescription", Cloud] : choice[0] === "vm" ? [choice[0], choice[1], vmDescriptionKey(config), choice[3]] : choice).filter(([mode]) => mode === null || mode === "off" || (placeOffered(mode, config, config?.providerLock ? "vps" : undefined) && !(mode === "local" && pageOnRemoteServer(capabilities)))); + ? ["cloud", "botAccess.cloud.selfHostedVps", "botAccess.cloud.vpsDescription", Cloud] : choice[0] === "vm" ? [choice[0], vmLabelKey(config), vmDescriptionKey(config), choice[3]] : choice).filter(([mode]) => mode === null || mode === "off" || (placeOffered(mode, config, config?.providerLock ? "vps" : undefined) && !(mode === "local" && pageOnRemoteServer(capabilities)))); } export function worksOnSelected(mode: WorksOnMode, computer: Bot["computer"], capabilities: DesktopCapabilities): boolean { diff --git a/src/components/remote-desktop-panel.screen.test.ts b/src/components/remote-desktop-panel.screen.test.ts index 278630ce..8f662644 100644 --- a/src/components/remote-desktop-panel.screen.test.ts +++ b/src/components/remote-desktop-panel.screen.test.ts @@ -3,7 +3,7 @@ import { act, createElement } from "react"; import { createRoot, type Root } from "react-dom/client"; import { afterEach, beforeEach, expect, it, vi } from "vitest"; import { setLocale } from "@/lib/i18n"; -import type { Bot } from "@/state/store"; +import type { Bot, ConfigStatus } from "@/state/store"; const fixture = vi.hoisted(() => ({ status: vi.fn(), assign: vi.fn(), openDesktop: vi.fn() })); vi.mock("./computer-takeover", () => ({ openProviderDesktop: fixture.openDesktop })); @@ -51,8 +51,8 @@ afterEach(() => { vi.unstubAllGlobals(); }); -const open = () => act(async () => root!.render(createElement(BotEditorStore, { value: { - state: initialState, +const open = (localVm?: ConfigStatus["localVm"]) => act(async () => root!.render(createElement(BotEditorStore, { value: { + state: localVm ? { ...initialState, config: { ...initialState.config!, box: { configured: false }, localVm } } : initialState, dispatch: vi.fn(), flushBotPatches: async () => null, refreshInstances: async () => {}, refreshModels: async () => {}, }, children: createElement(RemoteDesktopPanel, { bot }) }))); const advance = (milliseconds: number) => act(async () => vi.advanceTimersByTimeAsync(milliseconds)); @@ -230,3 +230,16 @@ it("keeps the assignment visible until the viewer opens and offers retry when op expect(fixture.openDesktop).toHaveBeenCalledTimes(2); expect(host.querySelector('[role="status"]')).toBeNull(); }); + + +it.each([ + ["shared", 4, "共用电脑"], ["shared", 1, "私有桌面"], ["per-bot", 4, "私有桌面"], +] as const)("labels an unassigned %s desktop with %s screens", async (mode, screens, title) => { + await open({ mode, screens, maxInstances: 1 }); + expect(host.textContent).toContain(title); + expect(host.textContent!.split("这个智能体目前没有分配屏幕。")).toHaveLength(2); + fixture.status.mockResolvedValue({ screen: null, queue_position: 2 }); + await advance(4000); + expect(host.textContent!.split("正在排队,第 2 位")).toHaveLength(2); + expect(host.textContent).not.toContain("这个智能体目前没有分配屏幕。"); +}); diff --git a/src/components/remote-desktop-panel.tsx b/src/components/remote-desktop-panel.tsx index d1f8b3f5..551b430e 100644 --- a/src/components/remote-desktop-panel.tsx +++ b/src/components/remote-desktop-panel.tsx @@ -10,6 +10,7 @@ import { isRemoteScreenshotContention, localVmScreenshotSource, remoteScreenshot import type { Routine } from "@/lib/routines"; import { dayName, scheduleLabel } from "@/lib/schedule-label"; import { intlLocale, t } from "@/lib/i18n"; +import { vmLabelKey } from "@/lib/place"; import { api, ApiError, useStore, type Bot } from "@/state/store"; import { releaseComputerPanelFocus, takeComputerPanelBrowserView, useComputerPanelEntry } from "@/lib/computer-panel-focus"; import { RoutineEditor } from "./RoutinesPage"; @@ -263,7 +264,7 @@ export function RemoteDesktopPanel({ bot }: { bot: Bot }) {

{t("remoteDesktop.title", { name: bot.name })}
- {localVm && screenNumber ? t("vm.screens.number", { screen: screenNumber }) : t(localVm ? "vm.dest.vm" : bot.cloudBackend === "vps" ? "botAccess.cloud.selfHostedVps" : "remoteDesktop.cloudDesktop")} + {localVm && screenNumber ? t("vm.screens.number", { screen: screenNumber }) : t(localVm ? vmLabelKey(state.config) : bot.cloudBackend === "vps" ? "botAccess.cloud.selfHostedVps" : "remoteDesktop.cloudDesktop")}
diff --git a/src/lib/place-view.ts b/src/lib/place-view.ts index 7a1a9fc3..b496c3b4 100644 --- a/src/lib/place-view.ts +++ b/src/lib/place-view.ts @@ -7,6 +7,7 @@ import { browserAvailable, builtInBrowserEnabled, type FeatureFlagConfig } from import { writeComputerPanelView } from "@/lib/computer-panel-view"; import { useAdvancedMode } from "@/lib/interface-mode"; import { pageOnRemoteServer } from "@/lib/local-computer"; +import { usesSharedVmScreens, vmLabelKey } from "@/lib/place"; import { useOwnerOrAdmin } from "@/lib/use-owner-or-admin"; import { openBotSettings } from "@/components/bot-panel/panel-link"; import { openKeySettings } from "@/components/keys/key-focus"; @@ -57,7 +58,7 @@ export function placeFacts(input: { bot: Pick; place: PlaceFacts["place"]; seat: PlaceSeat; - config: (FeatureFlagConfig & Pick) | null | undefined; + config: (FeatureFlagConfig & Pick & Partial>) | null | undefined; instances: InstanceInfo[]; local?: PlaceFacts["local"]; computer?: PlaceFacts["computer"]; @@ -67,6 +68,7 @@ export function placeFacts(input: { const instance = input.instances.find((candidate) => candidate.instanceId === bot.modelSelection.instanceId); return { place: input.place, + sharedVmScreen: usesSharedVmScreens(config), providerLock: config?.providerLock, server: seat.server, bot: bot.name, @@ -181,7 +183,7 @@ export const SIMPLE_PLACE_LABEL = { off: "vm.dest.off", } as const satisfies Record; -export function worksOnSimpleLabel(computer: Bot["computer"], platform: DesktopCapabilities["host"]["platform"]): string { +export function worksOnSimpleLabel(computer: Bot["computer"], platform: DesktopCapabilities["host"]["platform"], config?: Partial> | null): string { if (computer === "local") return t(platform === "darwin" ? "computer.simple.dest.thisMac" : "computer.simple.dest.thisPc"); - return t(SIMPLE_PLACE_LABEL[computer ?? "auto"]); + return t(computer === "vm" ? vmLabelKey(config) : SIMPLE_PLACE_LABEL[computer ?? "auto"]); } diff --git a/src/lib/place.ts b/src/lib/place.ts index d9524310..3cbb7ce3 100644 --- a/src/lib/place.ts +++ b/src/lib/place.ts @@ -25,8 +25,16 @@ export function isComputerPlace(place: EffectivePlace): place is "cloud" | "vm" return place === "cloud" || place === "vm" || place === "local"; } +export function usesSharedVmScreens(config: Partial> | null | undefined): boolean { + return config?.localVm?.mode === "shared" && (config.localVm.screens ?? 1) > 1; +} + +export function vmLabelKey(config: Partial> | null | undefined): LocaleKey { + return usesSharedVmScreens(config) ? "vm.dest.shared" : "vm.dest.vm"; +} + export function vmDescriptionKey(config: Partial> | null | undefined): LocaleKey { - return config?.localVm?.mode === "shared" && (config.localVm.screens ?? 1) > 1 + return usesSharedVmScreens(config) ? "computer.dest.vmScreenDesc" : "computer.dest.vmDesc"; } diff --git a/src/locales/en.json b/src/locales/en.json index bdc891a1..ccace202 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1,4 +1,9 @@ { + "place.action.openSharedVmSettings": "Shared computer settings", + "vm.dest.shared": "Shared computer", + "place.view.vmScreen.short": "A screen in a shared computer", + "place.view.vmScreen.line": "A screen assigned to this bot in a shared computer, separate from your own screen.", + "place.view.vmScreenCannot.line": "{model} can't use a shared computer. Choose a model that supports computer use.", "task.incidents": "Problems to look at", "computer.dest.vmScreenDesc": "A screen in a shared container", "chat.notice.waitingForScreen": "Waiting for its turn on this computer", diff --git a/src/locales/source-hashes.json b/src/locales/source-hashes.json index 4fb8c604..ad791c31 100644 --- a/src/locales/source-hashes.json +++ b/src/locales/source-hashes.json @@ -8013,7 +8013,12 @@ "settings.island.enabled": "832b4305834ed3502ca8b7d481c683fbb30a15bdda98f8a9ecb9fc5623d40a26", "settings.island.fullscreen": "47330fba52fc4f1fce3b55ea5fa0e28649b2eaf7b70bcc373550837f7124804a", "settings.island.width": "bd7e1ab647abf2cd96d7d1d73618f392ce6d84feea11bcc8b5f36e8f252c6476", - "settings.island.widthHint": "06d600f97a416741dd94502e5aae8762b098890d1df898a61c189024af7fafd5" + "settings.island.widthHint": "06d600f97a416741dd94502e5aae8762b098890d1df898a61c189024af7fafd5", + "vm.dest.shared": "ed16499ddaa145e26723f3b113f56ca6723e923fbe512fce579e365190b690d2", + "place.view.vmScreen.short": "cff7cd0bc8dff65582be394cdfb17c0236c9be05e23b6ff97184c8d8d5c3a4da", + "place.view.vmScreen.line": "d9676ec40ec0ce02cbf63df1adfb80c009857cc264fbc9c5689c1394fcabd8d4", + "place.view.vmScreenCannot.line": "0fdbebf5d34e847a0d29e628c0b2c7fba01759fc248f285ad3dfc52863b2b0ec", + "place.action.openSharedVmSettings": "ad0307120d91c3a717825ee7cfe0df61d1975419505e164e825ac777ecaa0ee8" } } } diff --git a/src/locales/zh.json b/src/locales/zh.json index 009d74e7..2ddd1b27 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -1,4 +1,9 @@ { + "place.action.openSharedVmSettings": "共用电脑设置", + "vm.dest.shared": "共用电脑", + "place.view.vmScreen.short": "共用电脑里的一块屏幕", + "place.view.vmScreen.line": "共用电脑里分给它的一块屏幕,与你自己的屏幕分开。", + "place.view.vmScreenCannot.line": "{model} 无法使用共用电脑。请选择支持使用电脑的模型。", "task.incidents": "待处理的问题", "computer.dest.vmScreenDesc": "共享容器里的一块虚拟屏", "chat.notice.waitingForScreen": "正在排队等待屏幕", From 05827ba3f4978e3fd29538a9657f83b796745b5b Mon Sep 17 00:00:00 2001 From: tangzhixiong613-jpg <340458552+tangzhixiong613-jpg@users.noreply.github.com> Date: Sun, 15 Nov 2026 17:34:59 +0000 Subject: [PATCH 2/4] =?UTF-8?q?T-1266=20=E7=AC=AC=202=20=E8=BD=AE=EF=BC=9A?= =?UTF-8?q?=E5=85=B1=E7=94=A8=E5=A4=9A=E5=B1=8F=E6=A8=A1=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=E5=90=84=E5=A4=84=20vm=20=E5=8F=AB=E6=B3=95=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E4=B8=BA=E5=85=B1=E7=94=A8=E7=94=B5=E8=84=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- .../T-1200/T-1266-screen-panel-polish/r2.md | 18 +++++++++++ .../BotSettingsDialog.simple.test.ts | 24 ++++++++++++++ src/components/ChatView.screen.test.ts | 22 +++++++++++-- src/components/ChatView.tsx | 11 ++++--- src/components/ComputerPanel.tsx | 6 ++-- src/components/FailedTurnRow.place.test.ts | 11 +++++++ src/components/PlaceChip.test.ts | 32 +++++++++++++++++++ src/components/PlaceChip.tsx | 12 +++---- src/components/RoomHeader.test.ts | 13 ++++++++ src/components/RoomHeader.tsx | 9 +++--- src/components/ToolActivity.place.test.ts | 12 +++++++ src/components/ToolActivity.tsx | 6 ++-- src/components/bot-panel/ComputerTab.tsx | 2 +- src/lib/place.test.ts | 14 ++++++++ src/lib/place.ts | 3 +- 15 files changed, 169 insertions(+), 26 deletions(-) create mode 100644 docs/tasks/T-1200/T-1266-screen-panel-polish/r2.md diff --git a/docs/tasks/T-1200/T-1266-screen-panel-polish/r2.md b/docs/tasks/T-1200/T-1266-screen-panel-polish/r2.md new file mode 100644 index 00000000..1db9358e --- /dev/null +++ b/docs/tasks/T-1200/T-1266-screen-panel-polish/r2.md @@ -0,0 +1,18 @@ +## 运行环境(云沙箱,必读) +- 开工先在 worktree 根目录运行 依赖准备脚本(镜像自带,把预装依赖链进 node_modules),之后 `pnpm exec vitest` / `pnpm exec tsc` 才可用。 +- 这里**没有** systemd、Docker,说明里出现的 `systemd-run --scope ... --` 前缀一律去掉直接运行;机器 8G/4 核,一次只跑一个测试文件。 +- 若本轮沙箱已放开(能联网、能监听端口),交回前必须把改动相关的测试全部跑过,包括需要端口的 e2e;涉及的 e2e 连跑 3 次都要过。跑不了的写明原因。 +- 报告只写三样:改了什么(文件列表与 git status 一致)、为什么、测试命令与结果摘要。不要写长篇分析;完整输出放 verification 文本文件即可。 +- 不提交 git。 + +# T-1266 第 2 轮返工:补齐两处共用模式叫法 + +分支已有第 1 轮改动(已提交),在此基础上继续改,不要回退已有改动。原说明见 `docs/tasks/T-1200/T-1266-screen-panel-polish/brief.md` 第 3 条:面板里其他在共用模式下仍会显示「私有桌面」的地方一并按同一判定改成共用叫法。审核发现还有两处漏了: + +1. `src/components/bot-panel/ComputerTab.tsx` 约 62 行 `placeLabel`:vm 选项标题走 `worksOnSimpleLabel(place, platform)`,共用多屏模式下仍是「私有桌面」。改为与 `src/lib/place.ts` 的 `vmLabelKey(config)` 同一判定(用 `state.config`),非共用模式不变。 +2. `src/components/PlaceChip.tsx` 约 84 行:菜单项 `label: t(placeLabelKey(place))` 与 `place.followBotDetail` 里的 `placeLabelKey(botDefault)`,vm 在共用多屏模式下应使用 `vmLabelKey(state.config)`;非共用模式不变。 +3. 再全仓搜一遍前端里 vm 标题(`placeLabelKey`、`worksOnSimpleLabel` 等对 vm 的取名)在共用多屏模式下仍会显示「私有桌面」的入口,同样处理;不改服务端、不改分配/排队流程。 + +## 测试 +- 给 ComputerTab、PlaceChip 补用例:共用多屏模式 vm 显示「共用电脑」,按智能体模式仍为「私有桌面」。 +- 跑改动相关测试文件、`pnpm exec tsc`、`pnpm i18n:check`,报告写结果摘要。 diff --git a/src/components/BotSettingsDialog.simple.test.ts b/src/components/BotSettingsDialog.simple.test.ts index c3025e24..a4794849 100644 --- a/src/components/BotSettingsDialog.simple.test.ts +++ b/src/components/BotSettingsDialog.simple.test.ts @@ -2,6 +2,7 @@ import { Children, createElement, isValidElement, type ReactElement, type ReactN import { renderToStaticMarkup } from "react-dom/server"; import { afterAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { setLocale } from "@/lib/i18n"; import type { Routine } from "@/lib/routines"; import type { MemoryDoc } from "@/lib/memory"; import type { Bot, BotSettingsSection, InstanceInfo } from "@/state/store"; @@ -1001,6 +1002,29 @@ describe("the Where it works page", () => { expect(where(makeBot()).html).toContain('role="radiogroup"'); }); + it.each([ + ["shared", 4, true], + ["shared", 1, false], + ["shared", undefined, false], + ["per-bot", 4, false], + ] as const)("names the VM in the choices, summary and live location for %s / %s", (mode, screens, shared) => { + fixture.storeState = { ...fixture.storeState, config: { localVm: { mode, screens, maxInstances: 1 } } }; + try { + for (const locale of ["en", "zh"] as const) { + setLocale(locale); + const label = locale === "zh" ? shared ? "共用电脑" : "私有桌面" : shared ? "Shared computer" : "Private desktop"; + const bot = makeBot({ computer: "vm" }); + expect(find(where(bot), "data-panel-choice", "vm").props.title).toBe(label); + expect(find(computer(bot), "data-panel-page", "where").props.value).toBe(label); + const liveBot = makeBot({ computer: "cloud", tasks: [{ threadId: "thread-scout", title: "Main", surface: "vm" }] as Bot["tasks"] }); + expect(where(liveBot).html).toContain(label); + expect(find(computer(liveBot), "data-panel-page", "where").props.hint).toContain(label); + } + } finally { + setLocale("en"); + } + }); + it("saves each place through the bot patch, and sends nothing for the place already chosen", () => { const rendered = where(makeBot()); choose(rendered, "cloud"); diff --git a/src/components/ChatView.screen.test.ts b/src/components/ChatView.screen.test.ts index 15fa2194..722712c1 100644 --- a/src/components/ChatView.screen.test.ts +++ b/src/components/ChatView.screen.test.ts @@ -1,16 +1,17 @@ import { createElement } from "react"; import { renderToStaticMarkup } from "react-dom/server"; -import { afterAll, describe, expect, it, vi } from "vitest"; +import { afterAll, afterEach, describe, expect, it, vi } from "vitest"; import type { AppState, Bot, InstanceInfo, Message } from "@/state/store"; -vi.hoisted(() => { +const fixture = vi.hoisted(() => { vi.stubGlobal("window", {}); vi.stubGlobal("localStorage", { getItem: () => null, setItem: () => {} }); + return { config: null as AppState["config"] }; }); vi.mock("@/state/store", async (importOriginal) => { const original = await importOriginal(); return { ...original, useStore: () => ({ - state: { ...original.initialState, instances: [{ instanceId: "test", driverKind: "codex", displayName: "Test" } as InstanceInfo] }, + state: { ...original.initialState, config: fixture.config, instances: [{ instanceId: "test", driverKind: "codex", displayName: "Test" } as InstanceInfo] }, dispatch: vi.fn(), }) }; }); @@ -24,6 +25,7 @@ vi.mock("./ModelPicker", () => ({ ModelPicker: () => null })); const { ChatView } = await import("./ChatView"); const { initialState, reducer } = await import("@/state/store"); afterAll(() => vi.unstubAllGlobals()); +afterEach(() => { fixture.config = null; }); const IMAGE = 'src="/api/threads/t1/messages/shot/image"'; const greeting: Message = { id: "hi", role: "bot", kind: "text", text: "Hello", at: 1 }; @@ -62,3 +64,17 @@ describe("ChatView screenshot", () => { expect(markup).not.toContain("/messages/shot/image"); }); }); + + +it.each([ + ["shared", 4, "Shared computer"], + ["shared", 1, "Private desktop"], + ["per-bot", 4, "Private desktop"], +] as const)("passes the VM name to transcript tool icons for %s / %s", (mode, screens, label) => { + fixture.config = { features: { showToolCalls: true }, localVm: { mode, screens, maxInstances: 1 } } as AppState["config"]; + const markup = render({ ...bot([greeting, { + id: "tool", parentId: "hi", role: "bot", kind: "activity", at: 2, tool: { name: "screenshot", ok: true }, + }]), computer: "vm" }); + expect(markup).toContain('data-testid="tool-place"'); + expect(markup).toContain(`aria-label="${label}"`); +}); diff --git a/src/components/ChatView.tsx b/src/components/ChatView.tsx index e2efe8d3..26e2c2b8 100644 --- a/src/components/ChatView.tsx +++ b/src/components/ChatView.tsx @@ -141,6 +141,7 @@ import { isBotTextRow, joinedCorners, needsStamp, quietRow, simpleRowLayout, SIM interface ChatRows { botId: string; threadId: string; botName: string; botColor: Bot["color"]; voiceId?: string; tts: ConfigStatus["tts"]; localVoice: boolean; + localVm?: ConfigStatus["localVm"]; hasMore: boolean; bots: readonly Bot[]; mentionPeers: readonly MentionPeer[]; mentionPerson: { profileName?: string }; /** A shared workspace's viewer key: another person's line carries their name. */ @@ -246,7 +247,7 @@ function PlaceFailedRow({ place, botId, threadId, onRetry }: { const { capabilities } = useDesktopCapabilities(); const seat = usePlaceSeat(config, capabilities); const computer = useStoreSelector((state) => state.bots.find((candidate) => candidate.id === botId)?.computer); - const view = placeRowViewFor(place, seat, worksOnSimpleLabel(computer, capabilities.host.platform)); + const view = placeRowViewFor(place, seat, worksOnSimpleLabel(computer, capabilities.host.platform, config)); const id = view.action?.id; const onClick = !id ? undefined : id === "try-again" ? onRetry @@ -615,13 +616,13 @@ function PeerLabel({ peer }: { peer: PeerLine }) { } const ActivityChip = memo(function ActivityChip({ message, place = "auto" }: { message: Message; place?: EffectivePlace }) { - const { bots, dispatch, threadId } = useChatRows(), liveTools = use(LiveToolsContext); + const { bots, dispatch, threadId, localVm } = useChatRows(), liveTools = use(LiveToolsContext); const tool = message.tool; if (!tool) return null; if (message.threadRef) return ; if (message.relay) return ; const comm = message.comm; if (comm) return ; - return ; + return ; }); const RoomHandoffChip = ({ message, comm, bots, dispatch }: { message: Message; comm: NonNullable; bots: readonly Bot[]; dispatch: Dispatch }) => { const store = useStoreRef(); return openRoomThread(dispatch, comm, store.state().groups)} />; }; @@ -898,8 +899,8 @@ export const ChatView = memo(function ChatView({ bot: profile }: { bot: Bot }) { const profileName = useSessionDisplayName() ?? state.config?.profile?.name; const speakerViewer = reactor !== "user" ? reactor : null; const rows = useMemo( - () => ({ botId: bot.id, threadId: bot.threadId, botName: bot.name, botColor: bot.color, voiceId: bot.voice, tts, localVoice, hasMore, bots, mentionPeers, mentionPerson: { profileName }, focus, showToolCalls, locale, dispatch, onBranch, bubbleStyle, conversational: isConversational(bot.replyStyle), simple: !advanced, canReact: canWrite !== false, openedAt, speakerViewer }), - [bot.id, bot.threadId, bot.name, bot.color, bot.voice, tts, localVoice, hasMore, bots, mentionPeers, profileName, focus, showToolCalls, locale, dispatch, onBranch, bubbleStyle, bot.replyStyle, advanced, canWrite, openedAt, speakerViewer], + () => ({ botId: bot.id, threadId: bot.threadId, botName: bot.name, botColor: bot.color, voiceId: bot.voice, tts, localVoice, localVm: state.config?.localVm, hasMore, bots, mentionPeers, mentionPerson: { profileName }, focus, showToolCalls, locale, dispatch, onBranch, bubbleStyle, conversational: isConversational(bot.replyStyle), simple: !advanced, canReact: canWrite !== false, openedAt, speakerViewer }), + [bot.id, bot.threadId, bot.name, bot.color, bot.voice, tts, localVoice, state.config?.localVm, hasMore, bots, mentionPeers, profileName, focus, showToolCalls, locale, dispatch, onBranch, bubbleStyle, bot.replyStyle, advanced, canWrite, openedAt, speakerViewer], ); const currentTask = bot.tasks?.find((task) => task.threadId === bot.threadId), place = effectivePlace(bot, currentTask), team = state.config?.team, privateChat = Boolean(team) && (currentTask?.private === true || (ownChatStarted(bot.threadId) && !currentTask?.shared)), ownHelper = Boolean(team) && !privateChat && Boolean(bot.defaultBot?.person), sharedChat = Boolean(team) && !privateChat && !ownHelper; diff --git a/src/components/ComputerPanel.tsx b/src/components/ComputerPanel.tsx index fcadacfd..5b057745 100644 --- a/src/components/ComputerPanel.tsx +++ b/src/components/ComputerPanel.tsx @@ -1676,7 +1676,7 @@ export function ComputerPanel({ {livePin && (

- {t("place.pinnedNote", { place: t(placeLabelKey(livePin)) })} + {t("place.pinnedNote", { place: t(placeLabelKey(livePin, state.config)) })}

)}
@@ -1734,7 +1734,7 @@ export function ComputerPanel({

{t("place.pinnedNoteSimple", { - place: placeOptions.find(({ mode }) => mode === heldPin)?.simpleLabel ?? t(placeLabelKey(heldPin)), + place: placeOptions.find(({ mode }) => mode === heldPin)?.simpleLabel ?? t(placeLabelKey(heldPin, state.config)), })}

diff --git a/src/components/FailedTurnRow.place.test.ts b/src/components/FailedTurnRow.place.test.ts index a9facccf..808106b6 100644 --- a/src/components/FailedTurnRow.place.test.ts +++ b/src/components/FailedTurnRow.place.test.ts @@ -88,6 +88,17 @@ describe("J11: a failed place's row", () => { expect(show(pinned).buttons[0]).toContain("Clear this conversation's place"); }); + it.each([ + ["shared", 4, "Shared computer"], + ["shared", 1, "Private desktop"], + ["per-bot", 4, "Private desktop"], + ] as const)("names the bot's VM in the pin recovery action for %s / %s", (mode, screens, label) => { + fixture.config = { localVm: { mode, screens, maxInstances: 1 } }; + fixture.bots[0]!.computer = "vm"; + const pinned = stored({ state: "cc-no-start", params: { bot: "Scout" }, source: "pin" }); + expect(show(pinned).buttons[0]).toContain(`Use ${label}`); + }); + it("gives a User no button that changes a setting, and says who can", () => { fixture.ownerOrAdmin = false; const { html, buttons } = show(stored(hours), vi.fn()); diff --git a/src/components/PlaceChip.test.ts b/src/components/PlaceChip.test.ts index 20b166bf..e090dc7f 100644 --- a/src/components/PlaceChip.test.ts +++ b/src/components/PlaceChip.test.ts @@ -1,6 +1,7 @@ import { createElement, type ComponentProps } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { afterAll, afterEach, describe, expect, it, vi } from "vitest"; +import { setLocale, t } from "@/lib/i18n"; import type { Bot, InstanceInfo } from "@/state/store"; vi.stubGlobal("window", {}); @@ -253,3 +254,34 @@ it.each([ const choice = worksOnChoices({ localVm: { mode, screens, maxInstances: 1 } }, {} as DesktopCapabilities).find(([place]) => place === "vm")!; expect(t(choice[2])).toBe(description); }); + + +describe("VM names in desktop and phone place menus", () => { + afterEach(() => { fixture.config = null; fixture.menuOpen = false; setLocale("en"); }); + + it.each([ + ["shared", 4, true], + ["shared", 1, false], + ["shared", undefined, false], + ["per-bot", 4, false], + ] as const)("uses the configured name for %s / %s screens", (mode, screens, shared) => { + fixture.config = { localVm: { mode, screens, maxInstances: 1 } }; + fixture.menuOpen = true; + const vmBot = { ...bot, computer: "vm" as const }; + for (const locale of ["en", "zh"] as const) { + setLocale(locale); + const label = locale === "zh" ? shared ? "共用电脑" : "私有桌面" : shared ? "Shared computer" : "Private desktop"; + const html = renderToStaticMarkup(createElement(PlaceChip, { bot: vmBot, live: false, onPin: vi.fn() })); + expect(html).toContain(`aria-label="${t("place.chipAria", { place: label })}"`); + expect(html).toContain(t("place.followBotDetail", { place: label })); + expect(html.split('role="menuitemradio"').slice(2).some(row => row.includes(`>${label}`))).toBe(true); + if (shared) expect(html).not.toMatch(/私有桌面|Private desktop/); + let item: ReturnType | undefined; + function Menu() { item = usePlaceMenuItem({ bot: vmBot, onPin: vi.fn() }); return null; } + renderToStaticMarkup(createElement(Menu)); + expect(item!.subtitle).toBe(label); + expect(item!.submenu!.find(row => row.key === "place:vm")!.label).toBe(label); + expect(item!.submenu!.find(row => row.key === "place:follow")!.note).toBe(t("place.followBotDetail", { place: label })); + } + }); +}); diff --git a/src/components/PlaceChip.tsx b/src/components/PlaceChip.tsx index 99c93c01..c5b26985 100644 --- a/src/components/PlaceChip.tsx +++ b/src/components/PlaceChip.tsx @@ -63,7 +63,7 @@ export function usePlaceMenuItem({ bot, task, disabled = false, onPin }: { return { key: "place", label: t("computer.worksOn"), - subtitle: t(placeLabelKey(effective)), + subtitle: t(placeLabelKey(effective, state.config)), icon:
- {t("vm.perBot.destination", { destination: t(destinationLabelKeys[instance.destination]) })} + {t("vm.perBot.destination", { destination: t(destinationLabelKey(instance.destination, destinationConfig)) })}
{!managed && (
@@ -1314,6 +1325,7 @@ export function LocalComputerSection({ privateOnly = false }: { privateOnly?: bo unavailableReason={inventoryUnavailableReason} onRefresh={() => setInventoryRefreshKey((key) => key + 1)} onDelete={(instance) => void deletePerBotVm(instance)} + config={config} /> )} From d6b69fe4a4b6a487d198886a07e581da5ee6ce74 Mon Sep 17 00:00:00 2001 From: tangzhixiong613-jpg <340458552+tangzhixiong613-jpg@users.noreply.github.com> Date: Sun, 15 Nov 2026 18:05:28 +0000 Subject: [PATCH 4/4] =?UTF-8?q?T-1266=20ChatView.tsx=20=E5=9B=9E=E5=88=B0?= =?UTF-8?q?=E6=A3=98=E8=BD=AE=E4=B8=8A=E9=99=90=201293=20=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- src/components/ChatView.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/ChatView.tsx b/src/components/ChatView.tsx index 26e2c2b8..04de7ae3 100644 --- a/src/components/ChatView.tsx +++ b/src/components/ChatView.tsx @@ -140,8 +140,7 @@ import { isBotTextRow, joinedCorners, needsStamp, quietRow, simpleRowLayout, SIM interface ChatRows { botId: string; threadId: string; botName: string; botColor: Bot["color"]; voiceId?: string; - tts: ConfigStatus["tts"]; localVoice: boolean; - localVm?: ConfigStatus["localVm"]; + tts: ConfigStatus["tts"]; localVoice: boolean; localVm?: ConfigStatus["localVm"]; hasMore: boolean; bots: readonly Bot[]; mentionPeers: readonly MentionPeer[]; mentionPerson: { profileName?: string }; /** A shared workspace's viewer key: another person's line carries their name. */