Skip to content

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

:bug: Improve database view switching and list add button layout https://github.com/siyuan-note/siyuan/issues/17743

Danielfa21cef75d97
diff --git a/app/src/assets/scss/business/_av.scss b/app/src/assets/scss/business/_av.scss
index 65c6270719..9d00f14272 100644
--- a/app/src/assets/scss/business/_av.scss
+++ b/app/src/assets/scss/business/_av.scss
@@ -21,6 +21,20 @@
display: none;
}
+ .av__row--util > .av__colsticky {
+ width: 100%;
+ flex-direction: column;
+
+ > .fn__space {
+ display: none;
+ }
+
+ > .av__button {
+ margin: 5px 0;
+ justify-content: flex-start;
+ }
+ }
+
.av__row {
border-bottom: 0;
border-radius: var(--b3-border-radius);
diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts
index 47dcca821f..4a8dae602e 100644
--- a/app/src/protyle/wysiwyg/transaction.ts
+++ b/app/src/protyle/wysiwyg/transaction.ts
@@ -1114,7 +1114,8 @@ export const onTransaction = (protyle: IProtyle, operations: IOperation[], isUnd
}, 450);
}
});
- if (data["data-av-type"]) {
+ // 已渲染数据库的布局类型随新内容一起更新,避免旧内容提前套用新布局样式。
+ if (data["data-av-type"] && !item.querySelector(".av__container")) {
item.setAttribute("data-av-type", data["data-av-type"]);
}
const attrElements = item.querySelectorAll(".protyle-attr");
diff --git a/app/src/protyle/wysiwyg/transactionAV.test.ts b/app/src/protyle/wysiwyg/transactionAV.test.ts
index fce2753c9f..679b4eafe3 100644
--- a/app/src/protyle/wysiwyg/transactionAV.test.ts
+++ b/app/src/protyle/wysiwyg/transactionAV.test.ts
@@ -28,6 +28,7 @@ const fixture = () => {
cleanBlockSelectionModeHTML: (html: string) => html,
cleanTableCellRichHTML: (html: string) => html,
cleanListMindmapHTML: (html: string) => html,
+ restoreInlineElementBoundaryHTML: (html: string) => html,
normalizeHTMLAssetIFrameBlockDOM: (html: string) => html,
cleanHeadingNumberOperations: (): void => undefined,
needSubscribe: () => true,