refactor: update comments for clarity and consistency across multiple files

This commit is contained in:
HouYunFei
2026-08-05 14:17:03 +08:00
parent 0f6809251a
commit 5a7116f924
43 changed files with 218 additions and 223 deletions
+4 -4
View File
@@ -8,11 +8,11 @@ export type InstalledPlugin = {
name: string;
version: string;
description?: string;
url: string; // 安装来源,可用于更新
source: string; // 缓存的插件源码,离线可用、版本固定
url: string; // Installation source used for updates.
source: string; // Cached plugin source for offline use and pinned versions.
enabled: boolean;
local?: boolean; // 自动发现于 web/public/plugins 的本地插件(默认关闭,启用时按 url 重新拉取)
official?: boolean; // 从官方注册表安装(用于在管理器里归类)
local?: boolean; // Local plugin discovered in web/public/plugins; disabled by default and refetched from its URL when enabled.
official?: boolean; // Installed from the official registry and grouped accordingly in the manager.
installedAt: string;
};
+1 -1
View File
@@ -149,7 +149,7 @@ export const useAgentStore = create<AgentStore>((set, get) => ({
}
localStorage.setItem("canvas-agent-url", endpoint);
localStorage.setItem("canvas-agent-token", token);
// 只设 enabled=true,由 LocalAgentPanel 的 useEffect 统一负责开 SSE
// Only set enabled here; LocalAgentPanel's effect owns SSE initialization.
set({ url: endpoint, token, enabled: true, silentConnect: silent, activity: i18n.t("agent.status.connecting"), connectError: "" });
},
disconnectAgent: (patch = {}) => {
+3 -3
View File
@@ -1,8 +1,8 @@
import { create } from "zustand";
// Agent 面板通过该 store 向生图/视频工作台派发命令:设置提示词、并可选自动点击生成。
// 参数(模型/质量/尺寸/张数等)由 Agent 面板直接写入 use-config-store,工作台页面从 config 读取;
// prompt 与 run 通过这里下发,页面用 nonce 判断是否为新命令,消费后调用 clear 清空。
// The Agent panel dispatches commands through this store to set workbench prompts and optionally start generation.
// The panel writes model, quality, size, count, and other options to use-config-store, which workbench pages read directly.
// Prompt and run are sent here; pages identify new commands by nonce and call clear after consuming them.
export type WorkbenchCommand = {
nonce: number;