Skip to content

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

:art: Align database column width snap guide https://github.com/siyuan-note/siyuan/issues/12952

Daniel80454e6281a8
diff --git a/app/src/assets/scss/business/_av.scss b/app/src/assets/scss/business/_av.scss
index 9c4ca8c81d..7a977d3cce 100644
--- a/app/src/assets/scss/business/_av.scss
+++ b/app/src/assets/scss/business/_av.scss
@@ -1195,6 +1195,7 @@
background-color: var(--b3-theme-primary);
pointer-events: none;
position: fixed;
+ transform: translateX(-50%);
width: 1px;
z-index: 2;
}
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index 55637f5cd7..95ce5888e0 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -1404,7 +1404,7 @@ export class WYSIWYG {
const initialDragRight = dragRect.right;
const widthScale = dragRect.width / oldWidth || 1;
const snapGuideRight = previousWidth === undefined ? undefined :
- Math.round(initialDragRight + (previousWidth - oldWidth) * widthScale);
+ initialDragRight + (previousWidth - oldWidth) * widthScale;
const headerTop = headerElement.getBoundingClientRect().top;
const bodyBottom = bodyElement.getBoundingClientRect().bottom;
const guideHeight = Math.max(0,
@@ -1432,7 +1432,8 @@ export class WYSIWYG {
resizeTip.className = "av__width-tip";
document.body.appendChild(resizeTip);
}
- const dragRight = Math.round(initialDragRight + (newWidth - oldWidth) * widthScale);
+ resizeGuide?.classList.toggle("fn__none", snapped);
+ const dragRight = initialDragRight + (newWidth - oldWidth) * widthScale;
resizeTip.style.left = `${dragRight}px`;
resizeTip.style.top = `${Math.round(headerTop)}px`;
resizeTip.textContent = `${newWidth}px${snapped ?