fix(ios): safe-area-inset clearance so tab-bar/key-bar don't obscure terminal

viewport-fit=cover spans the physical screen edges; add --safe-t/--safe-b from
env(safe-area-inset-*) threaded through #tabbar/#term/#keybar/#approvalbar/#searchbox/
#settingspanel. Falls back to 0px (zero regression on non-safe-area platforms).
This commit is contained in:
Yaojia Wang
2026-07-06 16:51:03 +02:00
parent bfe1be1dfe
commit 5e7e4b22f2

View File

@@ -25,6 +25,13 @@
--tabbar-h: 40px;
--keybar-h: 46px;
/* iOS notch / home-indicator clearance. index.html sets viewport-fit=cover,
* so the layout spans the physical screen edges; without these the top bar
* hides under the status bar and the bottom key-bar covers terminal output.
* Falls back to 0px on platforms without safe areas. */
--safe-t: env(safe-area-inset-top, 0px);
--safe-b: env(safe-area-inset-bottom, 0px);
--ui-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
@@ -56,7 +63,9 @@ body {
#tabbar {
position: fixed;
inset: 0 0 auto 0;
height: var(--tabbar-h);
box-sizing: border-box;
height: calc(var(--tabbar-h) + var(--safe-t));
padding-top: var(--safe-t);
background: linear-gradient(180deg, #181a22, var(--surface-1));
border-bottom: 1px solid var(--border);
display: flex;
@@ -285,7 +294,7 @@ body {
/* ── Terminal area ───────────────────────────────────────────────── */
#term {
position: absolute;
inset: var(--tabbar-h) 0 var(--keybar-h) 0;
inset: calc(var(--tabbar-h) + var(--safe-t)) 0 calc(var(--keybar-h) + var(--safe-b)) 0;
background: var(--bg);
overflow: hidden;
}
@@ -301,13 +310,14 @@ body {
#keybar {
position: fixed;
inset: auto 0 0 0;
height: var(--keybar-h);
box-sizing: border-box;
height: calc(var(--keybar-h) + var(--safe-b));
background: var(--surface-1);
border-top: 1px solid var(--border);
display: flex;
align-items: center;
gap: 5px;
padding: 0 6px;
padding: 0 6px var(--safe-b);
overflow-x: auto;
overflow-y: hidden;
z-index: 1000;
@@ -382,7 +392,7 @@ body {
#searchbox {
position: fixed;
top: calc(var(--tabbar-h) + 8px);
top: calc(var(--tabbar-h) + var(--safe-t) + 8px);
right: 10px;
z-index: 1100;
display: flex;
@@ -480,7 +490,7 @@ body {
/* Settings panel */
#settingspanel {
position: fixed;
top: calc(var(--tabbar-h) + 8px);
top: calc(var(--tabbar-h) + var(--safe-t) + 8px);
right: 10px;
z-index: 1100;
background: var(--surface-2);
@@ -679,7 +689,7 @@ body {
/* Approval banner (H3) */
#approvalbar {
position: fixed;
inset: auto 0 var(--keybar-h) 0;
inset: auto 0 calc(var(--keybar-h) + var(--safe-b)) 0;
z-index: 1050;
display: flex;
align-items: center;
@@ -1547,9 +1557,10 @@ body {
body.home-open #keybar {
display: none;
}
/* Home chooser hides the key-bar, so reclaim its reserved space at the bottom. */
/* Home chooser hides the key-bar, so reclaim its reserved space at the bottom
* (keeping the home-indicator clearance so launcher content stays reachable). */
body.home-open #term {
bottom: 0;
bottom: var(--safe-b);
}
/* Desktop: float the Sessions/Projects toggle top-right, on the SAME row as the