Navigation restructure: five-tab bottom bar, no phone drawer
Drawer removed (phones only; desktop rail untouched) - MobileSidebar, sidebarOpen/useSidebarOpen, MenuIcon and the drawer's back-gesture layer are gone; the shared nav content now serves only the desktop rail (dead mobile branches deleted). No drawer-specific CSS existed; the three drawer strings (header.openMenu, sidebar.closeMenu, common.menu) and library.importAria are removed. - The header drops the hamburger: logo + name on the left, the single theme chip on the right. Five-tab bottom bar - Library / Progress / New deck (prominent centre +) / Exam / Settings, in that order; Progress and Exam reuse the existing /stats and /exam screens, Settings keeps opening the dialog. Sliding pill, icon bounce, press feedback, re-tap-to-top and safe-area padding kept; every item is >=44px (72px wide at 360px). - New short tab.* keys (EN + CS) so all five labels stay on one line at 360px — 'Zkouškový režim' became 'Zkouška'. No ellipsis anywhere. - The bar is mounted once in AppHeader so library, progress, exam and share get it; the wizards keep their own bottom action bar and the tab bar steps aside there, exactly as before. Re-homed drawer destinations - Smart Review card loses the Exam link (it is a tab now); Review due and Mistakes stay. - New deck screen (and /homework) get a Study deck / Make my homework segmented switch; the library's homework empty-state button stays. - The phone import icon becomes a ... button opening a sheet with Import JSON and New folder (back-gesture and Escape close it); folder chips still appear only once at least one folder exists, and folder creation stays in the New deck options step. Verified: mobile suite 134 checks (no hamburger/drawer, tab order and 44px targets, label matrix at 360/390 x EN/CS x dark/light x reduced motion, per-tab routing, deep links, Back from every tab, the ... sheet with folder creation) plus regression 74/74, wizard 83/83, declutter 116/116, animation 8/8, native 35/35, i18n 25/25, phase1 38/38, phase2 43/43, phase3 20/20, freeze-loading 6/6. Key parity 740/740. Lint + build clean. SW freezmo-v28.
This commit is contained in:
parent
4513364019
commit
8557b04621
19 changed files with 357 additions and 325 deletions
|
|
@ -3,18 +3,17 @@
|
|||
import Link from "next/link";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import { MenuIcon } from "@/components/icons";
|
||||
import { SettingsDialog } from "@/components/SettingsDialog";
|
||||
import { TabBar } from "@/components/TabBar";
|
||||
import { ThemeToggle } from "@/components/ThemeToggle";
|
||||
import { useI18n } from "@/lib/i18n";
|
||||
import { sidebarOpen } from "@/lib/nav";
|
||||
import { OPEN_SETTINGS_EVENT } from "@/lib/ui-events";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
/**
|
||||
* Minimal, sticky frosted top bar: brand on the left, quiet actions on the
|
||||
* right. The phone layout keeps the brand compact and relies on the tab bar
|
||||
* for navigation.
|
||||
* Minimal, sticky frosted top bar: brand on the left, theme chip on the
|
||||
* right. Phones navigate with the bottom tab bar (also mounted here, so every
|
||||
* screen that has a header gets it); the desktop rail carries navigation.
|
||||
*/
|
||||
export function AppHeader({ className, compact = false }: { className?: string; compact?: boolean }) {
|
||||
const { t } = useI18n();
|
||||
|
|
@ -48,41 +47,34 @@ export function AppHeader({ className, compact = false }: { className?: string;
|
|||
)}
|
||||
>
|
||||
<div className="mx-auto flex h-14 max-w-6xl items-center justify-between gap-3">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => sidebarOpen.toggle()}
|
||||
aria-label={t("header.openMenu")}
|
||||
className="mr-1 grid size-9 shrink-0 touch-target place-items-center rounded-full text-[var(--text-muted)] transition hover:bg-[var(--hover)] hover:text-[var(--text)]"
|
||||
<Link
|
||||
href="/"
|
||||
className="group flex min-w-0 items-center gap-2.5 rounded-xl px-1 py-1"
|
||||
aria-label={t("header.home")}
|
||||
>
|
||||
<MenuIcon className="size-5" />
|
||||
</button>
|
||||
<Link href="/" className="group flex items-center gap-2.5 rounded-xl px-1 py-1" aria-label={t("header.home")}>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element -- static app icon, no optimisation needed */}
|
||||
<img
|
||||
src="/icons/icon-192.png"
|
||||
alt=""
|
||||
aria-hidden
|
||||
className="size-8 rounded-[0.6rem] transition-transform group-hover:scale-[1.04]"
|
||||
/>
|
||||
<span className="flex items-baseline gap-2">
|
||||
<span className="text-[15px] font-semibold tracking-[-0.01em] text-[var(--text)]">
|
||||
Freezmo
|
||||
</span>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element -- static app icon, no optimisation needed */}
|
||||
<img
|
||||
src="/icons/icon-192.png"
|
||||
alt=""
|
||||
aria-hidden
|
||||
className="size-8 shrink-0 rounded-[0.6rem] transition-transform group-hover:scale-[1.04]"
|
||||
/>
|
||||
<span className="flex min-w-0 items-baseline gap-2">
|
||||
<span className="text-[15px] font-semibold tracking-[-0.01em] text-[var(--text)]">Freezmo</span>
|
||||
{!compact ? (
|
||||
<span className="hidden text-[13px] text-[var(--text-subtle)] sm:inline">
|
||||
<span className="hidden truncate text-[13px] text-[var(--text-subtle)] sm:inline">
|
||||
{t("header.tagline")}
|
||||
</span>
|
||||
) : null}
|
||||
</span>
|
||||
</Link>
|
||||
|
||||
<div className="flex items-center gap-1">
|
||||
{/* Settings lives in the tab bar and the drawer; the old header
|
||||
gear was the same control a third time. */}
|
||||
<div className="flex shrink-0 items-center gap-1">
|
||||
<ThemeToggle />
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<TabBar />
|
||||
<SettingsDialog
|
||||
open={settingsOpen}
|
||||
onClose={() => setSettingsOpen(false)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue