Collapse the button-variant fork and the canvas's duplicate work

LoadingButton kept its own copy of buttonVariants, which had drifted past
`brand` and the icon sizes; it imports Button's now, so the Connect /
Re-pair button can show the loader instead of swapping its own label.

DashboardView mounted a second LookProvider inside the one CanvasSurface
already gives it and dropped `touch` on the way, so every widget on a
touch panel read `useLook().touch` as false. The provider is now mounted
once, by whatever owns the canvas root.

useCanvasRoot resolved the palette twice per render — once for the theme
class, once for the tokens — so useDashboardTheme takes the roles the
caller already has.

The bar assertions in widgets.spec.ts are scoped to the Load tile rather
than the page, which held only because the unbound spare bar draws no
rows.
This commit is contained in:
2026-09-14 15:29:40 +02:00
parent 4faf5312ff
commit 57fd3d1b2c
7 changed files with 50 additions and 60 deletions
@@ -138,21 +138,16 @@ export function RemoteAccess() {
</p>
</div>
<div>
<Button
<LoadingButton
variant={status.enrolled ? "outline" : "brand"}
className="rounded-full"
disabled={!code.trim() || !portalUrl.trim() || connect.isPending}
loading={connect.isPending}
disabled={!code.trim() || !portalUrl.trim()}
onClick={() => connect.mutate()}
data-testid="connect-portal"
>
{connect.isPending
? status.enrolled
? "Re-pairing…"
: "Connecting…"
: status.enrolled
? "Re-pair"
: "Connect"}
</Button>
{status.enrolled ? "Re-pair" : "Connect"}
</LoadingButton>
</div>
</div>
)