Skip to content

Commit ab3454e

Browse files
committed
fix(window,onboarding): enforce min window size; add relaunch from welcome check
- Narrow-window layout breakage: the borderless window (decorations:false) was not getting the OS WM_GETMINMAXINFO clamp, so live resizing dragged it below the 900px design width and triggered the broken <=860 fallback layout. Assert the minimum explicitly via set_min_size after the decorations are finalized so the OS clamps interactive resizes (config minWidth alone wasn't honored for the borderless window). Keeps the startup restored-size clamp as defense. - Onboarding: the welcome 'running as administrator' check showed red with no remedy. Added an inline 'Restart as admin' action on that row (reuses the existing relaunch_as_admin command + handleRelaunch), so it can be fixed right from the welcome step. CheckRow gained an optional inline action slot.
1 parent cada7d8 commit ab3454e

4 files changed

Lines changed: 73 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
### Fixed
11+
- **Window can no longer be resized below its usable size.** The borderless
12+
window didn't get the OS minimum-size clamp, so dragging it narrow broke the
13+
layout (the sidebar piled up full-width over the workspace). The 900×600
14+
minimum is now enforced explicitly, so interactive resizes are clamped.
15+
- **Administrator check is fixable from the welcome step.** The first onboarding
16+
screen's "running as administrator" check now offers an inline "Restart as
17+
admin" button when it's red, instead of just showing "not found".
1118
- **Onboarding admin check no longer contradicts itself.** The "administrator
1219
rights" step claimed "already running as administrator" whenever the
1320
run-as-admin autostart task existed, even when the current session was not

src-tauri/src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2316,6 +2316,16 @@ pub fn run() {
23162316
if let Some(main_window) = app.get_webview_window("main") {
23172317
let _ = main_window.set_decorations(false);
23182318

2319+
// Re-assert the minimum window size in the OS. With
2320+
// decorations:false the borderless window does not get the
2321+
// standard frame's WM_GETMINMAXINFO clamp, and toggling
2322+
// decorations above can drop the constraint registered from
2323+
// tauri.conf.json — so live resizing could drag the window far
2324+
// below the design width and break the layout. Setting it
2325+
// explicitly here makes the OS clamp interactive resizes.
2326+
// Keep in sync with tauri.conf.json and the clamp below.
2327+
let _ = main_window.set_min_size(Some(tauri::LogicalSize::new(900.0, 600.0)));
2328+
23192329
// Clamp restored size against the config minimums. The
23202330
// window-state plugin restores raw saved dimensions and does
23212331
// NOT re-validate against `minWidth/minHeight` from

src/components/onboarding/OnboardingWizard.tsx

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
1+
import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from "react";
22
import { useTranslation } from "react-i18next";
33

44
import { changeLanguage } from "../../i18n";
@@ -262,9 +262,29 @@ export function OnboardingWizard({ config, applyConfig, onClose }: OnboardingWiz
262262
<div className="onb-step__section-title">{T.welcome.checks}</div>
263263
<div className="onb-checks">
264264
<CheckRow state={synapseOk} label={T.welcome.cSynapse} hint={hintFor(synapseOk, T)} />
265-
<CheckRow state={elevated} label={T.welcome.cElevated} hint={hintFor(elevated, T)} />
265+
<CheckRow
266+
state={elevated}
267+
label={T.welcome.cElevated}
268+
hint={hintFor(elevated, T)}
269+
action={
270+
elevated === "bad" ? (
271+
<button
272+
type="button"
273+
className="onb-check__action"
274+
onClick={() => void handleRelaunch()}
275+
>
276+
{T.welcome.relaunch}
277+
</button>
278+
) : undefined
279+
}
280+
/>
266281
<CheckRow state={readiness} label={T.welcome.cNaga} hint={T.welcome.nagaHint} />
267282
</div>
283+
{relaunchError ? (
284+
<div className="onb-result">
285+
<span className="onb-check__dot bad" /> {relaunchError}
286+
</div>
287+
) : null}
268288
</>
269289
)}
270290

@@ -395,13 +415,24 @@ export function OnboardingWizard({ config, applyConfig, onClose }: OnboardingWiz
395415
);
396416
}
397417

398-
function CheckRow({ state, label, hint }: { state: CheckState; label: string; hint: string }) {
418+
function CheckRow({
419+
state,
420+
label,
421+
hint,
422+
action,
423+
}: {
424+
state: CheckState;
425+
label: string;
426+
hint: string;
427+
/** Optional inline affordance shown in place of the hint (e.g. a fix button). */
428+
action?: ReactNode;
429+
}) {
399430
const dot = state === "ok" ? "ok" : state === "bad" ? "bad" : "pending";
400431
return (
401432
<div className="onb-check">
402433
<span className={`onb-check__dot ${dot}`} />
403434
<span className="onb-check__label">{label}</span>
404-
<span className="onb-check__hint">{hint}</span>
435+
{action ?? <span className="onb-check__hint">{hint}</span>}
405436
</div>
406437
);
407438
}
@@ -432,6 +463,7 @@ interface Copy {
432463
cElevated: string;
433464
cNaga: string;
434465
nagaHint: string;
466+
relaunch: string;
435467
};
436468
synapse: {
437469
title: string;
@@ -469,6 +501,7 @@ const COPY: Record<Lang, Copy> = {
469501
cElevated: "Sidearm запущен от администратора",
470502
cNaga: "Готовность",
471503
nagaHint: "проверим на шаге «Тест»",
504+
relaunch: "Перезапустить от админа",
472505
},
473506
synapse: {
474507
title: "Настройка Razer Synapse",
@@ -524,6 +557,7 @@ const COPY: Record<Lang, Copy> = {
524557
cElevated: "Sidearm running as administrator",
525558
cNaga: "Readiness",
526559
nagaHint: "verified in the Test step",
560+
relaunch: "Restart as admin",
527561
},
528562
synapse: {
529563
title: "Set up Razer Synapse",

src/components/onboarding/onboarding.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,24 @@
162162
.onb-check__dot.pending { background: var(--c-border, #5a626c); }
163163
.onb-check__label { font-size: 14px; color: var(--c-text, #e8edf2); }
164164
.onb-check__hint { font-size: 12px; color: var(--c-text-dim, #8b939c); margin-left: auto; text-align: right; }
165+
/* Inline fix action shown in place of the hint (e.g. "Restart as admin"). */
166+
.onb-check__action {
167+
margin-left: auto;
168+
flex-shrink: 0;
169+
font-size: 12px;
170+
font-weight: 600;
171+
padding: 5px 12px;
172+
border-radius: var(--radius-pill, 999px);
173+
cursor: pointer;
174+
color: var(--c-accent, #9fca69);
175+
background: color-mix(in srgb, var(--c-accent, #9fca69) 12%, transparent);
176+
border: 1px solid color-mix(in srgb, var(--c-accent, #9fca69) 40%, transparent);
177+
transition: background 0.15s ease, border-color 0.15s ease;
178+
}
179+
.onb-check__action:hover {
180+
background: color-mix(in srgb, var(--c-accent, #9fca69) 20%, transparent);
181+
border-color: var(--c-accent, #9fca69);
182+
}
165183

166184
/* Numbered instructions */
167185
.onb-steps-list { margin: 0; padding-left: 20px; }

0 commit comments

Comments
 (0)