The sidebar-drawer toggle now lives left of the logo in the global header instead of floating over the content area / tab bar. Removes the in-canvas fab and tab-bar menu button and their styles. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -36,8 +36,6 @@ export interface MultiViewOptions {
|
||||
/** Called after any layout change (structure, focus, or divider resize) so the
|
||||
* shell can persist it (issue #34). */
|
||||
onLayoutChange?: () => void;
|
||||
/** Toggle the mobile sidebar drawer (the ☰ button in the tab bar, issue #35). */
|
||||
onToggleSidebar?: () => void;
|
||||
}
|
||||
|
||||
export interface MultiView {
|
||||
@@ -251,14 +249,6 @@ export function createMultiView(opts: MultiViewOptions): MultiView {
|
||||
|
||||
function renderTabs(): void {
|
||||
tabBar.replaceChildren();
|
||||
// Mobile-only ☰ to open the sidebar drawer (CSS hides it on desktop).
|
||||
const menu = document.createElement("button");
|
||||
menu.type = "button";
|
||||
menu.className = "mv-mobile-menu";
|
||||
menu.title = "Sessions";
|
||||
menu.textContent = "☰";
|
||||
menu.addEventListener("click", () => opts.onToggleSidebar?.());
|
||||
tabBar.appendChild(menu);
|
||||
for (const t of layout.tabs) {
|
||||
const tab = document.createElement("button");
|
||||
tab.type = "button";
|
||||
@@ -338,18 +328,6 @@ 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 {
|
||||
@@ -363,7 +341,6 @@ 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();
|
||||
@@ -396,10 +373,6 @@ export function createMultiView(opts: MultiViewOptions): MultiView {
|
||||
const wrap = document.createElement("div");
|
||||
wrap.className = "mv-mobile";
|
||||
|
||||
// With a single tab the tab bar (and its ☰) is hidden — float a ☰ so the
|
||||
// sidebar drawer stays reachable.
|
||||
if (layout.tabs.length === 1) wrap.appendChild(makeMobileFab());
|
||||
|
||||
if (ls.length > 1) {
|
||||
const bar = document.createElement("div");
|
||||
bar.className = "mv-panebar";
|
||||
|
||||
Reference in New Issue
Block a user