feat(web): bottom tab bar navigation (M4)
- Mobile bottom tab bar: Chat · Hands · Mind · More. "More" opens the drawer for the long tail (Journal, Log, Settings, sessions); hamburger retired. - Auto-hides while the keyboard is open (body.kb) so the input pins to the keyboard; mobile-only (desktop keeps its header nav). - Removed now-redundant Mind/Hands from the drawer + their listeners. - Bottom-fill fix: #chat uses 100dvh (the visible viewport) — 100vh/inset:0 reach into the home-indicator zone iOS won't comfortably show, clipping the bar; dvh/svh exclude it. Tab bar is flex:none with a small fixed bottom padding (safe-area padding double-counts at dvh height), and the body bg matches the bar so any strip below #chat is seamless. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -41,9 +41,7 @@
|
||||
<h4>Actions</h4>
|
||||
<button id="mobileThinkingStreamBtn">📜 Live Log (inline)</button>
|
||||
<button id="mobileFullLogBtn">⛶ Full Log</button>
|
||||
<button id="mobileMindBtn">🧠 Read Her Mind</button>
|
||||
<button id="mobileJournalBtn">📔 Journal</button>
|
||||
<button id="mobileHandsBtn">🃏 Hands</button>
|
||||
<button id="mobileSettingsBtn">⚙ Settings</button>
|
||||
<button id="mobileToggleThemeBtn">🌙 Toggle Theme</button>
|
||||
<button id="mobileForceReloadBtn">🔄 Force Reload</button>
|
||||
@@ -116,6 +114,14 @@
|
||||
<input id="userInput" type="text" placeholder="Type a message..." autofocus />
|
||||
<button id="sendBtn">Send</button>
|
||||
</div>
|
||||
|
||||
<!-- Bottom tab bar (mobile only; hides while the keyboard is open) -->
|
||||
<nav id="tabbar" aria-label="Primary navigation">
|
||||
<a class="tab active" href="/" aria-current="page"><span class="ti">💬</span><span class="tl">Chat</span></a>
|
||||
<a class="tab" href="/hands"><span class="ti">🃏</span><span class="tl">Hands</span></a>
|
||||
<a class="tab" href="/self"><span class="ti">🧠</span><span class="tl">Mind</span></a>
|
||||
<button class="tab" id="moreTab" type="button"><span class="ti">⋯</span><span class="tl">More</span></button>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<!-- Settings Modal (outside chat container) -->
|
||||
@@ -523,6 +529,8 @@
|
||||
// iOS pans the visual viewport when the keyboard opens; follow its top
|
||||
// edge so the pinned #chat sits exactly in the visible area.
|
||||
root.setProperty("--app-offset", off + "px");
|
||||
// Keyboard open ⇒ hide the bottom tab bar so the input pins to the keyboard.
|
||||
document.body.classList.toggle("kb", (window.innerHeight - h) > 150);
|
||||
}
|
||||
// Re-measure across the keyboard animation: iOS reports a stale (too-short)
|
||||
// height mid-animation, so sample a few times until it settles.
|
||||
@@ -568,6 +576,7 @@
|
||||
|
||||
hamburgerMenu.addEventListener("click", toggleMobileMenu);
|
||||
mobileMenuOverlay.addEventListener("click", closeMobileMenu);
|
||||
document.getElementById("moreTab").addEventListener("click", toggleMobileMenu);
|
||||
|
||||
// Sync mobile menu controls with desktop
|
||||
const mobileMode = document.getElementById("mobileMode");
|
||||
@@ -1011,15 +1020,9 @@
|
||||
document.getElementById("mobileFullLogBtn").addEventListener("click", () => {
|
||||
closeMobileMenu(); window.location.href = "/logs";
|
||||
});
|
||||
document.getElementById("mobileMindBtn").addEventListener("click", () => {
|
||||
closeMobileMenu(); window.location.href = "/self";
|
||||
});
|
||||
document.getElementById("mobileJournalBtn").addEventListener("click", () => {
|
||||
closeMobileMenu(); window.location.href = "/journal";
|
||||
});
|
||||
document.getElementById("mobileHandsBtn").addEventListener("click", () => {
|
||||
closeMobileMenu(); window.location.href = "/hands";
|
||||
});
|
||||
|
||||
// Connect to the global live log on page load.
|
||||
connectThinkingStream();
|
||||
|
||||
Reference in New Issue
Block a user