Skip to content

feat: a multiline answer and checkbox options for a question - #36

Merged
sinups merged 2 commits into
mainfrom
feat/elicitation-multiline
Oct 22, 2026
Merged

sinups merged 2 commits into
mainfrom
feat/elicitation-multiline

Conversation

@sinups

@sinups sinups commented Oct 22, 2026

Copy link
Copy Markdown
Owner

What changes

Two asks from the chat team, both additive — nothing changes for a form or a question that does not use them.

A string answer that runs over several lines

Every string in an elicitation form was a one-line input, however long the answer was meant to be: "What happened?" with room for 8000 characters showed about sixty of them.

  • ElicitationStringSchema takes multiline?: boolean and rows?: number.
  • With multiline: true the field is a Mantine Textarea with autosize, growing from three lines to eight; rows moves where it starts and is clamped to that range.
  • The label, the error, maxLength, onChange and onBlur are the ones a one-line field gets.
  • isCompactField returns false for it, so it never shares a row with another field.

Question options as the boxes people know

Multiple choice was lettered rows that behave like buttons, which reads as "pick one and move on" rather than "tick what applies".

  • QuestionConfig takes control?: 'button' | 'checkbox', button by default.
  • With checkbox the options are Mantine controls — squares for multi, circles for single — keeping the same answer, the same minSelections/maxSelections and the same option previews.
  • No keyboard shortcut was bound to the letters, so nothing is lost by replacing them.

Checks

yarn test (1571 tests, 6 of them new), yarn build and yarn size pass locally. Six new tests cover: a multiline field is a TEXTAREA while a plain one stays an INPUT, the line breaks reach onAccept as typed, the limit and the required behaviour hold; squares for a multiple choice with the answer unchanged, circles for a single choice, and the lettered rows without the flag.

One note on the required mark: Mantine's withAsterisk draws the star without setting the required attribute — that is how every field in the kit behaves — so the test asserts the behaviour (an empty required field is refused) rather than the attribute.

The full import grew to 242.2 KB gzip; its budget moves to 243.5 KB.

Every string in an elicitation form was one line, however long the answer was
meant to be: "what happened?" with room for 8000 characters was a field that
showed about sixty of them.

A string schema now takes `multiline: true`, and the field becomes a text area
that grows from three lines to eight — `rows` moves where it starts. It never
shares a row with another field, and the label, the limit and the required
mark behave as they do on a one-line field. Without the flag nothing changes.
Multiple choice was lettered rows that behave like buttons, which reads as "pick
one and move on" rather than "tick what applies". `control: "checkbox"` draws
the familiar boxes instead — squares for `multi`, circles for `single` — with
the same answer, the same bounds and the same previews. The lettered rows stay
the default.
@sinups
sinups merged commit d6de34a into main Oct 22, 2026
6 of 7 checks passed
@sinups
sinups deleted the feat/elicitation-multiline branch October 22, 2026 07:38
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