Skip to content

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

:lipstick: Align mobile bottom sheet styling with menu sheets https://github.com/siyuan-note/siyuan/issues/19250

Daniel2ebc8de10830
diff --git a/app/src/assets/scss/main/_mobile.scss b/app/src/assets/scss/main/_mobile.scss
index a4d0cae0e0..55814b7aed 100644
--- a/app/src/assets/scss/main/_mobile.scss
+++ b/app/src/assets/scss/main/_mobile.scss
@@ -1559,11 +1559,32 @@ body.mobile-topbar--merged {
.mobile-bottom-sheet {
max-height: min(60vh, 100%);
- border-radius: 16px 16px 0 0;
- padding-top: 4px;
+ border: 0;
+ border-radius: var(--b3-border-radius-b) var(--b3-border-radius-b) 0 0;
+ background-color: var(--b3-theme-surface);
+ padding-top: 0;
box-sizing: border-box;
transform: translateY(100%);
- transition: transform 150ms ease;
+ transition: transform .15s cubic-bezier(0, 0, .2, 1);
+ }
+
+ .mobile-bottom-sheet__handle {
+ height: 16px;
+ flex-shrink: 0;
+ position: relative;
+ touch-action: none;
+
+ &::before {
+ position: absolute;
+ top: 5px;
+ left: calc(50% - 16px);
+ width: 32px;
+ height: 4px;
+ border-radius: 2px;
+ background-color: var(--b3-theme-on-surface-light);
+ content: "";
+ opacity: .45;
+ }
}
&.b3-dialog--open .mobile-bottom-sheet {
diff --git a/app/src/mobile/util/bindBottomSheetDialog.ts b/app/src/mobile/util/bindBottomSheetDialog.ts
index f678960d2f..2e455a9ba1 100644
--- a/app/src/mobile/util/bindBottomSheetDialog.ts
+++ b/app/src/mobile/util/bindBottomSheetDialog.ts
@@ -5,6 +5,10 @@ export const bindBottomSheetDialog = (dialog: Dialog, close: () => Promise<void>
dialog.element.classList.add("mobile-bottom-sheet-dialog");
const sheet = dialog.element.querySelector<HTMLElement>(".b3-dialog__container");
sheet.classList.add("mobile-bottom-sheet");
+ const handle = document.createElement("div");
+ handle.className = "mobile-bottom-sheet__handle";
+ handle.setAttribute("aria-hidden", "true");
+ sheet.prepend(handle);
const resize = () => {
const viewport = window.visualViewport;
const container = dialog.element.querySelector<HTMLElement>(".b3-dialog");
@@ -19,6 +23,7 @@ export const bindBottomSheetDialog = (dialog: Dialog, close: () => Promise<void>
const disposeDrag = bindBottomSheetDrag(sheet, dialog.element.querySelector(".b3-dialog__scrim"), close);
return () => {
disposeDrag();
+ handle.remove();
window.visualViewport?.removeEventListener("resize", resize);
window.visualViewport?.removeEventListener("scroll", resize);
};