From 4266ac9bba67fe386b18bd8fc0c82782729a2a84 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 10 Jun 2026 14:00:05 +0800 Subject: [PATCH] :rotating_light: --- app/src/layout/dock/AgentChat.ts | 2 +- app/src/layout/dock/AgentMessageRenderer.ts | 2 +- app/src/menus/protyle.ts | 8 -------- app/src/protyle/wysiwyg/index.ts | 2 -- app/src/protyle/wysiwyg/keydown.ts | 1 - app/src/util/agentSSE.ts | 1 - 6 files changed, 2 insertions(+), 14 deletions(-) diff --git a/app/src/layout/dock/AgentChat.ts b/app/src/layout/dock/AgentChat.ts index 82d84c37b..c66e70400 100644 --- a/app/src/layout/dock/AgentChat.ts +++ b/app/src/layout/dock/AgentChat.ts @@ -1361,7 +1361,7 @@ export class AgentChat extends Model { if (step.toolCalls.length > 0) { const newTools = step.toolCalls.filter(tc => !seenTools[tc.name]); if (newTools.length > 0) { - detail += `
Tool calls:`; + detail += "
Tool calls:"; for (let j = 0; j < newTools.length; j++) { const tc = newTools[j]; seenTools[tc.name] = true; diff --git a/app/src/layout/dock/AgentMessageRenderer.ts b/app/src/layout/dock/AgentMessageRenderer.ts index 31c32b3f9..6acf31c34 100644 --- a/app/src/layout/dock/AgentMessageRenderer.ts +++ b/app/src/layout/dock/AgentMessageRenderer.ts @@ -96,7 +96,7 @@ export const renderRetryCardHTML = (attempt: number, maxRetries: number): string }; export const renderToolsLineHTML = (newTools: Array<{name: string; result?: string}>): string => { - let detailLines = `
Tool calls:`; + let detailLines = "
Tool calls:"; for (let i = 0; i < newTools.length; i++) { detailLines += '' + escapeHtml(newTools[i].name) + ""; } diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts index 4610e9c12..0287738aa 100644 --- a/app/src/menus/protyle.ts +++ b/app/src/menus/protyle.ts @@ -211,7 +211,6 @@ export const fileAnnotationRefMenu = (protyle: IProtyle, refElement: HTMLElement return; } hideElements(["util", "toolbar", "hint"], protyle); - const id = nodeElement.getAttribute("data-node-id"); let oldHTML = nodeElement.outerHTML; window.siyuan.menus.menu.remove(); window.siyuan.menus.menu.element.setAttribute("data-name", Constants.MENU_INLINE_FILE_ANNOTATION_REF); @@ -714,7 +713,6 @@ export const contentMenu = (protyle: IProtyle, nodeElement: Element) => { protyle.toolbar.showContent(protyle, range, nodeElement); /// #else const oldHTML = nodeElement.outerHTML; - const id = nodeElement.getAttribute("data-node-id"); const captionElement = hasClosestByTag(range.startContainer, "CAPTION"); if (range.toString() !== "" || (range.cloneContents().childNodes[0] as HTMLElement)?.classList?.contains("emoji")) { window.siyuan.menus.menu.append(new MenuItem({ @@ -786,7 +784,6 @@ export const contentMenu = (protyle: IProtyle, nodeElement: Element) => { } }).element); if (!protyle.disabled) { - const id = nodeElement.getAttribute("data-node-id"); window.siyuan.menus.menu.append(new MenuItem({ id: "cut", icon: "iconCut", @@ -1481,7 +1478,6 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText } hideTooltip(); hideElements(["util", "toolbar", "hint"], protyle); - const id = nodeElement.getAttribute("data-node-id"); let html = nodeElement.outerHTML; const linkAddress = linkElement.getAttribute("data-href"); let inputElements: NodeListOf; @@ -1769,7 +1765,6 @@ export const tagMenu = (protyle: IProtyle, tagElement: HTMLElement) => { return; } hideElements(["util", "toolbar", "hint"], protyle); - const id = nodeElement.getAttribute("data-node-id"); let inputElement: HTMLInputElement; const oldHTML = nodeElement.outerHTML; window.siyuan.menus.menu.removeCB = () => { @@ -1957,7 +1952,6 @@ export const inlineMathMenu = (protyle: IProtyle, element: Element) => { if (!nodeElement) { return; } - const id = nodeElement.getAttribute("data-node-id"); const html = nodeElement.outerHTML; window.siyuan.menus.menu.append(new MenuItem({ id: "copy", @@ -2036,7 +2030,6 @@ const genImageHeightMenu = (label: string, imgElement: HTMLElement, protyle: IPr }; export const iframeMenu = (protyle: IProtyle, nodeElement: Element) => { - const id = nodeElement.getAttribute("data-node-id"); const iframeElement = nodeElement.querySelector("iframe"); let html = nodeElement.outerHTML; const subMenus: IMenu[] = [{ @@ -2107,7 +2100,6 @@ export const iframeMenu = (protyle: IProtyle, nodeElement: Element) => { }; export const videoMenu = (protyle: IProtyle, nodeElement: Element, type: string) => { - const id = nodeElement.getAttribute("data-node-id"); const videoElement = nodeElement.querySelector(type === "NodeVideo" ? "video" : "audio"); let html = nodeElement.outerHTML; const subMenus: IMenu[] = [{ diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 048d8476a..570abd0fa 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -964,7 +964,6 @@ export class WYSIWYG { target.parentElement.parentElement.classList.add("img--drag"); } - const id = nodeElement.getAttribute("data-node-id"); const html = nodeElement.outerHTML; const x = event.clientX; const dragElement = target.previousElementSibling as HTMLElement; @@ -1054,7 +1053,6 @@ export class WYSIWYG { nodeElement.firstElementChild.style.webkitUserModify = "read-only"; nodeElement.style.cursor = "col-resize"; target.removeAttribute("style"); - const id = nodeElement.getAttribute("data-node-id"); const x = event.clientX; const colIndex = parseInt(target.getAttribute("data-col-index")); const colElement = nodeElement.querySelectorAll("table col")[colIndex] as HTMLElement; diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index 68031429a..dc57e1c28 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -1498,7 +1498,6 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { !isInEmbedBlock(nodeElement)) { const editElement = getContenteditableElement(nodeElement); if (editElement) { - const id = nodeElement.getAttribute("data-node-id"); const html = nodeElement.outerHTML; // 需要 EscapeHTMLStr https://github.com/siyuan-note/siyuan/issues/11451 editElement.innerHTML = "```" + window.siyuan.storage[Constants.LOCAL_CODELANG] + "\n" + Lute.EscapeHTMLStr(editElement.textContent) + "\n```"; diff --git a/app/src/util/agentSSE.ts b/app/src/util/agentSSE.ts index 230cfa9a1..e21c693ed 100644 --- a/app/src/util/agentSSE.ts +++ b/app/src/util/agentSSE.ts @@ -62,7 +62,6 @@ export async function fetchAgentSSE( }); if (!response.ok) { - const text = await response.text(); onError(new Error(window.siyuan.languages._kernel[28])); return; }