From 319e5fe4f5f4b31b7d52d8f731315ae59c46b065 Mon Sep 17 00:00:00 2001 From: NessZerra Date: Sun, 12 Jul 2026 12:10:08 +0700 Subject: [PATCH 1/2] Align settings tab content Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- apps/desktop-tauri/src/styles.css | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/desktop-tauri/src/styles.css b/apps/desktop-tauri/src/styles.css index 30357f1c25..2ca8c8bced 100644 --- a/apps/desktop-tauri/src/styles.css +++ b/apps/desktop-tauri/src/styles.css @@ -4865,6 +4865,7 @@ html:has(.menu-surface--tray) { /* ── Settings body container: padded, centered, capped at 560px ─── */ .settings-body { + width: 100%; max-width: 560px; margin: 0 auto; padding: 16px 20px 24px; From ed99d80f434c831c4f38e29cfd2c3057d1567e41 Mon Sep 17 00:00:00 2001 From: NessZerra Date: Sun, 12 Jul 2026 12:14:54 +0700 Subject: [PATCH 2/2] Use one Settings window size Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- apps/desktop-tauri/src/surfaces/Settings.tsx | 21 +++++--------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/apps/desktop-tauri/src/surfaces/Settings.tsx b/apps/desktop-tauri/src/surfaces/Settings.tsx index daf9001cb4..09ad57db9a 100644 --- a/apps/desktop-tauri/src/surfaces/Settings.tsx +++ b/apps/desktop-tauri/src/surfaces/Settings.tsx @@ -112,22 +112,17 @@ function isSettingsTab(value: string): value is SettingsTab { } const SETTINGS_WINDOW_HEIGHT = 580; -const SETTINGS_WINDOW_DEFAULT_WIDTH = 496; -const SETTINGS_WINDOW_PROVIDERS_WIDTH = 600; +const SETTINGS_WINDOW_WIDTH = 600; -async function applySettingsWindowSize(tab: SettingsTab) { - const requestedWidth = - tab === "providers" - ? SETTINGS_WINDOW_PROVIDERS_WIDTH - : SETTINGS_WINDOW_DEFAULT_WIDTH; +async function applySettingsWindowSize() { const workArea = await getWorkAreaRect().catch(() => null); - const screenWidth = window.screen.availWidth || window.innerWidth || requestedWidth; + const screenWidth = window.screen.availWidth || window.innerWidth || SETTINGS_WINDOW_WIDTH; const screenHeight = window.screen.availHeight || window.innerHeight || SETTINGS_WINDOW_HEIGHT; const maxWidth = Math.min(workArea?.width ?? screenWidth, screenWidth); const maxHeight = Math.min(workArea?.height ?? screenHeight, screenHeight); const width = Math.max( 360, - Math.min(requestedWidth, maxWidth - 16), + Math.min(SETTINGS_WINDOW_WIDTH, maxWidth - 16), ); const height = Math.max( 360, @@ -164,10 +159,7 @@ export default function Settings({ state, initialTab: propTab }: { state: Bootst const [activeTab, setActiveTab] = useState(initialTab); useEffect(() => { - void applySettingsWindowSize(initialTab); - // initialTab is captured once on mount; subsequent tab changes are - // handled by handleTabClick / shellTarget effect below. - // eslint-disable-next-line react-hooks/exhaustive-deps + void applySettingsWindowSize(); }, []); // Respond to prop-driven tab changes (detached window re-focus events). @@ -175,7 +167,6 @@ export default function Settings({ state, initialTab: propTab }: { state: Bootst if (propTab && isSettingsTab(propTab)) { setActiveTab((current) => { if (current === propTab) return current; - void applySettingsWindowSize(propTab); return propTab; }); } @@ -189,7 +180,6 @@ export default function Settings({ state, initialTab: propTab }: { state: Bootst const nextTab: SettingsTab = shellTarget.tab; setActiveTab((current) => { if (current === nextTab) return current; - void applySettingsWindowSize(nextTab); return nextTab; }); }, [shellTarget]); @@ -197,7 +187,6 @@ export default function Settings({ state, initialTab: propTab }: { state: Bootst const set = (patch: SettingsUpdate) => void update(patch); const handleTabClick = useCallback((tab: SettingsTab) => { setActiveTab(tab); - void applySettingsWindowSize(tab); // Only transition the main window if we're NOT in the detached settings window if (getCurrentWebviewWindow().label !== "settings") { void setSurfaceMode("settings", { kind: "settings", tab });