docs: 全面更新文档、注释及工具说明

1. 汉化 panel/index.js 代码注释。
2. 更新 README/DEVELOPMENT/UPDATE_LOG,明确 apply_text_edits 和 execute_menu_item 的最佳实践。
3. 移除 execute_menu_item 中的不稳定映射。
4. 优化 main.js 工具定义 schema。
This commit is contained in:
火焰库拉
2026-02-10 23:20:56 +08:00
parent 0997a3d98c
commit e0037c125a
5 changed files with 43 additions and 21 deletions

View File

@@ -17,7 +17,7 @@ Editor.Panel.extend({
ready() {
const root = this.shadowRoot;
// 获取元素
// 获取 DOM 元素
const els = {
port: root.querySelector("#portInput"),
btnToggle: root.querySelector("#btnToggle"),
@@ -52,7 +52,7 @@ Editor.Panel.extend({
}
});
// Initialize IPC UI
// 初始化 IPC UI
new IpcUi(root);
// 2. 标签切换
@@ -104,7 +104,8 @@ Editor.Panel.extend({
els.result.value = "";
});
els.testBtn.addEventListener("confirm", () => this.runTest(els));
// 添加探查功能
els.testBtn.addEventListener("confirm", () => this.runTest(els));
// 添加 API 探查功能
const probeBtn = root.querySelector("#probeApisBtn");
if (probeBtn) {
probeBtn.addEventListener("confirm", () => {
@@ -153,7 +154,7 @@ Editor.Panel.extend({
};
els.toolsList.appendChild(item);
});
// 保存工具信息到实例,以便后续使用
// 保存工具映射表,以便后续检索
this.toolsMap = toolsMap;
els.result.value = `Loaded ${data.tools.length} tools.`;
})