Compare commits

6 Commits

Author SHA1 Message Date
logaritmisk 97c63ac25b merge: UI polish bundle (#73)
CI / web (push) Successful in 6m4s
2026-06-10 13:47:28 +02:00
logaritmisk 62c569741f fix(web): UI polish — select placeholder, locked-field note, list overflow, sidebar toggle, heading wrap (#73)
Five small design/layout nits from the UI sweep:

- form.selectPlaceholder "— select —" → "Select…" / "Välj…", matching
  the affordance style of every other placeholder (Filter…, Search…).
- FieldForm in edit mode now explains its locked controls with a muted
  fields.lockedNote caption ("Key and type can't be changed after
  creation.") instead of leaving four silently disabled inputs.
- FieldList rows truncate long labels (min-w-0 on the row button +
  truncate on the label, shrink-0 on the badge and required marker)
  instead of overflowing the 20rem column.
- The sidebar collapse toggle is hidden on narrow viewports (hidden
  md:flex) instead of rendered permanently disabled/grayed — the rail
  is forced collapsed there anyway.
- PageTitle gains text-balance so long titles wrap evenly.

Closes #73

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 13:47:22 +02:00
logaritmisk 3ad0e56ecd merge: deep-linkable field selection (#72)
CI / web (push) Successful in 6m14s
2026-06-10 13:44:08 +02:00
logaritmisk ada5d06dad feat(web): deep-linkable field selection via /fields/:key (#72)
FieldsPage kept the selected field definition in component state, so
reload lost the selection, fields couldn't be linked/shared, and
back/forward didn't navigate selections — inconsistent with
/vocabularies/:id and /objects/:id.

Move selection into the URL: the route becomes /fields/:key?
(optional segment), FieldList selection navigates, cancel/done
navigates back to /fields, and the page derives the selected def from
the already-cached field-defs query. An unknown or stale key (e.g.
after deleting the selected field) falls back to the create form.

Tests: deep link opens the locked edit form, select→cancel round-trips
through the URL, unknown key falls back to create.

Closes #72

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 13:44:02 +02:00
logaritmisk 3a57c0a77c merge: reduced-motion support + overscroll containment (#71)
CI / web (push) Successful in 4m48s
2026-06-10 13:38:44 +02:00
logaritmisk 9a896bb5f6 fix(web): honor prefers-reduced-motion; contain overscroll in modal surfaces (#71)
Nothing in the app respected prefers-reduced-motion — the kit's
data-open/closed animations, the skeleton pulse, and the sidebar width
transition all ran unconditionally. Add a global base-layer rule that
collapses animation/transition durations to a single frame when the OS
asks for reduced motion; one rule covers current and future additions.

Add overscroll-y-contain to the scrollable modal/popup surfaces
(DrawerContent, SelectContent, ComboboxPopup) so flicking past the end
of their content no longer chain-scrolls the page beneath, and to
AlertDialogContent for when it gains scrollable content.

Verified in the built CSS: the media query and
overscroll-behavior-y:contain both compile into dist/assets.

Closes #71

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 13:38:37 +02:00
15 changed files with 90 additions and 25 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ const router = createBrowserRouter(
<Route path="/authorities" element={<Navigate to="/authorities/person" replace />} /> <Route path="/authorities" element={<Navigate to="/authorities/person" replace />} />
<Route path="/authorities/:kind" element={<AuthoritiesPage />} /> <Route path="/authorities/:kind" element={<AuthoritiesPage />} />
<Route <Route
path="/fields" path="/fields/:key?"
element={ element={
<Suspense fallback={<ListSkeleton />}> <Suspense fallback={<ListSkeleton />}>
<FieldsPage /> <FieldsPage />
+1 -1
View File
@@ -50,7 +50,7 @@ function AlertDialogContent({
data-slot="alert-dialog-content" data-slot="alert-dialog-content"
data-size={size} data-size={size}
className={cn( className={cn(
"group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", "group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 overscroll-y-contain rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
className className
)} )}
{...props} {...props}
+1 -1
View File
@@ -62,7 +62,7 @@ function ComboboxPopup({ className, ...props }: ComboboxPrimitive.Popup.Props) {
<ComboboxPrimitive.Popup <ComboboxPrimitive.Popup
data-slot="combobox-popup" data-slot="combobox-popup"
className={cn( className={cn(
"max-h-64 min-w-48 overflow-auto rounded border bg-popover p-1 text-sm text-popover-foreground shadow-md", "max-h-64 min-w-48 overflow-auto overscroll-y-contain rounded border bg-popover p-1 text-sm text-popover-foreground shadow-md",
className, className,
)} )}
{...props} {...props}
+1 -1
View File
@@ -35,7 +35,7 @@ function DrawerContent({ className, children, ...props }: DrawerPrimitive.Popup.
<DrawerPrimitive.Popup <DrawerPrimitive.Popup
data-slot="drawer-content" data-slot="drawer-content"
className={cn( className={cn(
"fixed inset-y-0 right-0 flex w-full max-w-md flex-col overflow-y-auto bg-background shadow-xl outline-none duration-200 data-open:animate-in data-open:slide-in-from-right data-closed:animate-out data-closed:slide-out-to-right", "fixed inset-y-0 right-0 flex w-full max-w-md flex-col overflow-y-auto overscroll-y-contain bg-background shadow-xl outline-none duration-200 data-open:animate-in data-open:slide-in-from-right data-closed:animate-out data-closed:slide-out-to-right",
className, className,
)} )}
{...props} {...props}
+1 -1
View File
@@ -6,7 +6,7 @@ export function PageTitle({ className, ...props }: ComponentProps<"h1">) {
return ( return (
<h1 <h1
data-slot="page-title" data-slot="page-title"
className={cn("text-2xl font-semibold tracking-tight", className)} className={cn("text-2xl font-semibold tracking-tight text-balance", className)}
{...props} {...props}
/> />
) )
+1 -1
View File
@@ -99,7 +99,7 @@ function SelectContent({
<SelectPrimitive.Popup <SelectPrimitive.Popup
data-slot="select-content" data-slot="select-content"
className={cn( className={cn(
"max-h-[min(24rem,var(--available-height))] min-w-[var(--anchor-width)] overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md outline-none", "max-h-[min(24rem,var(--available-height))] min-w-[var(--anchor-width)] overflow-y-auto overscroll-y-contain rounded-md border bg-popover p-1 text-popover-foreground shadow-md outline-none",
"data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", "data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
className className
)} )}
+2
View File
@@ -110,6 +110,8 @@ export function FieldForm({
)} )}
</div> </div>
{isEdit && <p className="text-xs text-muted-foreground">{t("fields.lockedNote")}</p>}
<div className="space-y-1"> <div className="space-y-1">
<Label htmlFor="field-key">{t("fields.key")}</Label> <Label htmlFor="field-key">{t("fields.key")}</Label>
<Input <Input
+9 -4
View File
@@ -90,18 +90,23 @@ export function FieldList({
> >
<button <button
type="button" type="button"
className={cn("flex flex-1 items-center gap-2 rounded-sm text-left", focusRing)} className={cn(
"flex min-w-0 flex-1 items-center gap-2 rounded-sm text-left",
focusRing,
)}
aria-pressed={def.key === selectedKey} aria-pressed={def.key === selectedKey}
onClick={() => onSelect(def)} onClick={() => onSelect(def)}
> >
<span className="font-medium">{labelText(def.labels, lang)}</span> <span className="min-w-0 truncate font-medium">
{labelText(def.labels, lang)}
</span>
<span className="text-xs text-muted-foreground">{def.key}</span> <span className="text-xs text-muted-foreground">{def.key}</span>
<Badge variant="secondary"> <Badge variant="secondary" className="shrink-0">
{t(`fields.types.${def.data_type}`)} {t(`fields.types.${def.data_type}`)}
</Badge> </Badge>
{def.required && ( {def.required && (
<span <span
className="text-xs text-destructive" className="shrink-0 text-xs text-destructive"
title={t("fields.required")} title={t("fields.required")}
aria-label={t("fields.required")} aria-label={t("fields.required")}
> >
+15 -7
View File
@@ -1,18 +1,23 @@
import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useNavigate, useParams } from "react-router-dom";
import type { components } from "../api/schema"; import { useFieldDefinitions } from "../api/queries";
import { FieldList } from "./field-list"; import { FieldList } from "./field-list";
import { FieldForm } from "./field-form"; import { FieldForm } from "./field-form";
import { useDocumentTitle } from "../lib/use-document-title"; import { useDocumentTitle } from "../lib/use-document-title";
import { useBreadcrumb } from "../shell/use-breadcrumb"; import { useBreadcrumb } from "../shell/use-breadcrumb";
import { PageTitle } from "@/components/ui/page-title"; import { PageTitle } from "@/components/ui/page-title";
type FieldDefinitionView = components["schemas"]["FieldDefinitionView"];
export function FieldsPage() { export function FieldsPage() {
const { t } = useTranslation(); const { t } = useTranslation();
const [selected, setSelected] = useState<FieldDefinitionView | null>(null); const navigate = useNavigate();
const { key } = useParams();
const { data } = useFieldDefinitions();
// Selection lives in the URL (/fields/:key) so it survives reload and can be
// shared, matching /vocabularies/:id. An unknown or absent key falls back to
// the create form. Same cached query as FieldList, so no extra fetch.
const selected = (key && data?.find((def) => def.key === key)) || null;
useDocumentTitle(t("fields.title")); useDocumentTitle(t("fields.title"));
useBreadcrumb([{ label: t("nav.fields") }]); useBreadcrumb([{ label: t("nav.fields") }]);
@@ -22,13 +27,16 @@ export function FieldsPage() {
<PageTitle className="px-4 pt-4 pb-2">{t("fields.title")}</PageTitle> <PageTitle className="px-4 pt-4 pb-2">{t("fields.title")}</PageTitle>
<div className="grid flex-1 grid-cols-1 overflow-auto lg:grid-cols-[20rem_1fr] lg:overflow-hidden"> <div className="grid flex-1 grid-cols-1 overflow-auto lg:grid-cols-[20rem_1fr] lg:overflow-hidden">
<div className="overflow-hidden border-b lg:border-r lg:border-b-0"> <div className="overflow-hidden border-b lg:border-r lg:border-b-0">
<FieldList selectedKey={selected?.key ?? null} onSelect={setSelected} /> <FieldList
selectedKey={selected?.key ?? null}
onSelect={(def) => navigate(`/fields/${encodeURIComponent(def.key)}`)}
/>
</div> </div>
<div className="overflow-hidden"> <div className="overflow-hidden">
<FieldForm <FieldForm
key={selected?.key ?? "create"} key={selected?.key ?? "create"}
editing={selected} editing={selected}
onDone={() => setSelected(null)} onDone={() => navigate("/fields")}
/> />
</div> </div>
</div> </div>
+35 -1
View File
@@ -11,7 +11,7 @@ import { FieldsPage } from "./fields-page";
function tree() { function tree() {
return ( return (
<Routes> <Routes>
<Route path="/fields" element={<FieldsPage />} /> <Route path="/fields/:key?" element={<FieldsPage />} />
</Routes> </Routes>
); );
} }
@@ -87,6 +87,40 @@ test("filter narrows the visible fields", async () => {
expect(await screen.findByText(/no matches/i)).toBeInTheDocument(); expect(await screen.findByText(/no matches/i)).toBeInTheDocument();
}); });
test("deep link /fields/:key opens the edit form for that field", async () => {
renderApp(tree(), { route: "/fields/inscription" });
// edit mode: the key input is locked and prefilled from the URL. The form
// remounts when the defs query resolves, so re-query inside waitFor.
await waitFor(() => expect(screen.getByLabelText(/^key$/i)).toHaveValue("inscription"));
expect(screen.getByLabelText(/^key$/i)).toBeDisabled();
expect(screen.getByRole("button", { name: /cancel/i })).toBeInTheDocument();
});
test("selecting a field switches to its edit form; cancel returns to create", async () => {
renderApp(tree(), { route: "/fields" });
await userEvent.click(await screen.findByRole("button", { name: /inscription/i }));
await waitFor(() => expect(screen.getByLabelText(/^key$/i)).toHaveValue("inscription"));
expect(screen.getByLabelText(/^key$/i)).toBeDisabled();
await userEvent.click(screen.getByRole("button", { name: /cancel/i }));
await waitFor(() => expect(screen.getByLabelText(/^key$/i)).toHaveValue(""));
expect(screen.getByLabelText(/^key$/i)).toBeEnabled();
});
test("an unknown key falls back to the create form", async () => {
renderApp(tree(), { route: "/fields/zzz-does-not-exist" });
await screen.findByText("Inscription");
const key = screen.getByLabelText(/^key$/i);
expect(key).toHaveValue("");
expect(key).toBeEnabled();
});
test("creates a text field — posts the body and clears the key input", async () => { test("creates a text field — posts the body and clears the key input", async () => {
let body: { key: string; data_type: string } | undefined; let body: { key: string; data_type: string } | undefined;
+2 -1
View File
@@ -5,7 +5,7 @@
"objects": { "title": "Objects", "empty": "No objects yet", "loadError": "Could not load objects", "notFound": "Object not found", "prev": "Previous", "next": "Next", "of": "of", "new": "New object", "filter": "Filter objects…", "pageSize": "Per page", "columns": { "number": "Object №", "name": "Name", "visibility": "Visibility", "location": "Location", "count": "#", "updated": "Updated" }, "unknownRef": "(unknown)", "detailTitle": "Object detail", "tableLabel": "Objects" }, "objects": { "title": "Objects", "empty": "No objects yet", "loadError": "Could not load objects", "notFound": "Object not found", "prev": "Previous", "next": "Next", "of": "of", "new": "New object", "filter": "Filter objects…", "pageSize": "Per page", "columns": { "number": "Object №", "name": "Name", "visibility": "Visibility", "location": "Location", "count": "#", "updated": "Updated" }, "unknownRef": "(unknown)", "detailTitle": "Object detail", "tableLabel": "Objects" },
"fieldsLabels": { "objectNumber": "Object number", "objectName": "Name", "count": "Number of objects", "briefDescription": "Brief description", "currentLocation": "Current location", "currentOwner": "Current owner", "recorder": "Recorder", "recordingDate": "Recording date", "visibility": "Visibility" }, "fieldsLabels": { "objectNumber": "Object number", "objectName": "Name", "count": "Number of objects", "briefDescription": "Brief description", "currentLocation": "Current location", "currentOwner": "Current owner", "recorder": "Recorder", "recordingDate": "Recording date", "visibility": "Visibility" },
"visibility": { "draft": "Draft", "internal": "Internal", "public": "Public" }, "visibility": { "draft": "Draft", "internal": "Internal", "public": "Public" },
"form": { "selectPlaceholder": "— select", "create": "Create object", "save": "Save", "cancel": "Cancel", "visibility": "Visibility", "draft": "Draft", "internal": "Internal", "required": "This field is required", "rejected": "The server rejected the changes — check required and referenced fields", "fieldRejected": "The field \"{{field}}\" was rejected — check its value", "createdButFieldRejected": "Object created, but a field was rejected — fix it below.", "flexibleHeading": "Catalogue fields", "saving": "Saving…", "createAnother": "Save & create another", "minCount": "Must be at least 1", "fieldError": { "type_mismatch": "Wrong type for this field", "unresolved": "Referenced value not found", "unknown": "Unknown field" }, "unsaved": { "title": "Discard unsaved changes?", "body": "You have unsaved changes that will be lost.", "stay": "Keep editing", "leave": "Discard" } }, "form": { "selectPlaceholder": "Select", "create": "Create object", "save": "Save", "cancel": "Cancel", "visibility": "Visibility", "draft": "Draft", "internal": "Internal", "required": "This field is required", "rejected": "The server rejected the changes — check required and referenced fields", "fieldRejected": "The field \"{{field}}\" was rejected — check its value", "createdButFieldRejected": "Object created, but a field was rejected — fix it below.", "flexibleHeading": "Catalogue fields", "saving": "Saving…", "createAnother": "Save & create another", "minCount": "Must be at least 1", "fieldError": { "type_mismatch": "Wrong type for this field", "unresolved": "Referenced value not found", "unknown": "Unknown field" }, "unsaved": { "title": "Discard unsaved changes?", "body": "You have unsaved changes that will be lost.", "stay": "Keep editing", "leave": "Discard" } },
"actions": { "deleting": "Deleting…", "edit": "Edit", "delete": "Delete", "rename": "Rename", "save": "Save", "closeDetail": "Close detail", "confirmDelete": "Delete this object? This cannot be undone.", "confirmDeleteTerm": "Delete this term? This cannot be undone.", "confirmDeleteAuthority": "Delete this authority? This cannot be undone.", "confirmDeleteField": "Delete this field definition? This cannot be undone.", "confirmDeleteVocabulary": "Delete this vocabulary? This cannot be undone.", "inUse": "Can't delete — used by {{count}} object(s). Clear those fields first." }, "actions": { "deleting": "Deleting…", "edit": "Edit", "delete": "Delete", "rename": "Rename", "save": "Save", "closeDetail": "Close detail", "confirmDelete": "Delete this object? This cannot be undone.", "confirmDeleteTerm": "Delete this term? This cannot be undone.", "confirmDeleteAuthority": "Delete this authority? This cannot be undone.", "confirmDeleteField": "Delete this field definition? This cannot be undone.", "confirmDeleteVocabulary": "Delete this vocabulary? This cannot be undone.", "inUse": "Can't delete — used by {{count}} object(s). Clear those fields first." },
"labels": { "label": "Label", "externalUri": "External URI (optional)", "otherLanguages": "This entry also has labels in other languages, which are kept.", "uriPlaceholder": "https://…" }, "labels": { "label": "Label", "externalUri": "External URI (optional)", "otherLanguages": "This entry also has labels in other languages, which are kept.", "uriPlaceholder": "https://…" },
"theme": { "light": "Light", "dark": "Dark", "system": "System" }, "theme": { "light": "Light", "dark": "Dark", "system": "System" },
@@ -41,6 +41,7 @@
"authorityKind": "Authority kind", "authorityKind": "Authority kind",
"anyKind": "Any", "anyKind": "Any",
"group": "Group", "group": "Group",
"lockedNote": "Key and type can't be changed after creation.",
"required": "Required", "required": "Required",
"create": "Create field", "create": "Create field",
"empty": "No field definitions yet", "empty": "No field definitions yet",
+2 -1
View File
@@ -5,7 +5,7 @@
"objects": { "title": "Föremål", "empty": "Inga föremål ännu", "loadError": "Kunde inte ladda föremål", "notFound": "Föremålet hittades inte", "prev": "Föregående", "next": "Nästa", "of": "av", "new": "Nytt föremål", "filter": "Filtrera föremål…", "pageSize": "Per sida", "columns": { "number": "Föremålsnr", "name": "Namn", "visibility": "Synlighet", "location": "Plats", "count": "Antal", "updated": "Uppdaterad" }, "unknownRef": "(okänd)", "detailTitle": "Objektdetalj", "tableLabel": "Objekt" }, "objects": { "title": "Föremål", "empty": "Inga föremål ännu", "loadError": "Kunde inte ladda föremål", "notFound": "Föremålet hittades inte", "prev": "Föregående", "next": "Nästa", "of": "av", "new": "Nytt föremål", "filter": "Filtrera föremål…", "pageSize": "Per sida", "columns": { "number": "Föremålsnr", "name": "Namn", "visibility": "Synlighet", "location": "Plats", "count": "Antal", "updated": "Uppdaterad" }, "unknownRef": "(okänd)", "detailTitle": "Objektdetalj", "tableLabel": "Objekt" },
"fieldsLabels": { "objectNumber": "Föremålsnummer", "objectName": "Namn", "count": "Antal föremål", "briefDescription": "Kort beskrivning", "currentLocation": "Nuvarande plats", "currentOwner": "Nuvarande ägare", "recorder": "Registrerad av", "recordingDate": "Registreringsdatum", "visibility": "Synlighet" }, "fieldsLabels": { "objectNumber": "Föremålsnummer", "objectName": "Namn", "count": "Antal föremål", "briefDescription": "Kort beskrivning", "currentLocation": "Nuvarande plats", "currentOwner": "Nuvarande ägare", "recorder": "Registrerad av", "recordingDate": "Registreringsdatum", "visibility": "Synlighet" },
"visibility": { "draft": "Utkast", "internal": "Intern", "public": "Publik" }, "visibility": { "draft": "Utkast", "internal": "Intern", "public": "Publik" },
"form": { "selectPlaceholder": "— välj", "create": "Skapa föremål", "save": "Spara", "cancel": "Avbryt", "visibility": "Synlighet", "draft": "Utkast", "internal": "Intern", "required": "Fältet är obligatoriskt", "rejected": "Servern avvisade ändringarna — kontrollera obligatoriska och refererade fält", "fieldRejected": "Fältet \"{{field}}\" avvisades — kontrollera värdet", "createdButFieldRejected": "Föremålet skapades, men ett fält avvisades — åtgärda nedan.", "flexibleHeading": "Katalogfält", "saving": "Sparar…", "createAnother": "Spara & skapa ny", "minCount": "Måste vara minst 1", "fieldError": { "type_mismatch": "Fel typ för detta fält", "unresolved": "Refererat värde hittades inte", "unknown": "Okänt fält" }, "unsaved": { "title": "Kasta osparade ändringar?", "body": "Du har osparade ändringar som går förlorade.", "stay": "Fortsätt redigera", "leave": "Kasta" } }, "form": { "selectPlaceholder": "Välj", "create": "Skapa föremål", "save": "Spara", "cancel": "Avbryt", "visibility": "Synlighet", "draft": "Utkast", "internal": "Intern", "required": "Fältet är obligatoriskt", "rejected": "Servern avvisade ändringarna — kontrollera obligatoriska och refererade fält", "fieldRejected": "Fältet \"{{field}}\" avvisades — kontrollera värdet", "createdButFieldRejected": "Föremålet skapades, men ett fält avvisades — åtgärda nedan.", "flexibleHeading": "Katalogfält", "saving": "Sparar…", "createAnother": "Spara & skapa ny", "minCount": "Måste vara minst 1", "fieldError": { "type_mismatch": "Fel typ för detta fält", "unresolved": "Refererat värde hittades inte", "unknown": "Okänt fält" }, "unsaved": { "title": "Kasta osparade ändringar?", "body": "Du har osparade ändringar som går förlorade.", "stay": "Fortsätt redigera", "leave": "Kasta" } },
"actions": { "deleting": "Tar bort…", "edit": "Redigera", "delete": "Ta bort", "rename": "Byt namn", "save": "Spara", "closeDetail": "Stäng detalj", "confirmDelete": "Ta bort detta föremål? Detta kan inte ångras.", "confirmDeleteTerm": "Ta bort denna term? Detta kan inte ångras.", "confirmDeleteAuthority": "Ta bort denna auktoritet? Detta kan inte ångras.", "confirmDeleteField": "Ta bort denna fältdefinition? Detta kan inte ångras.", "confirmDeleteVocabulary": "Ta bort denna vokabulär? Detta kan inte ångras.", "inUse": "Kan inte ta bort — används av {{count}} föremål. Rensa de fälten först." }, "actions": { "deleting": "Tar bort…", "edit": "Redigera", "delete": "Ta bort", "rename": "Byt namn", "save": "Spara", "closeDetail": "Stäng detalj", "confirmDelete": "Ta bort detta föremål? Detta kan inte ångras.", "confirmDeleteTerm": "Ta bort denna term? Detta kan inte ångras.", "confirmDeleteAuthority": "Ta bort denna auktoritet? Detta kan inte ångras.", "confirmDeleteField": "Ta bort denna fältdefinition? Detta kan inte ångras.", "confirmDeleteVocabulary": "Ta bort denna vokabulär? Detta kan inte ångras.", "inUse": "Kan inte ta bort — används av {{count}} föremål. Rensa de fälten först." },
"labels": { "label": "Etikett", "externalUri": "Extern URI (valfritt)", "otherLanguages": "Denna post har även etiketter på andra språk, som behålls.", "uriPlaceholder": "https://…" }, "labels": { "label": "Etikett", "externalUri": "Extern URI (valfritt)", "otherLanguages": "Denna post har även etiketter på andra språk, som behålls.", "uriPlaceholder": "https://…" },
"theme": { "light": "Ljust", "dark": "Mörkt", "system": "System" }, "theme": { "light": "Ljust", "dark": "Mörkt", "system": "System" },
@@ -41,6 +41,7 @@
"authorityKind": "Auktoritetstyp", "authorityKind": "Auktoritetstyp",
"anyKind": "Alla", "anyKind": "Alla",
"group": "Grupp", "group": "Grupp",
"lockedNote": "Nyckel och typ kan inte ändras efter att fältet skapats.",
"required": "Obligatoriskt", "required": "Obligatoriskt",
"create": "Skapa fält", "create": "Skapa fält",
"empty": "Inga fältdefinitioner ännu", "empty": "Inga fältdefinitioner ännu",
+13
View File
@@ -99,6 +99,19 @@
body { body {
@apply bg-background text-foreground font-sans; @apply bg-background text-foreground font-sans;
} }
/* Collapse all animation/transition to a single frame for users who ask the
OS for reduced motion. Covers the kit's data-open/closed animations, the
skeleton pulse, and the sidebar width transition in one place. */
@media (prefers-reduced-motion: reduce) {
*,
::before,
::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
} }
@layer components { @layer components {
+2 -2
View File
@@ -54,7 +54,7 @@ test("term field filters and selects from the vocabulary combobox", async () =>
renderApp(<FormHarness defKey="material" onSubmit={(v) => submitted.push(v)} />); renderApp(<FormHarness defKey="material" onSubmit={(v) => submitted.push(v)} />);
const input = await screen.findByPlaceholderText("— select"); const input = await screen.findByPlaceholderText("Select");
await user.click(input); await user.click(input);
await user.type(input, "bro"); await user.type(input, "bro");
@@ -73,7 +73,7 @@ test("authority field filters and selects from the authority combobox", async ()
renderApp(<FormHarness defKey="maker" onSubmit={(v) => submitted.push(v)} />); renderApp(<FormHarness defKey="maker" onSubmit={(v) => submitted.push(v)} />);
const input = await screen.findByPlaceholderText("— select"); const input = await screen.findByPlaceholderText("Select");
await user.click(input); await user.click(input);
await user.type(input, "ada"); await user.type(input, "ada");
+4 -3
View File
@@ -80,15 +80,16 @@ export function Sidebar() {
<button <button
type="button" type="button"
onClick={toggle} onClick={toggle}
disabled={narrow}
aria-expanded={!collapsed} aria-expanded={!collapsed}
aria-label={t(collapsed ? "nav.expandSidebar" : "nav.collapseSidebar")} aria-label={t(collapsed ? "nav.expandSidebar" : "nav.collapseSidebar")}
title={t(collapsed ? "nav.expandSidebar" : "nav.collapseSidebar")} title={t(collapsed ? "nav.expandSidebar" : "nav.collapseSidebar")}
className={cn( className={cn(
"flex items-center justify-center rounded-md p-1 outline-none", // On narrow viewports the rail is forced collapsed, so the toggle
// is hidden rather than shown disabled (a grayed button reads as
// broken, not unavailable).
"hidden items-center justify-center rounded-md p-1 outline-none md:flex",
"hover:bg-accent", "hover:bg-accent",
focusRing, focusRing,
"disabled:pointer-events-none disabled:opacity-50",
)} )}
> >
{collapsed ? ( {collapsed ? (