fix(settings): size panel to the active tab + drop the native unload prompt

- Render only the active settings tab instead of stacking all four in one grid
  cell. The stack forced the whole panel to the tallest tab's (Account) height,
  leaving the short tabs (Appearance/Notifications) with dead space and a
  pointless scrollbar. Now the panel sizes to its actual content.
- Remove the beforeunload guard: it could only raise the browser's own native
  'Reload site?' prompt (no in-app dialog possible there), which we avoid.
  Unsaved prefs are local-only and revert to the saved server baseline on the
  next load, so a reload/close loses nothing. The in-app confirm still guards
  in-app navigation and browser Back.
This commit is contained in:
npeter83 2026-06-19 00:04:19 +02:00
parent 7efb1138cf
commit 989ac65474
2 changed files with 11 additions and 27 deletions

View file

@ -374,17 +374,9 @@ export default function App() {
confirmRef.current = confirm;
pageRef.current = page;
});
// Warn on a hard navigation (reload / tab close) while preference changes are unsaved.
useEffect(() => {
if (!prefsDirty) return;
const handler = (e: BeforeUnloadEvent) => {
e.preventDefault();
e.returnValue = "";
};
window.addEventListener("beforeunload", handler);
return () => window.removeEventListener("beforeunload", handler);
}, [prefsDirty]);
// No beforeunload guard: a reload/close can only raise the browser's own native prompt
// (we can't show our in-app confirm there), and unsaved prefs are local-only — they
// revert to the saved server baseline on the next load — so there's nothing to lose.
if (meQuery.isLoading)
return (