Skip to content

Keep typed spaces in pill text inputs and add a textarea pill field type - #1512

Open
samantha-messer wants to merge 2 commits into
mainfrom
claude/eoc-wrap-protocol-update-39gznq
Open

samantha-messer wants to merge 2 commits into
mainfrom
claude/eoc-wrap-protocol-update-39gznq

Conversation

@samantha-messer

Copy link
Copy Markdown
Contributor

What changed, and why

Two small platform changes for the End-of-Campaign Wrap rework (the rest of that work is bundle config in elcano-config).

  • Fix: pill text inputs strip typed spaces. The controlled input rendered through asText(), which trims — so "Meridian " was stored with its trailing space but re-rendered as "Meridian", eating the space on every keystroke; a two-word client name could not be typed. Inputs now render the raw string (asInputText); trimming stays in pillToPrompt. The number branch was checked and is unaffected (its stored value is a number or "", never a padded string).
  • Add textarea pill field type (schema, renderer, prompt assembly): a full-row, four-line box treated exactly like text at prompt-assembly time — interior line breaks survive, only the ends are trimmed. The Prompt Preview keeps line breaks (whitespace-pre-wrap) so a multi-line template reads as written.

Why: Jeanne currently copies the wrap form's output into chat and re-edits it every run, partly because the form is too rigid — no spaces, no free text. The follow-up elcano-config PR uses textarea for its KPI and Additional-context fields.

How you verified it

  • cd web && npm run lint && npm run typecheck && npm run test — all clean (vitest 153 files / 1630 tests) — and npm run build succeeds.
  • New tests: the "Meridian Auto" keystroke round-trip (run against the pre-fix component to confirm it fails there), raw-in-the-box / trimmed-in-the-prompt, textarea render + full-row span + multi-line round-trip into preview and prompt, plus helper/assembly cases in protocolPills.test.ts.

Scope and deviations

Scoped to the two spec items (the controlled-input fix and the textarea type) plus their tests and a docs/FEATURE-NOTES.md design note. One addition beyond the spec: whitespace-pre-wrap on the Prompt Preview, without which a multi-line promptTemplate previews as one run-on line. No invariant touched, no ADR needed. Dependency: the elcano-config wrap PR types two fields as textarea — merge this PR first (or those fields temporarily become text).


  • The title and "What changed, and why" are written for the release notes
    they become (there is no changelog file — ADR-0061): they prefill the
    squash commit message, which release.yml publishes as the release
    notes, with breaking changes and operator actions stated plainly
  • A design note (docs/<FEATURE>.md) added, if this ships a feature
  • An ADR added or superseded in docs/adr/, if this adds, weakens or
    reverses an invariant — required in the same PR
  • The diff is scoped to one change (no unrelated refactors)

🤖 Generated with Claude Code

https://claude.ai/code/session_01MBAMDChYX61tgyYGaPWwG3


Generated by Claude Code

samantha-messer and others added 2 commits September 15, 2026 13:02
The empty-state quick-start form rendered its text input through asText(),
which trims. Because the input is controlled, "Meridian " was stored with
its trailing space but re-rendered as "Meridian", so the space vanished on
every keystroke and a two-word client name could not be typed. Inputs now
render the raw string (asInputText); trimming happens once, in pillToPrompt.
The number input was checked and is unaffected (its stored value is a number
or "", never a padded string).

Add "textarea" to PillFieldType: a full-row, four-line box with the same
controlled-value handling, for free-text inputs such as a KPI list. Prompt
assembly treats it exactly like text (interior line breaks survive, ends are
trimmed), and the Prompt Preview now keeps line breaks so a multi-line
template reads as written.

Tests: the "Meridian Auto" keystroke round-trip (fails on the old renderer),
raw-in-the-box / trimmed-in-the-prompt, textarea render + full-row span +
multi-line round-trip into preview and prompt, and the helper/assembly cases
in protocolPills.test.ts. Design note in docs/FEATURE-NOTES.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MBAMDChYX61tgyYGaPWwG3
… kept

The new text-input comment cited "(#3a)", which reads as a GitHub issue
number in this repo; say what happened instead. The pillToPrompt docblock
said a blank field's token is dropped, but the code (and the new tests)
leave it in place so the agent can see what was intended.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MBAMDChYX61tgyYGaPWwG3
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