Skip to content

Feat/dmj gaps 8 - #65

Merged
wiifree merged 8 commits into
mainfrom
feat/dmj-gaps-8
Nov 28, 2026
Merged

wiifree merged 8 commits into
mainfrom
feat/dmj-gaps-8

Conversation

@wiifree

@wiifree wiifree commented Nov 28, 2026

Copy link
Copy Markdown
Member

Six gaps found in the DMJ app, one commit each.

  • Focus rings visible again (recipes, css – patch): with Tailwind v4 outline-none sets --tw-outline-style: none, and focus-visible:outline-2 took that style – invisible in 22 parts (SidebarNav, Stepper, Menubar …). The redundant outline-none is gone; a test over all recipes keeps it so. (outline-hidden would not help – it sets the same variable.)
  • Dialog: data-autofocus on a component root (recipes, vue, react – patch): resolved on opening like data-autoselect/focusFirst – <Listbox filter data-autofocus> focuses its search field. Story and browser test.
  • SegmentedControlItem label, icon-only segments (patch): only the icon, centred, the label for screen readers. Story Icon only.
  • Clearer keyboard focus on fields (recipes, css – patch): a 2 px primary ring right inside the border of every field recipe (WCAG 2.4.13 – the ring covers the field surface, whose contrast to primary the theme test checks).
  • DataTable exportRows="leaves" (vue, react – minor): CSV, Excel and print of a TreeTable without the parent rows; option rows of the methods. Story Tree export.
  • useUnsavedChanges (recipes, vue, react – minor): one shared question before leaving unsaved input; unsavedChangesGuard for the router; text in every language.

Tested locally (memory-limited, another process running): focus ring test, dialog autofocus (unit), SegmentedControl (23), DataTable export (12), useUnsavedChanges (4), locales (84), MCP docs, ESLint on the changed files. Typecheck and the full suites run in CI.

With Tailwind v4 outline-none also sets --tw-outline-style: none, and
focus-visible:outline-2 only sets the width and takes the style from that
variable - the focus ring was active but invisible (WCAG 2.4.7). Found on
the SidebarNav link; 22 parts had the combination. outline-hidden would
not help, it sets the same variable.

- Drop the redundant outline-none where a part draws its own focus ring
  (the browser outline only shows at :focus-visible, which they style)
- Test over all recipes: no focus outline width next to outline-none
  without an outline style

Signed-off-by: Florian Laabs <florian.laabs@wirecore.net>
On opening, the dialog resolved only data-autoselect itself; data-autofocus
went to Ark, which skips a wrapper that cannot take the focus - the close
button got it. focusFirst() and the docs promise the wrapper works.

- autoselectElement resolves data-autoselect, data-autofocus and autofocus
  like focusFirst (a wrapper gives its first tabbable element); the text
  is selected only with data-autoselect
- Story "Initial focus on a component" (Listbox with filter) and a
  browser test; unit test for the wrapper (jsdom cannot open-focus Ark)

Signed-off-by: Florian Laabs <florian.laabs@wirecore.net>
SegmentedControlItem always rendered its item text next to the icon; a
name for screen readers only (an sr-only span in the slot) left the text
part a flex item, and the item's gap pushed the icon off centre.

- label: the text of the segment without a slot; with icon and label but
  no slot only the icon shows, centred, the label names it (sr-only)
- Recipe variant iconOnly (no gap) and slot itemText; segments with text
  keep their DOM
- Behaviour test (name, sr-only, gap), parity case, story "Icon only"

Signed-off-by: Florian Laabs <florian.laabs@wirecore.net>
Focused fields showed the focus only as a 1 px primary border: WCAG 2.4.7,
but in the DMJ UX test hardly different from the resting state, and short
of 2.4.13 (2 px, 3:1 between focused and unfocused).

- Every focus:/focus-within:/focus-visible:border-primary of the field
  recipes gets a 2 px primary outline at -outline-offset-3: right inside
  the border, so nothing cuts it off, on the field surface (primary on
  the surfaces is checked by the theme test)
- outline-solid where the slot has outline-none (the focus ring test
  keeps that so)

Signed-off-by: Florian Laabs <florian.laabs@wirecore.net>
The CSV, Excel and print of a TreeTable always had every row of the tree.
When parents only sum up their children ("Person - 2 licences" above the
licences), the export had those rows twice; the page could not leave
them out without rebuilding the table's search, filters and sorting.

- Prop exportRows: 'all' (default) | 'leaves'; option rows of
  generateCsv/exportCsv, generateXlsx/exportXlsx and print, which wins
- A leaf has no children in the data (getSubRows), not just no matching
  ones; filtered and sorted like the table; selectionOnly unaffected
- Tests for CSV, Excel and print with and without a filter (lenient),
  story "Tree export", docs in the export section

Signed-off-by: Florian Laabs <florian.laabs@wirecore.net>
…nput

There was no building block that asks before a page with unsaved form
input is left (route change, reload, closing the tab). Apps built it
from a router guard, beforeunload and confirm(); several forms on a page
then easily asked several times.

- useUnsavedChanges(isDirty, { message? }) in the Vue and React form
  subpaths; all forms share one list: one confirm() however many changed,
  beforeunload only while one is changed, unregistered on unmount
- Router independent: unsavedChangesGuard(to, from) (Vue Router:
  router.beforeEach), only the query or hash changing does not ask;
  confirmLeave() for own links
- Text unsavedChanges.leave in every language; docs with TanStack Form
  (!state.isDefaultValue, form.reset(values) after saving)
- Tests: two changed forms ask once, cancel stays, query change, no
  changes, beforeunload, unmount

Signed-off-by: Florian Laabs <florian.laabs@wirecore.net>
In several field slots outline-none and the focus border sit in
different strings of the same slot (Select, MultiSelect, TreeSelect and
Tree search, Listbox, NativeSelect, PinInput, ColorPicker inputs), so the
new ring kept the style none - the focus ring test in CI caught it.
Every new field ring now sets outline-solid with its width.

Signed-off-by: Florian Laabs <florian.laabs@wirecore.net>
…tial focus on a component stories

Signed-off-by: Florian Laabs <florian.laabs@wirecore.net>
@wiifree
wiifree merged commit 4ba21ae into main Nov 28, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant