Skip to content

feat(chat): punctuate joined option picks like a sentence - #36085

Open
smeyffret wants to merge 1 commit into
mainfrom
feat/option-chip-punctuation
Open

smeyffret wants to merge 1 commit into
mainfrom
feat/option-chip-punctuation

Conversation

@smeyffret

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Picking several follow-up options fills the composer with text that reads like sentences.

The option chips joined the draft and every pick with , . Two capitalised picks read "Merge it now, Show me the diff", and a draft that already ended a sentence got a second separator: "Looks good., Merge it now".

Why it matters

The composer text is what gets sent. People who type a short note and then click one or more chips have to fix the punctuation by hand before they send.

Not a goal

  • Re-casing labels. Option labels often start with a name or an identifier (CR-123, Kiro), so a lowercased first letter would change them.
  • The app SDK composer's multi-select path (app-sdk/useComposerDraft.ts). It reads picks back from the draft by their , separators, so changing it needs its own change to that read-back. Its single-select path already goes through followUpToggle and gets the new rule.

What changed (motivation → approach → change)

renderTail in lib/followUpToggle.ts now picks the separator before each piece instead of always using , :

Text before the piece Next piece Separator
ends with . ! ? ; : , or …, with optional closing quotes or brackets any a space
anything else starts with an uppercase letter .
anything else anything else ,

The owned-span model is unchanged: the tail is still rendered from { base, options }, so removing a pick re-renders the separators around it and the "user edited the tail" check still compares against the exact rendered text.

Backwards compatibility

Compatible. No setting, API or stored state changes. Only the text a chip click writes into the composer changes.

Tests

  • followUpToggle.test.ts: a draft ending with a period, a question mark, a comma, or a closing quote after a period gets only a space; two capitalised picks join with . ; a lowercase pick joins with , ; removing the middle of three picks re-renders the separators; a label ending with . gets only a space before the next pick.
  • ChatPage.followUpToggle, ChatPane.followUpOptions and useComposerDraft (single-select): expected strings updated to the new separators. The comma-bearing label tests (fix(chat): remove only the complete generated suffix on a ChatPane chip un-toggle #7616 F1) use lowercase labels and keep , .

Local gates: tsc -p tsconfig.app.json, eslint on the changed files, and vitest on the follow-up, composer, ChatEmbed and QuickSend test files all pass.

Manual verification

Built SPA in two isolated pods with fake data, one on main and one on this branch. One session ends with [OPTIONS: Merge it now | Show me the diff | Run the tests].

Screenshots / video

Before After
Two picks Two picks before: comma join Two picks after: sentence join
"Looks good." then one pick Draft ending with a period before: doubled separator Draft ending with a period after: single space

Dark theme, two picks: Two picks after, dark theme

Related Issues

N/A: no issue filed.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Nov 12, 2026
Clicking option chips joined the draft and each pick with ", ", which
produced "Looks good., Merge it now" and "Merge it now, Show me the
diff". A draft that already ends with punctuation now gets only a
space, a capitalised pick starts a new sentence (". "), and a
lowercase pick keeps ", ". Labels are never re-cased.
@iamwhatever
iamwhatever force-pushed the feat/option-chip-punctuation branch from 3d6d5c8 to a45cca5 Compare November 17, 2026 22:38
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of a45cca5a71cdf3ceb76c848ad2adb3d14000cb59 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks: every item is part of the one stated Goal, and the defect is reproduced in the description ("Looks good., Merge it now").

What this change ships

Inventory (4 items) — 4 justified

Intent: let people click several option chips and send the composer text without fixing its punctuation by hand. This is a FIX.

  1. A draft already ending in . ! ? ; : , or … now gets just a space before a pick, not a second separator. — justified
  2. Picks starting with a capital letter now join with . instead of , . — justified
  3. Picks starting with a lowercase letter still join with , . — justified
  4. Removing a pick re-renders the separators around the picks that remain. — justified

[FIRST-PRINCIPLES-REVIEWED] a45cca5

Description read

[DESCRIPTION-READ] 9346849b6e398055ffc2ef879537d7fbddcda4c9281301517d66f1ccca64d441

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of a45cca5a71cdf3ceb76c848ad2adb3d14000cb59 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks: this changes only the punctuation that chip picks write into the composer. Screenshots show the before and after for both cases and for dark mode, and the blind reader read the new joins as clean sentences.

Notes

  • When the draft doesn't end a sentence, separatorBefore still adds . before a capitalised pick. A draft like "Deploy to" followed by the pick "Staging" becomes "Deploy to. Staging". When a draft has no closing punctuation, use a space before the pick and leave the full stop for joins between picks.

[UX-REVIEWED] a45cca5

Description read

[DESCRIPTION-READ] e1c8f11d1d9bd2034f26c1b6135d7744e8178773375285668377af2e1ca934e0

That sha256 names everything this verdict read: the PR description, plus the 8 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of a45cca5a71cdf3ceb76c848ad2adb3d14000cb59 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: this is a small, reversible change to a pure render function, the owned-span model is untouched, and screenshots of this revision are attached.

Notes

  • Chat chips now join multiple picks with . , but the app SDK multi-select (useComposerDraft.ts) still joins with , . The same chip action now writes different text depending on the surface. Change the separator and that composer's , -based read-back together in a follow-up, so the two paths don't drift apart for good.

[DESIGN-REVIEWED] a45cca5

Description read

[DESCRIPTION-READ] d3a993cf2167f8114d9811cc2d2640cda3d4fafd877b09342b70124c8da2203b

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed a45cca5a71cdf3ceb76c848ad2adb3d14000cb59 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] a45cca5

Verdict parsed from the review's SHA-scoped output markers for commit a45cca5a71cdf3ceb76c848ad2adb3d14000cb59.

False positive or not applicable? A repository writer can comment:
/ai-review override fable a45cca5a71cdf3ceb76c848ad2adb3d14000cb59 false-positive: <reason, 20 to 500 characters>

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of a45cca5a71cdf3ceb76c848ad2adb3d14000cb59 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] a45cca5

False positive or not applicable? A repository writer can comment:
/ai-review override gpt a45cca5a71cdf3ceb76c848ad2adb3d14000cb59 false-positive: <reason, 20 to 500 characters>

@iamwhatever
iamwhatever marked this pull request as ready for review November 18, 2026 00:07
@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners November 18, 2026 00:07
@iamwhatever
iamwhatever self-requested a review November 18, 2026 00:07
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 18, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, but it is held at tier 2: the title's category is not one of fix, test, chore, refactor.

renderTail now chooses the separator before each piece: a space after existing punctuation, '. ' before a capitalised piece, otherwise ', '. The function is pure and gives the same result for the same input, and every caller (append, remove, single-select ownership checks in ChatPane, followUpChips and the useComposerDraft single-select path) compares against the same renderTail, so the owned-span model and the edited-tail check still work. Nothing else in the repo reads chip text back by ', '. The SDK multi-select path is untouched, as the description says. The code matches the description's table, and the new unit tests cover each separator rule and re-rendering after a middle removal. CI is green apart from the Publish readiness signal meta-check.

Tier: 2, held for a person: the title's category is not one of fix, test, chore, refactor.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit a45cca5a71 · 169 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

This changes behaviour users already rely on, so it needs a design sign-off from a maintainer before it can merge. A maintainer will post the decision here.

To propose a design, follow the request-for-change process in CONTRIBUTING.md (docs/request-for-change/).

Review result on this head: no blocking findings. PR Readiness is green. The change stays inside renderTail and the new separatorBefore in website/src/lib/followUpToggle.ts. Every chat caller still compares the draft against renderTail(owned) for an exact match, so the owned-span check from #7616 still holds. The new test that removes the middle of three picks pins that case well. The SDK multi-select read-back by , is left alone, as the "Not a goal" section says.

Optional:

  • A draft with no closing punctuation followed by a capitalised pick now reads "please. Go" or "Deploy to. Staging" (pinned at useComposerDraft.test.tsx:617). Consider a plain space or , between an unpunctuated draft and the first pick, and keep . between picks. You could also reply to the UX note to say the current shape is intended.
  • The substring-collision fixtures in ChatPage.followUpToggle.test.tsx:228/:238 and ChatPane.followUpOptions.test.tsx:197/:213 still use , ("Please, Google"). The chips now write . , so these tests no longer check the case their comments describe. Re-punctuating them ("Please. Google") would restore that.
  • ENDS_WITH_SEPARATOR does not match full-width punctuation (。!?,:;), so a ja or zh draft still gets a doubled separator such as "了解しました。. Merge it now". This is no worse than main.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants