Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b369183
Fix multiple-choice widget dropping scalar value on first toggle
bnomei Jun 27, 2026
5ac2743
Mark object-invalid-root-lost as wontfix
bnomei Jun 27, 2026
0a539b0
Mark structure-row-coercion-lost as wontfix
bnomei Jun 27, 2026
f40b4a9
Fix boolean subfield rendering string "false" as checked
bnomei Jun 27, 2026
c684c05
Mark structure-reorder-wrong-row as invalid
bnomei Jun 27, 2026
2d529ba
Fix single-choice widget ignoring array stored values
bnomei Jun 27, 2026
d7d972c
Mark structure-non-array-empty-ui as wontfix
bnomei Jun 27, 2026
8d2fbd2
Fix choices widget crash on object choice missing value
bnomei Jun 27, 2026
85cb829
Fix link field dropping a scalar URL root on first edit
bnomei Jun 27, 2026
b71879f
Fix choices multiple flag treating string "false" as true
bnomei Jun 27, 2026
bda4214
Fix numeric subfields rejecting in-progress decimal/negative input
bnomei Jun 27, 2026
df8c728
Validate link type/target against documented unions
bnomei Jun 27, 2026
5e5f83b
Dedupe duplicate choice values in normalizeChoices
bnomei Jun 27, 2026
1851803
Document structure min/max semantics (wontfix auto-clamp)
bnomei Jun 27, 2026
c715fea
Fix structure deadlock when min > max
bnomei Jun 27, 2026
73d5c63
Fall back to options alias when choices array is empty
bnomei Jun 27, 2026
c93d54f
Surface numeric select subfield values via string coercion
bnomei Jun 27, 2026
136cbda
Mark structure-stale-closure-clobber as wontfix
bnomei Jun 27, 2026
25230dc
Coerce numeric subfield string/off-type values for display
bnomei Jun 27, 2026
7990216
Fix link value normalization on load
bnomei Jun 27, 2026
a221ddd
Fix select subfield normalization on load
bnomei Jun 27, 2026
4c3c21e
Fix numeric subfield normalization on load
bnomei Jun 27, 2026
ef38648
Avoid normalizing absent subfield keys
bnomei Jun 27, 2026
f834b69
comments
bnomei Jun 27, 2026
35a2d0c
Delete .devana directory
bnomei Jun 27, 2026
517b75d
Preserve unknown select subfield values
bnomei Jun 29, 2026
5e735eb
Format numeric input test
bnomei Jun 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ Structure field:
}
```

The structure widget also accepts `min` and `max` row counts. These constrain
the interactive controls — the Add button is disabled at `max` and the Remove
button is disabled at `min` — guiding editors back within bounds. They are not
enforced on externally supplied values: a stored array outside the limits is
shown as-is rather than silently trimmed (which would drop data) or padded with
empty rows (which would dirty the entry on open).

Choices with horizontal cards:

```json
Expand Down
8 changes: 8 additions & 0 deletions src/admin-locale.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
/**
* Admin UI locale from the EmDash `emdash-locale` cookie.
*
* Widgets use this when options omit an explicit locale so labels track the
* signed-in admin language.
*/
import { useEffect, useState } from "react";
import { DEFAULT_LOCALE, normalizeLocale } from "./i18n";

const LOCALE_COOKIE_NAME = "emdash-locale";

/** Reads the current admin locale from `document.cookie`, with SSR-safe fallback. */
export function readAdminLocale(fallback = DEFAULT_LOCALE): string {
const normalizedFallback = normalizeLocale(fallback);

Expand All @@ -23,6 +30,7 @@ export function readAdminLocale(fallback = DEFAULT_LOCALE): string {
}
}

/** Reactive admin locale that resyncs on focus and a short polling interval. */
export function useAdminLocale(fallback = DEFAULT_LOCALE): string {
const [locale, setLocale] = useState(() => readAdminLocale(fallback));

Expand Down
Loading