Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/pull/17172

Vanessa288e595467ed
diff --git a/app/src/dialog/tooltip.ts b/app/src/dialog/tooltip.ts
index d42cd7c8a4..707aa28ce3 100644
--- a/app/src/dialog/tooltip.ts
+++ b/app/src/dialog/tooltip.ts
@@ -77,6 +77,17 @@ export const showTooltip = (
if (left < 0) {
left = targetRect.right;
}
+ } else if (position?.endsWith("east")) {
+ // east: 布局菜单
+ const positionDiff = parseInt(position) || space;
+ top = Math.max(0, targetRect.top - (messageElement.clientHeight - targetRect.height) / 2);
+ if (top > window.innerHeight - messageElement.clientHeight) {
+ top = window.innerHeight - messageElement.clientHeight;
+ }
+ left = targetRect.right + positionDiff;
+ if (left + messageElement.clientWidth > window.innerWidth) {
+ left = targetRect.left - messageElement.clientWidth - positionDiff;
+ }
} else if (position?.endsWith("north")) {
// north: av 视图,列,多选描述, protyle-icon
const positionDiff = parseInt(position) || space;
diff --git a/app/src/menus/workspace.ts b/app/src/menus/workspace.ts
index 64f9f6d829..d7bc64dd30 100644
--- a/app/src/menus/workspace.ts
+++ b/app/src/menus/workspace.ts
@@ -24,7 +24,7 @@ import {exitSiYuan, lockScreen} from "../dialog/processSystem";
import {showMessage} from "../dialog/message";
import {unicode2Emoji} from "../emoji";
import {Dock} from "../layout/dock";
-import {escapeHtml} from "../util/escape";
+import {escapeAttr, escapeHtml} from "../util/escape";
import {viewCards} from "../card/viewCards";
import {Dialog} from "../dialog";
import {hasClosestByClassName} from "../protyle/util/hasClosest";
@@ -349,7 +349,7 @@ export const workspaceMenu = (app: App, rect: DOMRect) => {
iconHTML: "",
type: "empty",
label: `<input class="b3-text-field fn__block" style="margin: 4px 0" placeholder="${window.siyuan.languages.search}">
-<div class="b3-list b3-list--background" style="width: 260px"></div>`,
+<div class="b3-list b3-list--background" style="width: 220px"></div>`,
bind(menuElement) {
const genListHTML = (isInit = false) => {
let html = "";
@@ -357,7 +357,7 @@ export const workspaceMenu = (app: App, rect: DOMRect) => {
return a.name.localeCompare(b.name, undefined, {numeric: true});
}).forEach((item: ISaveLayout) => {
if (inputElement.value === "" || item.name.toLowerCase().indexOf(inputElement.value.toLowerCase()) > -1) {
- html += `<div data-name="${item.name}" class="b3-list-item b3-list-item--narrow b3-list-item--hide-action ${!isInit && !html ? "b3-list-item--focus" : ""}">
+ html += `<div data-name="${item.name}" class="b3-list-item b3-list-item--narrow b3-list-item--hide-action${!isInit && !html ? " b3-list-item--focus" : ""} ariaLabel" data-position="8east" aria-label="${escapeAttr(item.name)}" >
<div class="b3-list-item__text">${item.name}</div>
<span class="b3-list-item__meta">${item.time ? dayjs(item.time).format("YYYY-MM-DD HH:mm") : ""}</span>
<span class="b3-list-item__action">