Repository navigation
UI: react-ui primitives, no inline styles in the app, error boundary, real nav links, react-aria forms, one live region - #171
Merged
Conversation
…ve region Card, Stack, Row, Drawer, Holder, KeyValues, Chips, LabeledValue, Form, FieldGroup, FirstRunShell, PageHead, Note, Caption and the panel parts move into react-ui and the design system, and the app drops its inline styles, its app.css and its raw layout classes. SegmentedControl, LinkBanner and the plain DeviceCard go. The forms use react-aria Form validation with shared password rules and useMutation, nav items are real links, the page heading takes focus and sets the title, the signed-out screens load lazily, and an error boundary guards the gate and the shell. One Announcer replaces the scattered status regions. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Tests for the Announcer, nav links, skip link, focus and title per page, the error boundary, Form validation and the layout parts. docs/ui.md and docs/decisions.md describe the primitives, the one live region, the forms and the password rules, and the design system has a README per new primitive. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #147
What changed and why
Card,Stack,Row,Note,Caption,SectionHeading,Identifier,Mono,Drawer(DrawerSection,Holder,KeyValues,Chips),LabeledValue,FieldGroup,Form,FirstRunShell,PageHead,PanelBody,PanelGrid,PanelNote,ItemMain,EmptyNote,LinkDot,ErrorBoundary,AnnouncerProvider. Each has CSS inresources/design-system/components/bundle.css(synced withpnpm design:sync, generated CSS not hand edited) and a README spec. The app has no inline style and no layout class of its own;app.cssis deleted. The drawer header and the first-run shell exist once each.ClientDrawerandAddClientmoved out ofclients-page.tsx.SegmentedControl,LinkBanner(theLinkStatetype now lives withStatusCard) and the plainDeviceCardare removed from the library and from the design system (CSS, specs, previews); the.app-*CSS had no user.SecretValuetakes itslabel;StatusCardtakes a readyversionand a genericdetailline, so the server-link wording and the version rule live in the app (client/server-link.ts). The status dot isLinkDot.ErrorBoundaryguards the auth gate and, asShellBoundary, the app, with Reload and Sign out. The three signed-out screens arelazy.href="#devices"), so they open in a new tab and take a middle click. A page that opens because the person went to it takes focus on its h1, and every page sets<title>(Devices - Koppel; React 19 hoists it, no effect). A skip link moves focus to the page without touching the address. The first page of a visit leaves focus alone.Formand field validation (validate,isRequired) on sign in, first password, password change, add client and the server connection; refusals from the server go tovalidationErrorsunder the field.auth/password-rules.tsis the one place for the password rules (mirrorskoppel-web/src/auth/password.rs), used by the first password and the change. Every form sends through auseMutation; the.then().catch().finally()chains and the four-useStatemirror are gone.ConnectionFormkeeps only what the person changed over the stored connection.SecretValuedrops the secret on Hide, and after a copy made while it was masked.AnnouncerProviderdraws the onlyrole="status"; the 18 other places are plain text. The pending store, the live link, forms, copy failures and sign-out failures speak throughuseAnnounce(). react-aria keeps its own off-screen announcer for selection changes; that one stays.Behaviour changes to check
someone-elsenow asserts the save stays pending (the form keeps what was typed, per docs/ui.md); therole="status"assertions now assert the visible text and the announced sentence; the status card tests no longer look for status or alert roles.detailandversion) to app-level behaviour.docs/decisions.md.role="log".Testing
pnpm --filter koppel.ui typecheck,pnpm --filter @koppel/react-ui typecheck,pnpm --filter koppel.ui lint: clean.pnpm design:sync: no change after the CSS sync.node:24.22.2-bookworm-slim, pnpm 9.15.0:pnpm --filter koppel.ui test13 files, 100 tests passed;pnpm --filter @koppel/react-ui test7 files, 47 passed. New: Announcer, nav links, skip link, focus and title per page, error boundary, Form validation and server errors, layout parts, secret handling, one live region in a full page.Docs
docs/ui.md(new section "Pages, forms and accessibility"),docs/decisions.md, the design system README and a README per new primitive.Changelog notes: no wire, on-disk or settings change. User-visible: nav links open in a new tab, each page sets its title and takes focus on its heading, a skip link, password forms say what to fix when sent, one screen reader voice.
🤖 Generated with Claude Code