Keep typed spaces in pill text inputs and add a textarea pill field type - #1512
Open
samantha-messer wants to merge 2 commits into
Open
samantha-messer wants to merge 2 commits into
samantha-messer wants to merge 2 commits into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).
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 inpillToPrompt. Thenumberbranch was checked and is unaffected (its stored value is a number or"", never a padded string).textareapill field type (schema, renderer, prompt assembly): a full-row, four-line box treated exactly liketextat 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
textareafor 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) — andnpm run buildsucceeds.protocolPills.test.ts.Scope and deviations
Scoped to the two spec items (the controlled-input fix and the
textareatype) plus their tests and adocs/FEATURE-NOTES.mddesign note. One addition beyond the spec:whitespace-pre-wrapon the Prompt Preview, without which a multi-linepromptTemplatepreviews as one run-on line. No invariant touched, no ADR needed. Dependency: the elcano-config wrap PR types two fields astextarea— merge this PR first (or those fields temporarily becometext).they become (there is no changelog file — ADR-0061): they prefill the
squash commit message, which
release.ymlpublishes as the releasenotes, with breaking changes and operator actions stated plainly
docs/<FEATURE>.md) added, if this ships a featuredocs/adr/, if this adds, weakens orreverses an invariant — required in the same PR
🤖 Generated with Claude Code
https://claude.ai/code/session_01MBAMDChYX61tgyYGaPWwG3
Generated by Claude Code