Skip to content

fix(chat): trim follow-up chip labels at the character level - #7125

Merged
iamwhatever merged 1 commit into
kirodotdev:mainfrom
jingchaodev:fix/followup-chip-polish
Sep 1, 2026
Merged

fix(chat): trim follow-up chip labels at the character level#7125
iamwhatever merged 1 commit into
kirodotdev:mainfrom
jingchaodev:fix/followup-chip-polish

Conversation

@jingchaodev

Copy link
Copy Markdown
Contributor

Problem / Motivation

A truncated follow-up chip sometimes renders its ellipsis with a wide dead gap before the chip edge: line-clamp-1 ellipsizes after the last whole word that fits, so when the line break lands before a wide word (e.g. "…and video| support looks like") the label shows …video… followed by up to a word's width of empty space. Separately, nothing tells the model that option labels render on one line, so generated labels routinely exceed what a chip can show.

Why it matters

The gap looks broken — users read it as a rendering bug rather than truncation. And every over-long generated label guarantees a truncated chip, so the display-side trim gets exercised far more often than it needs to be.

What changed (motivation → approach → change)

  • ChipLabel swaps line-clamp-1 break-words for block truncate: text-overflow: ellipsis trims at the character level, so the ellipsis sits flush against the chip edge at every width. block is required because the chip button is not a flex container and overflow cannot clip an inline span. Same mechanism the collapsed tool labels use.
  • The injected [OPTIONS:] critical rule gains one sentence: keep each option label to at most ~8 words, putting detail in the body. Generation-side length control reduces how often truncation happens; the CSS trim remains the guarantee for labels that exceed it anyway.

Tests

  • website/src/test/FollowUpBar.test.tsx: assertions updated from line-clamp-1/break-words to truncate/block — 42/42 pass.
  • Backend files pinning the critical-rules block re-run: test/test_context.py, test/test_context_marker_neutralization.py, test/metrics/test_context_blocks.py, test/test_subagent_context_groups.py — 166 pass.
  • tsc -b clean, eslint clean on changed files, black/isort/flake8 clean on context.py.

Manual verification

Drove the existing capture/followup-chip-columns.html harness with the reported label across 12 viewport widths (840–1280px), before and after: every before-width shows the word-boundary gap, every after-width shows a flush character-level trim.

Screenshots / video

Before — line-clamp-1 ellipsizes after the last word, leaving a dead gap:

before

After — truncate trims per character, ellipsis flush:

after

Stacked with a guide line at the old ellipsis position:

stacked

Related Issues

no linked issue: found while dogfooding the follow-up chips shipped in #6609; the gap is a rendering behavior of the clamp mechanism, not a regression from that PR.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)
  • 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

Contribution License Agreement

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

line-clamp-1 ellipsizes after the last whole word that fits, so a label
whose line break lands before a wide word renders with up to a word's
width of dead space between the ellipsis and the chip edge. text-overflow
trims per character, so the ellipsis sits flush at every width. The span
is explicitly block because the chip button is not a flex container and
overflow cannot clip an inline span.

Also teach the injected [OPTIONS:] instruction to keep option labels
short (at most ~8 words): the chip row renders each label on one line,
so generation-side length control reduces how often truncation happens
at all, while the CSS trim remains the guarantee.
@jingchaodev
jingchaodev requested a review from a team August 30, 2026 21:58
@jingchaodev
jingchaodev requested a review from a team as a code owner August 30, 2026 21:58
@jingchaodev
jingchaodev requested a review from bolichen97 August 30, 2026 21:58
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Aug 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings

Reviewed 7c3ca70acbcf6d979d009ec9045dc4d02c352938 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 7c3ca70

@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Fable 5, fork) — ✅ PASS

UX-level review of 7c3ca70acbcf6d979d009ec9045dc4d02c352938 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

truncate is the established truncation idiom across the product (15+ components), the full label remains recoverable via title and the accessible name, and the prompt-side ≤8-word rule reduces how often truncation fires at all. No lens produced a finding that survives the kill-filter — character-level ellipsis is the platform convention, and the new screenshots aren't materialized in this checkout but the described change matches the code exactly.

UX-Verdict: PASS

Character-flush ellipsis matches the product's standard truncate idiom, keeps full-label recovery via hover/accessible name, and the generation-side length rule reduces truncation at the source.

[UX-REVIEWED] 7c3ca70

@github-actions

Copy link
Copy Markdown
Contributor

Opus 4.8 Review (fork) — ✅ no blocking findings

Reviewed 7c3ca70acbcf6d979d009ec9045dc4d02c352938 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 7c3ca70

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — ✅ PASS

Design-level review of 7c3ca70acbcf6d979d009ec9045dc4d02c352938 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Tests pin substrings/markers, not the full literal — the claim in the description holds. The chip width cap (followup-chip, 18–26rem) means truncate clips as intended, and the prompt sentence lands in the shared tail, which already speaks in chip terms for both dashboard and channel variants. Both halves of the fix (display-side guarantee + generation-side length guidance) address the actual causes, the mechanism matches what collapsed tool labels already use, and no spec quotes the prompt prose verbatim. No design-level findings survive.

Design-Verdict: PASS

Character-level trim fixes the actual clamp mechanism, prompt guidance attacks the label-length cause, and both reuse existing patterns — sound and proportionate.

[DESIGN-REVIEWED] 7c3ca70

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — ✅ PASS

Premise-level review of 7c3ca70acbcf6d979d009ec9045dc4d02c352938 via the fork AI-review pipeline — 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/CONCERNS are advisory.

All checks complete. The screenshots follow the documented temp-screenshots/README.md convention, the CSS swap adopts the idiom the repo already prescribes for single-line flex labels (ToolCallLine.tsx:88), and the prompt sentence lands in the shared _CRITICAL_RULES_TAIL covering both variants. Final review:

First-Principles-Verdict: PASS

A dogfooded rendering defect fixed at both levels — display trim at character granularity, plus the generation-side cause (over-long labels) addressed in the same prompt block.

What this change ships

Intent: make truncated follow-up chips look deliberately truncated instead of broken, and make the model stop generating labels that need truncating — a FIX.

  1. Chip ellipsis now sits flush at the chip edge (character-level trim) — justified; adopts the repo's own idiom (ToolCallLine.tsx:88 documents truncate over line-clamp-1 for exactly this).
  2. Model told to keep option labels to ~8 words — justified, cause-level; lands once in the shared _CRITICAL_RULES_TAIL, so both dashboard and channel variants get it (0 unfixed variants).
  3. Three before/after PNGs committed under temp-screenshots/followup-chip-polish/ — justified by documented convention (temp-screenshots/README.md mandates commit-and-SHA-pin; .gitignore names the directory a committed deliverable).

No new config key, flag, or exported surface: the diff adds prose to an existing constant and swaps CSS classes, so consumer-count and one-way-door lenses have nothing to bite. The 4 other line-clamp-1 sites (SourcesList.tsx:76, ToolDetails.tsx:145, RemoteArtifactCard.tsx:131, OverviewView.tsx:342) share the mechanism but not the named harm — none is a bordered chip whose right edge makes the word-boundary gap read as breakage — so they are not unfixed siblings.

[FIRST-PRINCIPLES-REVIEWED] 7c3ca70

@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 Aug 30, 2026
@iamwhatever
iamwhatever merged commit bc11fba into kirodotdev:main Sep 1, 2026
71 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 1, 2026
@bolichen97

Copy link
Copy Markdown
Collaborator

Open PR relationship audit

This is a consolidated, point-in-time code-level audit note. It compares complete merge-base diffs and current/merged code; it does not treat a shared topic as duplication or partial coverage as completion.

Relationship findings

  • PR #7157 is OVERLAPPING relative to this PR. The goals differ or the implementations can complement each other; this is not a duplicate claim. Recommended action for PR #7157: MERGE_DISCUSSION. The merged PR is the trimming mechanism 7157 must work under, not an implementation of it. Already absorbed into 7157's base. Files: website/src/components/FollowUpBar.tsx, src/kiro_crew/context.py.

No PR, Issue, label, branch, or review state was changed by the relationship-note portion of this audit.

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

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants