Skip to content

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

:bug: Avoid stacked bottom navigation safe-area spacing on iOS https://github.com/siyuan-note/siyuan/issues/19719

Vanessa349e126af8d4
diff --git a/app/src/assets/scss/main/_mobile.scss b/app/src/assets/scss/main/_mobile.scss
index 979944b0f2..a729a7bdbd 100644
--- a/app/src/assets/scss/main/_mobile.scss
+++ b/app/src/assets/scss/main/_mobile.scss
@@ -10,7 +10,8 @@ body {
--mobile-bottom-bar-gap: 8px;
--mobile-status-height: 24px;
--mobile-bottom-bar-safe-area: env(safe-area-inset-bottom);
- --mobile-bottom-bar-bottom: calc(var(--mobile-status-height) + var(--mobile-bottom-bar-gap) + var(--mobile-bottom-bar-safe-area));
+ // 底部安全区与状态提示预留空间取较大值,避免导航栏被重复抬高。
+ --mobile-bottom-bar-bottom: calc(max(var(--mobile-status-height), var(--mobile-bottom-bar-safe-area)) + var(--mobile-bottom-bar-gap));
--mobile-bottom-bar-offset: calc(var(--mobile-bottom-bar-height) + var(--mobile-bottom-bar-bottom));
}
@@ -1661,13 +1662,13 @@ body.mobile-topbar--merged {
.status {
position: fixed;
- bottom: calc(0px - var(--mobile-status-height) - var(--mobile-bottom-bar-safe-area));
- height: calc(var(--mobile-status-height) + var(--mobile-bottom-bar-safe-area));
+ bottom: calc(0px - var(--mobile-status-height));
+ height: var(--mobile-status-height);
line-height: 16px;
transition: var(--b3-transition);
font-size: 12px;
color: var(--b3-theme-on-surface);
- padding: 4px 4px calc(4px + var(--mobile-bottom-bar-safe-area));
+ padding: 4px;
white-space: nowrap;
width: 100%;
box-sizing: border-box;
diff --git a/app/src/mobile/util/onMessage.ts b/app/src/mobile/util/onMessage.ts
index c1858eda4d..8e1a7bdb10 100644
--- a/app/src/mobile/util/onMessage.ts
+++ b/app/src/mobile/util/onMessage.ts
@@ -67,7 +67,7 @@ export const onMessage = (app: App, data: IWebSocketData) => {
} else {
clearTimeout(statusTimeout);
statusElement.innerHTML = `<div class="fn__flex">${sanitizeKernelHTML(data.data.tasks[0].action)}<div class="fn__progress"><div></div></div>`;
- statusElement.style.bottom = "0";
+ statusElement.style.bottom = "calc(var(--mobile-bottom-bar-offset) + var(--mobile-bottom-bar-gap))";
}
break;
case "setAppearance":
@@ -230,7 +230,7 @@ export const onMessage = (app: App, data: IWebSocketData) => {
}
clearTimeout(statusTimeout);
statusElement.innerHTML = sanitizeKernelHTML(data.msg);
- statusElement.style.bottom = "0";
+ statusElement.style.bottom = "calc(var(--mobile-bottom-bar-offset) + var(--mobile-bottom-bar-gap))";
statusTimeout = window.setTimeout(() => {
statusElement.style.bottom = "";
}, 12000);