An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: https://github.com/siyuan-note/siyuan/issues/15389
Vanessaa105227e6561
diff --git a/app/src/assets/scss/business/_av.scss b/app/src/assets/scss/business/_av.scssindex 9a2cf6c66d..8ddc387410 100644--- a/app/src/assets/scss/business/_av.scss+++ b/app/src/assets/scss/business/_av.scss@@ -35,7 +35,7 @@&__pulse {width: 70%;- height: 23px;+ height: 22px;display: block;position: relative;overflow: hidden;diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.tsindex 63c2405f33..914e46c84d 100644--- a/app/src/protyle/render/av/action.ts+++ b/app/src/protyle/render/av/action.ts@@ -825,6 +825,12 @@ export const updateAttrViewCellAnimation = (cellElement: HTMLElement, value: IAVconst viewType = blockElement.getAttribute("data-av-type") as TAVView;const iconElement = cellElement.querySelector(".b3-menu__avemoji");if (viewType === "gallery") {+ if (value.type === "checkbox") {+ value.checkbox = {+ checked: value.checkbox?.checked || false,+ content: cellElement.getAttribute("aria-label"),+ };+ }cellElement.innerHTML = renderCell(value, 0, iconElement ? !iconElement.classList.contains("fn__none") : false, viewType) +cellElement.querySelector(".av__gallery-tip").outerHTML;cellElement.setAttribute("data-empty", cellValueIsEmpty(value).toString());diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.tsindex 023045ecba..9aac7afc30 100644--- a/app/src/protyle/render/av/cell.ts+++ b/app/src/protyle/render/av/cell.ts@@ -977,8 +977,8 @@ export const renderCell = (cellValue: IAVCellValue, rowIndex = 0, showIcon = tru});} else if (cellValue.type === "checkbox") {text += `<div class="fn__flex"><svg class="av__checkbox"><use xlink:href="#icon${cellValue?.checkbox?.checked ? "Check" : "Uncheck"}"></use></svg>`;- if (type === "gallery") {- text += `<span class="fn__space"></span>${window.siyuan.languages.checkbox}`;+ if (type === "gallery" && cellValue?.checkbox?.content) {+ text += `<span class="fn__space"></span>${cellValue?.checkbox?.content}`;}text += "</div>";} else if (cellValue.type === "rollup") {diff --git a/app/src/protyle/render/av/gallery/item.ts b/app/src/protyle/render/av/gallery/item.tsindex c5d06fbf0f..17fd7f4c55 100644--- a/app/src/protyle/render/av/gallery/item.ts+++ b/app/src/protyle/render/av/gallery/item.ts@@ -25,14 +25,18 @@ export const insertGalleryItemAnimation = (options: {let html = "";let needUpdate = "";if (options.blockElement.querySelector('.av__views [data-type="av-sort"]').classList.contains("block__icon--active") &&- !options.blockElement.querySelector(groupQuery+'[data-type="av-load-more"]').classList.contains("fn__none")) {+ !options.blockElement.querySelector(groupQuery + '[data-type="av-load-more"]').classList.contains("fn__none")) {needUpdate = ' data-need-update="true"';}const coverClass = sideItemElement?.querySelector(".av__gallery-cover")?.className || "fn__none";+ let cellsHTML = "";+ sideItemElement.querySelectorAll(".av__cell").forEach((item:HTMLElement) => {+ cellsHTML += `<div class="av__cell" aria-label="${item.getAttribute("aria-label")}" data-field-id="${item.dataset.fieldId}"><span class="av__pulse"></span>${item.querySelector(".av__gallery-tip").outerHTML}</div>`;+ });options.srcIDs.forEach((id) => {html += `<div class="av__gallery-item"${needUpdate} data-type="ghost" data-id="${id}"><div class="${coverClass}"><span style="width: 100%;height: 100%;border-radius: var(--b3-border-radius) var(--b3-border-radius) 0 0;" class="av__pulse"></span></div>- <div class="av__gallery-fields"><span class="av__pulse"></span></div>+ <div class="av__gallery-fields">${cellsHTML}</div></div>`;});if (options.previousId && sideItemElement) {@@ -119,13 +123,17 @@ export const insertGalleryItemAnimation = (options: {break;}}- if (sideItemElement.classList.contains("av__row") && isRenderValue) {+ if (sideItemElement.classList.contains("av__gallery-item") && isRenderValue) {const sideItemCellElement = sideItemElement.querySelector(`.av__cell[data-field-id="${item.column}"]`) as HTMLElement;const cellElement = currentItemElement.querySelector(`.av__cell[data-field-id="${item.column}"]`);const cellValue = genCellValueByElement(getTypeByCellElement(sideItemCellElement), sideItemCellElement);const iconElement = cellElement.querySelector(".b3-menu__avemoji");+ if (cellValue.type === "checkbox") {+ cellValue.checkbox.content = cellElement.getAttribute("aria-label");+ }cellElement.innerHTML = renderCell(cellValue, undefined,- iconElement ? !iconElement.classList.contains("fn__none") : false, "gallery");+ iconElement ? !iconElement.classList.contains("fn__none") : false, "gallery") ++ cellElement.querySelector(".av__gallery-tip").outerHTML;renderCellAttr(cellElement, cellValue);}});diff --git a/app/src/protyle/render/av/gallery/render.ts b/app/src/protyle/render/av/gallery/render.tsindex 3b272fe159..f2cabf5f94 100644--- a/app/src/protyle/render/av/gallery/render.ts+++ b/app/src/protyle/render/av/gallery/render.ts@@ -62,6 +62,9 @@ const getGalleryHTML = (data: IAVGallery, selectItemIds: string[], editIds: striif (data.fields[fieldsIndex].desc) {ariaLabel += escapeAttr(`<div class="ft__on-surface">${data.fields[fieldsIndex].desc}</div>`);}+ if (cell.valueType === "checkbox") {+ cell.value["checkbox"].content = data.fields[fieldsIndex].name||getColNameByType(data.fields[fieldsIndex].type)+ }galleryHTML += `<div class="av__cell${checkClass} ariaLabel" data-wrap="${data.fields[fieldsIndex].wrap}"data-empty="${isEmpty}"aria-label="${ariaLabel}"diff --git a/app/src/protyle/render/av/row.ts b/app/src/protyle/render/av/row.tsindex c196537133..c77c1ae852 100644--- a/app/src/protyle/render/av/row.ts+++ b/app/src/protyle/render/av/row.ts@@ -128,7 +128,7 @@ export const insertAttrViewBlockAnimation = (options: {let previousElement = options.blockElement.querySelector(`.av__row[data-id="${options.previousId}"]`) || options.blockElement.querySelector(groupQuery + ".av__row--header");// 有排序需要加入最后一行if (options.blockElement.querySelector('.av__views [data-type="av-sort"]').classList.contains("block__icon--active")) {- previousElement = options.blockElement.querySelector("groupQuery + .av__row--util").previousElementSibling;+ previousElement = options.blockElement.querySelector(groupQuery + ".av__row--util").previousElementSibling;}let colHTML = '<div class="av__colsticky"><div class="av__firstcol"><svg><use xlink:href="#iconUncheck"></use></svg></div></div>';const pinIndex = previousElement.querySelectorAll(".av__colsticky .av__cell").length - 1;diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.tsindex fdaaed48f4..fac4dfc6ed 100644--- a/app/src/types/index.d.ts+++ b/app/src/types/index.d.ts@@ -995,7 +995,8 @@ interface IAVCellValue {content: string},checkbox?: {- checked: boolean+ checked: boolean,+ content?: string, // gallery 中显示 https://github.com/siyuan-note/siyuan/issues/15389}relation?: IAVCellRelationValuerollup?: {