mirror of
https://github.com/bitbaum/chatkit.git
synced 2026-12-04 05:47:38 +01:00
* feat(field): DictationField in a form — name, error, submit keys, field-level focus (0.27.0) Loki's 36 hand-made text areas could not become DictationField because a form needs props the field did not pass through (measured: onKeyDown 10, maxLength 9, id 7, autoFocus 7, disabled 5, onBlur 2, onFocus 1, name 2, spellCheck 1, plus validation errors on the field). - name, autoFocus, readOnly (no mic, no Improve, no Undo) - invalid / error: aria-invalid, the frame in --ck-danger, the error under the field as role=alert, error and hint linked with aria-describedby - onKeyDown, and onSubmit owned by the package: Cmd/Ctrl+Enter in a text area, Enter in one line; never while composing, disabled, read-only or during a take - onFocus / onBlur for the whole field: the mic is not a blur, and a blur during a take is held until its words reach onValueChange - inputProps for spellCheck, autoComplete, inputMode, aria-*, data-*; managed props win - Enter in Improve's instruction box applies it Tests: server markup in render.test.js; a Strict Mode form fixture in browser-field.mjs at 390px and desktop, light and dark, and 320px with an error shown. Version 0.27.0 (0.26.0 is already on npm). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * fix(field): Improve at work is not a blur; Enter never sends the native form mid-take Review findings on the 0.27.0 DictationField form props: - Improve disables its own box and button while it works, so focus fell off with nowhere to go and the field reported a blur. Improve at work now counts as busy, like a take. - With onSubmit, Enter in a one-line field (Shift+Enter, during a take, read-only) no longer runs the browser's implicit form post. - error="" or 0 is no error: no danger frame, no aria-invalid with nothing said. - inputProps.style no longer reaches the box (16px text is the package's). - The form fixture loads a development bundle, so Strict Mode is exercised. - README and CHANGELOG: a held blur is not reported if the host unmounts the field; the hint's aria-describedby is the one markup change. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * fix(field): a dictated take or a rewrite never passes the field's maxLength The attribute stops typing and pasting at the limit and nothing else: text the field sets itself went straight past it, and the form then refused or cut what the person had said. Found reviewing Loki's converted fields, which set 300 and 1000. clipToMaxLength cuts at the limit, back to a whole word when one is within 24 characters, and is exported. Unit test in core.test.js. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * release 0.27.1: dictation and Improve respect a field's maxLength The fix was pushed after #85 had merged, so 0.27.0 went out without it. It gets its own patch release and changelog entry. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 --------- Co-authored-by: Claude <noreply@anthropic.com>