Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 731a4f0dca | |||
| fa439d7c7b | |||
| affa32cbaa |
@@ -12,6 +12,7 @@ import TopMenu from "@/components/layouts/global/top-menu.tsx";
|
|||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import {
|
import {
|
||||||
|
NAVBAR_COLLAPSE_BREAKPOINT,
|
||||||
desktopSidebarAtom,
|
desktopSidebarAtom,
|
||||||
mobileSidebarAtom,
|
mobileSidebarAtom,
|
||||||
} from "@/components/layouts/global/hooks/atoms/sidebar-atom.ts";
|
} from "@/components/layouts/global/hooks/atoms/sidebar-atom.ts";
|
||||||
@@ -53,7 +54,13 @@ export function AppHeader() {
|
|||||||
aria-label={t("Sidebar toggle")}
|
aria-label={t("Sidebar toggle")}
|
||||||
opened={mobileOpened}
|
opened={mobileOpened}
|
||||||
onClick={toggleMobile}
|
onClick={toggleMobile}
|
||||||
hiddenFrom="sm"
|
// Must match the AppShell navbar breakpoint (md). The navbar
|
||||||
|
// collapses to the MOBILE drawer below md, so the mobile toggle
|
||||||
|
// (which flips mobileOpened) must be the one visible across the
|
||||||
|
// whole <md band — otherwise at 768-991 the desktop toggle showed
|
||||||
|
// but flipped the wrong atom, leaving the drawer unopenable (the
|
||||||
|
// regression from the initial sm->md navbar change).
|
||||||
|
hiddenFrom={NAVBAR_COLLAPSE_BREAKPOINT}
|
||||||
size="sm"
|
size="sm"
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
@@ -63,7 +70,7 @@ export function AppHeader() {
|
|||||||
aria-label={t("Sidebar toggle")}
|
aria-label={t("Sidebar toggle")}
|
||||||
opened={desktopOpened}
|
opened={desktopOpened}
|
||||||
onClick={toggleDesktop}
|
onClick={toggleDesktop}
|
||||||
visibleFrom="sm"
|
visibleFrom={NAVBAR_COLLAPSE_BREAKPOINT}
|
||||||
size="sm"
|
size="sm"
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import SettingsSidebar from "@/components/settings/settings-sidebar.tsx";
|
|||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import {
|
import {
|
||||||
APP_NAVBAR_ID,
|
APP_NAVBAR_ID,
|
||||||
|
NAVBAR_COLLAPSE_BREAKPOINT,
|
||||||
asideStateAtom,
|
asideStateAtom,
|
||||||
desktopSidebarAtom,
|
desktopSidebarAtom,
|
||||||
mobileSidebarAtom,
|
mobileSidebarAtom,
|
||||||
@@ -88,7 +89,13 @@ export default function GlobalAppShell({
|
|||||||
header={{ height: 45 }}
|
header={{ height: 45 }}
|
||||||
navbar={{
|
navbar={{
|
||||||
width: isSpaceRoute ? sidebarWidth : 300,
|
width: isSpaceRoute ? sidebarWidth : 300,
|
||||||
breakpoint: "sm",
|
// `md` (not `sm`): below 992px the fixed ~300px sidebar leaves too little
|
||||||
|
// room for content — the settings tables (Members/…) overflow the offset
|
||||||
|
// content area on tablet (~768px) and clip the Role/actions columns
|
||||||
|
// off-screen with no horizontal scroll. Collapsing the navbar to a toggle
|
||||||
|
// drawer across the whole tablet band frees the full width for content
|
||||||
|
// (the mobile drawer is closed by default, so nothing overlaps on load).
|
||||||
|
breakpoint: NAVBAR_COLLAPSE_BREAKPOINT,
|
||||||
collapsed: {
|
collapsed: {
|
||||||
mobile: !mobileOpened,
|
mobile: !mobileOpened,
|
||||||
desktop: !desktopOpened,
|
desktop: !desktopOpened,
|
||||||
@@ -97,7 +104,7 @@ export default function GlobalAppShell({
|
|||||||
aside={
|
aside={
|
||||||
isPageRoute && {
|
isPageRoute && {
|
||||||
width: 420,
|
width: 420,
|
||||||
breakpoint: "sm",
|
breakpoint: "md",
|
||||||
collapsed: { mobile: !isAsideOpen, desktop: !isAsideOpen },
|
collapsed: { mobile: !isAsideOpen, desktop: !isAsideOpen },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,13 @@ import { atom } from "jotai";
|
|||||||
// would create a shell -> chat-window -> shell import cycle).
|
// would create a shell -> chat-window -> shell import cycle).
|
||||||
export const APP_NAVBAR_ID = "app-shell-navbar";
|
export const APP_NAVBAR_ID = "app-shell-navbar";
|
||||||
|
|
||||||
|
// Single source of truth for the navbar collapse breakpoint. The AppShell navbar
|
||||||
|
// `breakpoint` and BOTH burger toggles' `hiddenFrom`/`visibleFrom` MUST use this
|
||||||
|
// exact value: if they drift, the sidebar becomes unreachable on tablet widths
|
||||||
|
// (the round-1 regression of #292). Kept here so the shell and the header share
|
||||||
|
// one constant the compiler enforces, instead of three hand-synced string literals.
|
||||||
|
export const NAVBAR_COLLAPSE_BREAKPOINT = "md";
|
||||||
|
|
||||||
export const mobileSidebarAtom = atom<boolean>(false);
|
export const mobileSidebarAtom = atom<boolean>(false);
|
||||||
|
|
||||||
export const desktopSidebarAtom = atomWithWebStorage<boolean>(
|
export const desktopSidebarAtom = atomWithWebStorage<boolean>(
|
||||||
|
|||||||
Reference in New Issue
Block a user