admin: enable toggles become rac switches

the upstream, blocklist source, and safe search enable controls mutate the row the moment they move, so they now carry the switch role via a shared drawn rac switch with a 44px hit area, a focus-visible ring, and naming modes made exclusive by a discriminated union. safe search supersedes its one-commit-old checkbox form, and the file-authority guard now names the switch role instead of relying on the bare input selector.
This commit is contained in:
2026-08-29 12:40:01 +02:00
parent f1de80477a
commit 207252acee
7 changed files with 254 additions and 20 deletions
@@ -18,10 +18,10 @@ import {
rulesQuery,
} from "@/lib/queries";
import type { Blocklist, ConfigStatus, Group, Rule, RuleAction, RuleKind } from "@/lib/types";
import Checkbox from "@/ui/Checkbox";
import ConfirmDialog from "@/ui/ConfirmDialog";
import DefinitionList from "@/ui/DefinitionList";
import Select from "@/ui/Select";
import Switch from "@/ui/Switch";
import { styles as shared } from "@/ui/styles";
import { colors } from "@/ui/tokens.stylex";
import AuthorityGate from "./AuthorityGate";
@@ -349,7 +349,7 @@ function GroupDetailEditable({ group }: { group: Group }) {
)}
<div {...stylex.props(styles.controlRow)}>
<Checkbox
<Switch
isSelected={group.safe_search}
isDisabled={update.isPending}
onChange={(safeSearch) =>
@@ -357,7 +357,7 @@ function GroupDetailEditable({ group }: { group: Group }) {
}
>
Safe search
</Checkbox>
</Switch>
<span {...stylex.props(styles.spacer)}>
{!renaming && (
<button