fix(maestro): render ☰ on mobile empty state
ci / rust (push) Failing after 1m48s

The welcome/empty-tab branch returned before renderMobile, so with the tab
bar collapsed there was no ☰ — leaving mobile users stuck with no way to
open the sidebar drawer. Float the same ☰ over the welcome view.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-24 15:55:25 +00:00
co-authored by Claude Opus 4.8
parent 9286eb09ba
commit 3b69c98cca
+14 -9
View File
@@ -338,6 +338,18 @@ export function createMultiView(opts: MultiViewOptions): MultiView {
render();
}
// The floating ☰ that stands in for the collapsed tab bar on mobile (single
// tab), keeping the sidebar drawer reachable from the welcome + pane views.
function makeMobileFab(): HTMLButtonElement {
const fab = document.createElement("button");
fab.type = "button";
fab.className = "mv-mobile-fab";
fab.title = "Sessions";
fab.textContent = "☰";
fab.addEventListener("click", () => opts.onToggleSidebar?.());
return fab;
}
// ---- top-level render ----
function render(): void {
@@ -351,6 +363,7 @@ export function createMultiView(opts: MultiViewOptions): MultiView {
if (!tab.root) {
pool.setVisible([]);
pool.setFocus(null);
if (isMobile && layout.tabs.length === 1) canvas.appendChild(makeMobileFab());
canvas.appendChild(renderWelcome());
sidebar.setHighlights({ open: openSessions(layout), focused: null, colors: colorMap() });
persist();
@@ -385,15 +398,7 @@ export function createMultiView(opts: MultiViewOptions): MultiView {
// With a single tab the tab bar (and its ☰) is hidden — float a ☰ so the
// sidebar drawer stays reachable.
if (layout.tabs.length === 1) {
const fab = document.createElement("button");
fab.type = "button";
fab.className = "mv-mobile-fab";
fab.title = "Sessions";
fab.textContent = "☰";
fab.addEventListener("click", () => opts.onToggleSidebar?.());
wrap.appendChild(fab);
}
if (layout.tabs.length === 1) wrap.appendChild(makeMobileFab());
if (ls.length > 1) {
const bar = document.createElement("div");