fix: page mode toggle no longer overwrites default preference (#1996)

The header edit/read toggle now controls only the current session's mode
without saving it as the user's preference. The saved preference (set in
profile settings) is applied once on initial load and sticks across page
navigations within the session, so navigating to a new page no longer
resets the mode mid-session.

Fixes #1693
This commit is contained in:
Julien Fontanet
2026-05-14 14:15:03 +02:00
committed by GitHub
parent f758091b2a
commit 82d065669d
6 changed files with 57 additions and 36 deletions
@@ -40,7 +40,7 @@ import {
yjsConnectionStatusAtom,
} from "@/features/editor/atoms/editor-atoms.ts";
import { formattedDate } from "@/lib/time.ts";
import { PageStateSegmentedControl } from "@/features/user/components/page-state-pref.tsx";
import { PageEditModeToggle } from "@/features/user/components/page-state-pref.tsx";
import MovePageModal from "@/features/page/components/move-page-modal.tsx";
import { useTimeAgo } from "@/hooks/use-time-ago.tsx";
import { PageShareModal } from "@/ee/page-permission";
@@ -91,7 +91,7 @@ export default function PageHeaderMenu({ readOnly }: PageHeaderMenuProps) {
<>
<ConnectionWarning />
{!readOnly && <PageStateSegmentedControl size="xs" />}
{!readOnly && <PageEditModeToggle size="xs" />}
<PageShareModal readOnly={readOnly} />