Skip to content

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

:bug: Show tooltips for tab titles and task controls https://github.com/siyuan-note/siyuan/issues/17642

Daniela9ef96369e4b
diff --git a/app/src/protyle/render/tabsRender.ts b/app/src/protyle/render/tabsRender.ts
index 095095a98d..eba70be99a 100644
--- a/app/src/protyle/render/tabsRender.ts
+++ b/app/src/protyle/render/tabsRender.ts
@@ -210,7 +210,7 @@ export const tabsRender = (element: Element, options: ITabsRenderOptions = {}) =
items.forEach((item, index) => {
const button = document.createElement("button");
button.type = "button";
- button.className = "tabs-tab";
+ button.className = "tabs-tab ariaLabel";
button.setAttribute("role", "tab");
button.dataset.tabId = itemID(item);
button.id = `${state.instance}-tab-${index}`;
@@ -238,7 +238,8 @@ export const tabsRender = (element: Element, options: ITabsRenderOptions = {}) =
const marker = item.getAttribute("tabs-task");
if (marker !== null) {
const task = document.createElement("span");
- task.className = "tabs-task";
+ task.className = "tabs-task ariaLabel";
+ task.setAttribute("data-position", "north");
task.dataset.tabId = itemID(item);
task.setAttribute("role", "checkbox");
task.setAttribute("aria-label", controller.options.taskLabel || "Task");
@@ -407,9 +408,6 @@ export const tabsRender = (element: Element, options: ITabsRenderOptions = {}) =
`${Math.max(0, rect.bottom - listRect.bottom) * scale}px ` +
`${Math.max(0, listRect.left - rect.left) * scale}px)`;
});
- list.querySelectorAll<HTMLElement>(".tabs-tab-label").forEach(label => {
- label.parentElement.classList.toggle("ariaLabel", label.scrollWidth > label.clientWidth);
- });
controller.resize.observe(tabs);
if (!tabs.closest('.tab-item[data-tabs-hidden="true"]') && state.renderedActive !== state.active) {
state.renderedActive = state.active;