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/issues/12948

Vanessab86439d5895e
diff --git a/app/src/history/doc.ts b/app/src/history/doc.ts
index 108471a859..a985f6eab9 100644
--- a/app/src/history/doc.ts
+++ b/app/src/history/doc.ts
@@ -66,8 +66,11 @@ export const openDocHistory = (options: {
<li class="b3-list--empty">${window.siyuan.languages.emptyContent}</li>
</ul>
<div class="history__resize"></div>
- <textarea class="fn__flex-1 history__text fn__none" readonly data-type="mdPanel"></textarea>
- <div class="fn__flex-1 history__text fn__none" style="padding: 0" data-type="docPanel"></div>
+ <div class="fn__flex-1 fn__flex-column">
+ <div class="protyle-title__input ft__center"></div>
+ <textarea class="fn__flex-1 history__text fn__none" readonly data-type="mdPanel"></textarea>
+ <div class="fn__flex-1 history__text fn__none" style="padding: 0" data-type="docPanel"></div>
+ </div>
</div>`;
const dialog = new Dialog({
title:`<div class="block__icons">
@@ -165,6 +168,7 @@ export const openDocHistory = (options: {
action: [Constants.CB_GET_HISTORY, Constants.CB_GET_HTML],
});
}
+ dialog.element.querySelector('.protyle-title__input').textContent = item.title;
isLoading = false;
});
target.parentElement.querySelector(".b3-list-item--focus")?.classList.remove("b3-list-item--focus");
diff --git a/app/src/history/history.ts b/app/src/history/history.ts
index 9769f2ff68..7d39aadc50 100644
--- a/app/src/history/history.ts
+++ b/app/src/history/history.ts
@@ -397,9 +397,12 @@ export const openHistory = (app: App) => {
<li class="b3-list--empty">${window.siyuan.languages.emptyContent}</li>
</ul>
<div class="history__resize"></div>
- <div class="fn__flex-1 history__text fn__none" data-type="assetPanel"></div>
- <textarea class="fn__flex-1 history__text fn__none" data-type="mdPanel"></textarea>
- <div class="fn__flex-1 history__text fn__none" style="padding: 0" data-type="docPanel"></div>
+ <div class="fn__flex-column fn__flex-1">
+ <div class="protyle-title__input ft__center"></div>
+ <div class="fn__flex-1 history__text fn__none" data-type="assetPanel"></div>
+ <textarea class="fn__flex-1 history__text fn__none" data-type="mdPanel"></textarea>
+ <div class="fn__flex-1 history__text fn__none" style="padding: 0" data-type="docPanel"></div>
+ </div>
</div>
</div>
<ul data-type="notebook" style="padding: 8px 0;" class="fn__none b3-list b3-list--background">
@@ -480,6 +483,7 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
const docElement = firstPanelElement.querySelector('.history__text[data-type="docPanel"]') as HTMLElement;
const assetElement = firstPanelElement.querySelector('.history__text[data-type="assetPanel"]');
const mdElement = firstPanelElement.querySelector('.history__text[data-type="mdPanel"]') as HTMLTextAreaElement;
+ const titleElement = firstPanelElement.querySelector('.protyle-title__input') as HTMLElement;
renderDoc(firstPanelElement, 1);
historyEditor = new Protyle(app, docElement, {
blockId: "",
@@ -706,6 +710,7 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
}
});
}
+ titleElement.textContent = target.querySelector(".b3-list-item__text").textContent;
let currentItem = hasClosestByClassName(target, "b3-list") as HTMLElement;
if (currentItem) {
currentItem = currentItem.querySelector(".b3-list-item--focus");
@@ -864,8 +869,6 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
}
);
}
-
-
} else if ((type === "docprevious" || type === "docnext") && target.getAttribute("disabled") !== "disabled") {
const currentPage = parseInt(firstPanelElement.getAttribute("data-page"));
renderDoc(firstPanelElement, type === "docprevious" ? currentPage - 1 : currentPage + 1);