fix: settings mobile layout, silent failure on language save

- Settings sidebar was a fixed-width vertical list with no responsive
  breakpoint, squeezing the form into a sliver on mobile. Turn it into
  a horizontal scrollable tab bar under md, vertical sidebar above.
- setLocale() fired the PATCH and swallowed the result with
  .catch(() => {}) — never checked res.ok, no success/failure feedback.
  A failed save (expired session, network blip) looked identical to a
  successful one. Now returns a boolean, reverts local state on
  failure, and the settings form toasts success/failure.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Arnaud
2026-07-04 11:00:48 +02:00
parent ee7946316c
commit 67246c69e5
4 changed files with 34 additions and 14 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ export default async function SettingsLayout({ children }: { children: React.Rea
<h1 className="text-3xl font-bold tracking-tight">{m.settings.title}</h1>
<p className="text-muted-foreground mt-1">{m.settings.subtitle}</p>
</div>
<div className="flex gap-8 items-start">
<div className="flex flex-col md:flex-row gap-4 md:gap-8 md:items-start">
<SettingsSidebar />
<main className="flex-1 min-w-0 space-y-6">{children}</main>
</div>