Add wide-page layout toggle to Settings
Lint / Lint (push) Successful in 29s
Tests / Go backend (push) Successful in 51s
Tests / Dashboard checks (push) Successful in 56s
Docker / Docker Build & Push (push) Successful in 3m50s

Adds a persisted per-browser preference to widen page content to full
browser width, alongside the existing theme switcher and language
selector reachable from the header profile dropdown's Settings entry.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Gabriel20xxandClaude Sonnet 5 committed 2026-09-06 22:56:25 +02:00
1 parent 81b62cdc26
commit 32104550cb
3 files changed
+46

No files matched your search

+5
View File
@@ -95,3 +95,8 @@ body {
background-color: var(--color-primary);
color: var(--color-primary-fg);
}
/* Wide-page setting: lifts the shared shell's default max-width cap on the main content area. */
[data-wide-layout='true'] .sc-main {
width: calc(100% - 2rem);
}
@@ -4,6 +4,7 @@
import { SettingsDialog as SharedSettingsDialog } from '@gabriel20xx/web-ui';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '$lib/components/ui/select';
import { currentLanguage, languages, setLanguage } from '$lib/language.svelte.js';
import { layoutState } from '$lib/layout.svelte.js';
import { themeState } from '$lib/theme.svelte.js';
let { open = $bindable(false) } = $props();
@@ -60,6 +61,15 @@
</SelectContent>
</Select>
</div>
<label class="mt-5 flex items-center justify-between gap-2">
<span class="text-sm font-medium">Wide page</span>
<input
type="checkbox"
checked={layoutState.wide}
onchange={(event) => layoutState.setWide(event.currentTarget.checked)}
class="size-4 rounded border-border accent-primary"
/>
</label>
<div class="sc-form-actions">
<Button type="button" variant="secondary" onclick={() => (open = false)}>Dismiss</Button>
</div>
+31
View File
@@ -0,0 +1,31 @@
import { browser } from '$app/environment';
const STORAGE_KEY = 'collabtable-wide-layout';
function loadInitialWide() {
if (!browser) return false;
return localStorage.getItem(STORAGE_KEY) === 'true';
}
let wide = $state(loadInitialWide());
export const layoutState = {
get wide() {
return wide;
},
setWide(next) {
wide = next;
if (browser) localStorage.setItem(STORAGE_KEY, String(next));
},
toggle() {
layoutState.setWide(!wide);
},
};
if (browser) {
$effect.root(() => {
$effect(() => {
document.documentElement.toggleAttribute('data-wide-layout', wide);
});
});
}