Skip to content

Release 0.14.0: a command palette, and empty values that stay empty - #18

Merged
zaiev merged 1 commit into
mainfrom
release-0.14.0
Nov 22, 2026
Merged

zaiev merged 1 commit into
mainfrom
release-0.14.0

Conversation

@zaiev

@zaiev zaiev commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Why

A command palette is a widget most modern applications carry and HeroUI's set lacks, so Command is ours in HeroUI's look, made headless first of Kobalte's selection hooks, its look a stylesheet of its own.

Setting a DatePicker's value to null after a date was typed left the date shown, and sent with a form (0002-11-21). The binding generator mapped TypeScript's T | null to Js.Nullable.t, which also holds the undefined Kobalte and the headless parts read as "no value given", and the hand-written components copied it. So the obvious conversion, Js.Nullable.fromOption, turned "empty" into "uncontrolled": the library did it in seven places, and every documented controlled example did it too. A value given to JavaScript as T | null is now Js.Null.t, which cannot hold undefined, so the wrong conversion no longer compiles; what Kobalte gives back stays Js.Nullable.t, as MELANGE.md asks. An abstract type of our own was weighed and dropped, since Js.Null.t says exactly this; a plain option cannot work, since Melange writes None as undefined.

Changes

  • Breaking: a value that may be empty is given as Js.Null.t: Kobalte's T | null props and arguments, and the value of the date, time, calendar and colour components, headless and HeroUI. Js.Nullable.fromOption → Js.Null.fromOption.
  • Breaking: Radio_group's value is string Js.Null.t; null controls it with none chosen, as React's.
  • Command: a command palette in HeroUI's look, Solidtype_headless.Command beneath it.
  • DatePicker, DateRangePicker, Calendar and RangeCalendar set to null after input are empty.
  • NumberField set to nan is empty (Kobalte's, fixed headless), and tells typed text once Enter or leaving commits it, as React's.
  • DateRangePicker's arrows, Backspace and a segment typed whole move between its start and end, as React's.

Verified

  • make test (1167 tests), make lint, and make docs with no warnings, on the combined tree.
  • Each port whose value may be empty set to null after input, in one test; NumberField's commits and the range's keys beside HeroUI's React twins; Js.Nullable.fromOption refused in test/does_not_compile.t.
  • The DatePicker page's Controlled example in the built site: a date typed, then Clear, empties the field and its form value.

A command palette is a widget most modern applications carry and HeroUI's
set lacks, so Command is ours in HeroUI's look, as Segment and TrendChip
are: a search in a dialog that filters a menu of commands, made headless
first of Kobalte's selection hooks, its look a stylesheet of its own.

Setting a DatePicker's value to null after a date was typed left the date
shown, and sent with a form. Kobalte and the headless parts read null as
controlled and empty and undefined as no value given; the binding
generator mapped TypeScript's `T | null` to Js.Nullable.t, which also
holds undefined, and the hand-written components copied it. So the
obvious conversion, Js.Nullable.fromOption, whose None is undefined,
turned "empty" into "uncontrolled": the library did it in seven places,
and every documented controlled example did it too.

A value given to JavaScript as `T | null` is now Js.Null.t, which cannot
hold undefined: Js.Null.fromOption None is null, and the wrong
conversion no longer compiles. The generator tracks which way a value
crosses, so what Kobalte gives back, an on_change's argument, stays
Js.Nullable.t, as MELANGE.md asks of a value JavaScript may give as null.
An abstract type of our own was weighed and dropped: Js.Null.t already
says exactly this. Taking a plain option cannot work, since Melange writes
None as undefined.

The same audit found RadioGroup with no empty value at all, now
`string Js.Null.t` as React's `string | null`; a NumberField that kept
its number when set to NaN, Kobalte's, fixed in the headless module; and,
compared with HeroUI's React components, a NumberField that told every
key where React tells a committed value, and a DateRangePicker whose keys
stopped at the edge of each end.
@zaiev
zaiev merged commit 7ec5a4c into main Nov 22, 2026
4 checks passed
@zaiev
zaiev deleted the release-0.14.0 branch November 22, 2026 22:30
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