An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:lipstick: Use the standard relation menu action icon https://github.com/siyuan-note/siyuan/issues/19904
Danielec1991eaf29b
diff --git a/app/src/protyle/render/av/relation.ts b/app/src/protyle/render/av/relation.tsindex e97ab5398b..075ab4e55f 100644--- a/app/src/protyle/render/av/relation.ts+++ b/app/src/protyle/render/av/relation.ts@@ -904,7 +904,7 @@ export const getRelationHTML = (data: IAV, cellElements?: HTMLElement[]) => {<span class="fn__space"></span><span style="color: var(--b3-protyle-inline-blockref-color);max-width: 200px" data-id="" class="popover__block fn__pointer fn__ellipsis"></span><span class="fn__space"></span>- <button type="button" class="block__icon block__icon--show ariaLabel" data-type="relationFields" data-position="north" aria-haspopup="menu" aria-expanded="false" aria-label="${window.siyuan.languages.fields}"><svg><use xlink:href="#iconMore"></use></svg></button>+ <svg class="b3-menu__action b3-menu__action--show ariaLabel" data-type="relationFields" data-position="north" role="button" tabindex="0" aria-haspopup="menu" aria-expanded="false" aria-label="${window.siyuan.languages.more}"><use xlink:href="#iconMore"></use></svg></div></div><div class="b3-menu__items av__relation-table">diff --git a/app/src/protyle/render/av/relationLayout.ts b/app/src/protyle/render/av/relationLayout.tsindex f63e556611..d959e8baa7 100644--- a/app/src/protyle/render/av/relationLayout.ts+++ b/app/src/protyle/render/av/relationLayout.ts@@ -16,7 +16,7 @@ export const bindRelationLayout = (root: HTMLElement, databaseID: string, onResiconst layout: IRelationLayout = {hidden: [...(saved?.hidden || [])], widths: {...saved?.widths}};const fields = document.createElement("div");fields.className = "av__relation-fields";- const button = root.querySelector<HTMLButtonElement>('[data-type="relationFields"]');+ const button = root.querySelector<HTMLElement>('[data-type="relationFields"]');let menu: Menu;const positionMenu = () => {const rect = button.getBoundingClientRect();@@ -75,15 +75,20 @@ export const bindRelationLayout = (root: HTMLElement, databaseID: string, onResifields.remove();menu = undefined;button.setAttribute("aria-expanded", "false");- button.classList.remove("block__icon--active");});menu.element.style.width = "280px";menu.element.lastElementChild.appendChild(fields);button.setAttribute("aria-expanded", "true");- button.classList.add("block__icon--active");renderFields();positionMenu();});+ button.addEventListener("keydown", event => {+ if (event.key === "Enter" || event.key === " ") {+ event.preventDefault();+ event.stopPropagation();+ button.dispatchEvent(new MouseEvent("click", {bubbles: true}));+ }+ });fields.addEventListener("click", event => {event.stopPropagation();const target = (event.target as HTMLElement).closest<HTMLElement>("[data-column], [data-all]");