fix(design): claim audit part 1b — whole-row switches, the field-family edge, state-layer hovers, icon links, reason-disabled controls, 24/44 targets (E28)
- F12 (owner: A): SwitchRow, the whole settings row toggles; a Config boolean toggles from its title and hint (a label pointed at the switch). - F14 (owner: B): the form dropdown trigger wears the field frame (see-through, the >= 3:1 edge); labelled pills keep the faint edge and the accent-edge hover. DESIGN says so, with log rows. - F6: ~15 bg-card / bg-border / opacity hovers onto the B3 state layer; a lint rule (HOVER_SWAP) refuses the swap, contract-tested. - F10: bare 14px icon links onto IconLink / LinkButton; a local lint rule refuses a glyph-only <a>. - F13: reason-disabled controls are aria-disabled (Users, Channels backfill, Discovery, Scheduler runs, Config tests); FocusSafeButton now swallows the click of a caller's aria-disabled; the Config tests say why while dirty (testDirty, HU/EN). - F5/F11: every control measured live at 24 (mouse) and 44 (coarse) across every page; touch-target is a utility that wins over a caller's min-h-6; link variants carry it too; SegmentedToggle, Tabs, NavRail, menu rows, PriorityStepper, sliders, CheckRow, InnerInput, card links and the rest. - F9: DismissibleChip's label reaches the chip's 24; the Combobox chips are DismissibleChips. - F15: the "+N" / "More..." open state worded as it renders.
This commit is contained in:
@@ -14,7 +14,7 @@ import { LS, useAccountPersistedState } from "../lib/storage";
|
||||
import Avatar from "./ui/Avatar";
|
||||
import { notify, type NotifSettings } from "../lib/notifications";
|
||||
import Tooltip from "./ui/Tooltip";
|
||||
import { Section, SettingRow, Switch } from "./ui/form";
|
||||
import { Section, SwitchRow } from "./ui/form";
|
||||
import { Button } from "./ui/Button";
|
||||
import { type SaveState } from "./ui/DraftSaveBar";
|
||||
import { useConfirm } from "./confirmContext";
|
||||
@@ -157,7 +157,7 @@ function Appearance({ prefs }: { prefs: PrefsController }) {
|
||||
onClick={() => setTheme({ ...theme, scheme: s.id as Scheme })}
|
||||
aria-label={s.name}
|
||||
aria-pressed={theme.scheme === s.id}
|
||||
className={`h-9 w-full rounded-lg border-2 transition ${
|
||||
className={`h-9 w-full rounded-lg border-2 transition touch-target ${
|
||||
theme.scheme === s.id ? "border-fg" : "border-transparent"
|
||||
}`}
|
||||
style={{ background: s.swatch }}
|
||||
@@ -168,23 +168,17 @@ function Appearance({ prefs }: { prefs: PrefsController }) {
|
||||
</Section>
|
||||
|
||||
<Section title={t("settings.appearance.display")}>
|
||||
<SettingRow label={t("settings.appearance.darkMode")}>
|
||||
<Switch
|
||||
label={t("settings.appearance.darkMode")}
|
||||
checked={theme.mode === "dark"}
|
||||
onChange={(v) => setTheme({ ...theme, mode: v ? "dark" : "light" })}
|
||||
/>
|
||||
</SettingRow>
|
||||
<SettingRow
|
||||
<SwitchRow
|
||||
label={t("settings.appearance.darkMode")}
|
||||
checked={theme.mode === "dark"}
|
||||
onChange={(v) => setTheme({ ...theme, mode: v ? "dark" : "light" })}
|
||||
/>
|
||||
<SwitchRow
|
||||
label={t("settings.appearance.backgroundImage")}
|
||||
hint={t("settings.appearance.backgroundImageHint")}
|
||||
>
|
||||
<Switch
|
||||
label={t("settings.appearance.backgroundImage")}
|
||||
checked={theme.bgImage}
|
||||
onChange={(v) => setTheme({ ...theme, bgImage: v })}
|
||||
/>
|
||||
</SettingRow>
|
||||
checked={theme.bgImage}
|
||||
onChange={(v) => setTheme({ ...theme, bgImage: v })}
|
||||
/>
|
||||
{theme.bgImage && (
|
||||
<div className="pl-1 pb-1">
|
||||
<div className="flex items-center justify-between text-xs text-muted mb-1">
|
||||
@@ -201,45 +195,33 @@ function Appearance({ prefs }: { prefs: PrefsController }) {
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<SettingRow
|
||||
<SwitchRow
|
||||
label={t("settings.appearance.performanceMode")}
|
||||
hint={t("settings.appearance.performanceModeHint")}
|
||||
>
|
||||
<Switch
|
||||
label={t("settings.appearance.performanceMode")}
|
||||
checked={perf}
|
||||
onChange={setPerf}
|
||||
/>
|
||||
</SettingRow>
|
||||
<SettingRow
|
||||
checked={perf}
|
||||
onChange={setPerf}
|
||||
/>
|
||||
<SwitchRow
|
||||
label={t("settings.appearance.showHints")}
|
||||
hint={t("settings.appearance.showHintsHint")}
|
||||
>
|
||||
<Switch label={t("settings.appearance.showHints")} checked={hints} onChange={setHints} />
|
||||
</SettingRow>
|
||||
<SettingRow
|
||||
checked={hints}
|
||||
onChange={setHints}
|
||||
/>
|
||||
<SwitchRow
|
||||
label={t("settings.appearance.railLabels")}
|
||||
hint={t("settings.appearance.railLabelsHint")}
|
||||
>
|
||||
<Switch
|
||||
label={t("settings.appearance.railLabels")}
|
||||
checked={railLabels}
|
||||
onChange={setRailLabels}
|
||||
/>
|
||||
</SettingRow>
|
||||
checked={railLabels}
|
||||
onChange={setRailLabels}
|
||||
/>
|
||||
</Section>
|
||||
|
||||
<Section title={t("settings.appearance.startup")}>
|
||||
<SettingRow
|
||||
<SwitchRow
|
||||
label={t("settings.appearance.startOnHome")}
|
||||
hint={t("settings.appearance.startOnHomeHint")}
|
||||
>
|
||||
<Switch
|
||||
label={t("settings.appearance.startOnHome")}
|
||||
checked={startOnHome !== START_ON_HOME.off}
|
||||
onChange={(v) => setStartOnHome(v ? START_ON_HOME.on : START_ON_HOME.off)}
|
||||
/>
|
||||
</SettingRow>
|
||||
checked={startOnHome !== START_ON_HOME.off}
|
||||
onChange={(v) => setStartOnHome(v ? START_ON_HOME.on : START_ON_HOME.off)}
|
||||
/>
|
||||
</Section>
|
||||
|
||||
<Section title={t("settings.appearance.textSize")}>
|
||||
@@ -267,26 +249,18 @@ function Notifications({ prefs }: { prefs: PrefsController }) {
|
||||
|
||||
return (
|
||||
<Section title={t("settings.notifications.title")}>
|
||||
<SettingRow
|
||||
<SwitchRow
|
||||
label={t("settings.notifications.sound")}
|
||||
hint={t("settings.notifications.soundHint")}
|
||||
>
|
||||
<Switch
|
||||
label={t("settings.notifications.sound")}
|
||||
checked={cfg.sound}
|
||||
onChange={(v) => update({ sound: v })}
|
||||
/>
|
||||
</SettingRow>
|
||||
<SettingRow
|
||||
checked={cfg.sound}
|
||||
onChange={(v) => update({ sound: v })}
|
||||
/>
|
||||
<SwitchRow
|
||||
label={t("settings.notifications.autoDismiss")}
|
||||
hint={t("settings.notifications.autoDismissHint")}
|
||||
>
|
||||
<Switch
|
||||
label={t("settings.notifications.autoDismiss")}
|
||||
checked={autoOn}
|
||||
onChange={(v) => update({ durationMs: v ? 6000 : 0 })}
|
||||
/>
|
||||
</SettingRow>
|
||||
checked={autoOn}
|
||||
onChange={(v) => update({ durationMs: v ? 6000 : 0 })}
|
||||
/>
|
||||
{autoOn && (
|
||||
<div className="py-1.5 text-sm">
|
||||
<div className="flex items-center justify-between">
|
||||
@@ -597,14 +571,13 @@ function PlexWatchSync() {
|
||||
return (
|
||||
<Section title={t("settings.plexSync.title")}>
|
||||
<p className="text-xs text-muted leading-relaxed mb-2">{t("settings.plexSync.intro")}</p>
|
||||
<SettingRow label={t("settings.plexSync.toggle")} hint={t("settings.plexSync.toggleHint")}>
|
||||
<Switch
|
||||
label={t("settings.plexSync.toggle")}
|
||||
checked={shown}
|
||||
disabled={busy}
|
||||
onChange={(v) => !busy && toggle.mutate(v)}
|
||||
/>
|
||||
</SettingRow>
|
||||
<SwitchRow
|
||||
label={t("settings.plexSync.toggle")}
|
||||
hint={t("settings.plexSync.toggleHint")}
|
||||
checked={shown}
|
||||
disabled={busy}
|
||||
onChange={(v) => !busy && toggle.mutate(v)}
|
||||
/>
|
||||
{busy ? (
|
||||
<div className="mt-2 flex items-center gap-2 text-xs text-muted">
|
||||
<RefreshCw className="w-3.5 h-3.5 animate-spin" />
|
||||
|
||||
Reference in New Issue
Block a user