Skip to content

fix(chat): chip copy-failure notices share one opener and name only what failed - #22124

Merged
chenmingwei23 merged 1 commit into
mainfrom
fix/14294-chip-failure-notices
Oct 19, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
fix/14294-chip-failure-notices

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: When an inline chip's copy fails, its notice starts the same way as every other chip's and says only what could not be copied.

The inline chips in a chat reply (copy chip, session chip, folder chip, path chip, broken-image chip) show a red notice when the clipboard refuses a copy. Today they use two openers for the same event: Couldn’t copy … and The copy failed. Ctrl/Cmd+click copies …. The second kind names the Ctrl/Cmd+click gesture in present tense, right after that gesture failed. In UX review on #14036 a blind reader took it for advice to try a different trick. When the session chip's label is already the full key, the notice says "the full session ID for chat-42-1758000000", which names the key twice. The broken-image notice says "Couldn’t copy the image path" and never says which image.

Why it matters

The notice shows at the one moment a reader needs to know what went wrong. Two openers make the reader ask whether these are two different failures. A sentence that names a gesture reads as an instruction, so the reader retries the same refused copy, or goes looking for some other action. A notice that names no object leaves the reader guessing which image failed when a reply has several.

Not a goal

  • Changing the chips' tooltips. Ctrl/Cmd+click to copy stays the cue for the gesture.
  • Changing the copy chip's own notice (Couldn’t copy — select the text to copy it manually). It already uses the shared opener.
  • Changing where the notice bubble opens, or how long it stays.
  • Adding new recovery steps to the notices.

What changed (motivation → approach → change)

The notices came from the separate chips, and each chip had its own wording. So the gesture wording from #14036 ended up in the session, folder and path notices but not in the other two.

All five notices now open with the copy chip's Couldn’t copy, followed by the thing that failed: the session ID <key>., the full session ID for <label>., the folder path <label>., the path <file name>., the image path <file name>.. None of them mentions a gesture. The session chip uses the short form when its label already equals the key, and the long form when the label is a short name. The broken-image chip now ends with the file name of its path, the same way the path chip does.

The old catalog keys are renamed to match the new text. This covers website/src/i18n/locales/en.manual.json, the 11 translated catalogs, and the generated en-XA.json. The screenshot harness website/scripts/capture-inline-code-chip-cue.mjs asserts the new text. It also answers the batched POST /api/file-kinds probe the chips use now. Without that route the harness could not confirm any path chip, so it failed on main before it took any frame.

Backwards compatibility

Compatible: only user-facing text and the internal catalog keys behind it change. Nothing outside these chips reads those keys (grep on origin/main finds them only in InlineCode.tsx, ImgWithFallback.tsx and the catalogs).

Removes nothing: every notice still renders when the copy is refused. Only its wording changes, and the renamed keys have no other readers.

Tests

  • website/src/test/MarkdownRenderer.sessionChip.test.tsx: a short-name label gets Couldn’t copy the full session ID for chat-24., with no ctrl, cmd or click in it. A label that is the key gets Couldn’t copy the session ID chat-24-1784661951., without "full" or "for".
  • website/src/test/MarkdownRenderer.inlineCodeCue.test.tsx: the path chip gets Couldn’t copy the path a.md. and names no gesture.
  • website/src/test/MarkdownRenderer.brokenImage.test.tsx: the broken-image chip gets Couldn’t copy the image path 01-accounts.png.
  • With InlineCode.tsx and ImgWithFallback.tsx reverted to origin/main, these three files fail 5 tests. With the fix they pass 74 of 74.
  • Determinism: the three files pass 74/74 in three shuffled runs (--sequence.shuffle, seeds 14291, 14292, 14293).
  • I18N_BASE_REF=origin/main npx vitest run src/i18n: 1022 of 1022 pass (key parity, pseudolocale, French U+202F, hi/bn register). tsc -p tsconfig.app.json, eslint and the repository's semgrep rules are clean.

Manual verification

I ran node scripts/capture-inline-code-chip-cue.mjs on a built dashboard twice. Run 1 used origin/main 8768e91676, with only the file-kinds route added to a throwaway copy of the harness. Run 2 used this branch. Every assertion passes on this branch, including the exact notice text for the session, path and broken-image refusals.

Screenshots / video

Session chip refused, label is the key:

Before:
Session copy failed, before

After:
Session copy failed, after

Path chip refused:

Before:
Path copy failed, before

After:
Path copy failed, after

Session chip refused, label is a short name (chat-42), so the long form shows:

Before:
Session short name copy failed, before

After:
Session short name copy failed, after

Folder chip refused (goal/worker):

Before:
Folder copy failed, before

After:
Folder copy failed, after

Broken-image chip refused:

Before:
Broken image copy failed, before

After:
Broken image copy failed, after

Related Issues

Closes #14294

Follows #14036.

Pattern harvest

Not generalizable: each chip passed its own notice text to the shared hook, and these strings drifted apart through separate review rounds. No mechanical rule can tell a failure notice that names an object from one that names a gesture.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|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

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 19, 2026 08:10
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 19, 2026
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of d2dced15fe5dc9247b9d411ee064cb83433fec48 — 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.

First-Principles-Verdict: PASS

Check that #14294 records a decision to drop #14036's "The copy failed. Ctrl/Cmd+click copies …" wording, because this PR deletes the comment that pinned it.

What this change ships

Inventory (6 items) — 5 justified

Intent: when an inline chip's copy fails, the notice should say only what failed, worded the same way on every chip. This is a FIX.

  1. The session, folder and path chip notices no longer name the Ctrl/Cmd+click gesture. They now open with "Couldn’t copy …" — justified
  2. When a session chip's label already is the key, its notice uses the short "the session ID " form — justified
  3. The broken-image notice now names the image's file name — justified
  4. Catalog keys are renamed in en.manual, 11 translations and en-XA — justified
  5. The screenshot harness now answers the batched POST /api/file-kinds probe — rides along; declared, and the harness failed on main without it
  6. The harness and unit tests now expect the new notice text and no gesture word — justified

[FIRST-PRINCIPLES-REVIEWED] d2dced1

Description read

[DESCRIPTION-READ] 0fe7bdb75d1276c975013af0ba7aa315bc2cbb1ec5343624a8851ff6c08af80f

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

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of d2dced15fe5dc9247b9d411ee064cb83433fec48 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] d2dced1

Description read

[DESCRIPTION-READ] d4c32a9aa9a71ed887703fe3ce4c8c45cbb551d0025b36c4f221b2b0ed276d66

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

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] d2dced1

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable d2dced15fe5dc9247b9d411ee064cb83433fec48: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🟡 CONCERNS

UX-level review of d2dced15fe5dc9247b9d411ee064cb83433fec48 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

The broken-image notice names a file the reader never sees: "sidebar-before.png" appears nowhere on screen, because the chip only shows "Sidebar before the rewrite".

Watch

  • The image notice names a different thing than the chip shows. ImgWithFallback.tsx builds the label from basenameOf(path), but the chip shows the image's alt text. So "Couldn't copy the image path sidebar-before.png." names something that isn't on screen (shot-10). The blind reader said: "That name 'sidebar-before.png' doesn't appear anywhere else on screen; the box only says 'Sidebar before the rewrite'." The PR's goal is to tell the reader which image failed, and the notice doesn't do that when the alt text and file name differ. Severity: rare event × mild confusion × every time it happens. Fix: name the alt/caption text when there is one (the image path for "<alt>"), and fall back to the file name when there isn't.
  • The path notice names a shorter path than the chip shows. The chip shows /home/user/project/website/vitest.config.mts, and the notice says only "the path vitest.config.mts" (shot-04). The blind reader said: "The chip shows a long location, but the message names only the last part." This shortening existed before this PR, but the PR now copies the same pattern to the image chip. Severity: low frequency × low impact. Fix: end the notice with the label text the chip actually shows, truncated the way the chip truncates it.

[UX-REVIEWED] d2dced1

Description read

[DESCRIPTION-READ] a8e5339ea187e1ce8cd46095d1f950d104fd1ca3be45b241d2ea6cd052a31305

That sha256 names everything this verdict read: the PR description, plus the 13 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

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] d2dced1

False positive or not applicable? A repository writer can comment:
/ai-review override gpt d2dced15fe5dc9247b9d411ee064cb83433fec48: <one-sentence reason>

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • The path notice shows only the file name (span=03cb78b54372)

rebutted: the file-name tail is the path chip's wording on main (basenameOf(raw…) in InlineCode.tsx, set by #14036); this PR changes only the opener in front of it.
The tail is deliberate: the bubble can be clamped away from its chip, and the file name still says which chip it answers. The full path is long and would widen the bubble over the reply.
What the copy carries is the full path, and the chip's tooltip and accessible name already show it.
Severity Low (Watch); a different object form is new scope for #14294, which asked only for one opener, no gesture, and the object named.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • The image notice now covers more of the reply (span=e0e61e745b0a)

rebutted: #14294 asks for this exact form: "append the path's tail as the path chip does, so the reader knows which image and what to retry" (UX suggestion 354b844823c4 on #14036).
The chip copies the PATH, not the alt text, so naming the path's file is naming the object that failed. An alt-text form would name a different thing from what the copy carries.
The bubble opens above the last-line chip and stays off the footer row (harness assertion passes); it is a 3s flash with pointer-events none, so it hides nothing the reader cannot see a moment later.
Severity Low (Watch). The evidence gaps (folder chip, session short-name form) are now in the PR body as before/after frames.

@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Oct 19, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

answered: #14294 is the deferred-finding issue #14036 itself filed. Its three tasks are #14036's own UX Review spans (05eb87ef3031, 60a6ef3b2474, 5955e7289014), accepted on that PR and postponed so its green head stayed the placement fix.
The issue records the lane's conclusion that all three gesture-in-notice wordings tried on #14036 were misread, and that the Ctrl/Cmd+click to copy tooltip stays the gesture's cue. This PR keeps that tooltip unchanged.
The issue is tier:T3, so the maintainer's design sign-off on #14294 is still the merge gate; this PR does not claim it.

@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Oct 19, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

answered: the old comment ("the gesture leads the sentence ... never as advice") was a claim about how readers take the wording. A unit test cannot check that; only a reader can.
The evidence against it is #14036's own UX Review blind-reader runs, three wordings each misread, which #14294 records. The new comment cites #14294 for that reason.
What a test CAN pin is now pinned: each refused notice names no ctrl, cmd or click (sessionChip and inlineCodeCue tests), and the exact object text per chip.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • "the path " names something other than what failed to copy (span=71b064f40b8a)

rebutted, same ruling as span 03cb78b54372 on this head: the file-name tail is main's path-chip wording from #14036 ("copies the path a.md"); this PR changes only the opener, and #14294 asked the image notice to "append the path's tail as the path chip does".
The tail keeps the bubble short and still says which chip it answers when the clamp pulls it off the chip; the full path is in the chip's accessible name (Open <full path>).
Severity Low (Watch). If the maintainer prefers it, "Couldn’t copy the path to ." is a one-string change per catalog; left as the maintainer's call rather than a new round.

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. The linked issue is tier:T3, so the remaining gate is a design sign-off from a maintainer. I did not approve for that reason.

Head reviewed: 5734dfb.

What I checked:

  • All five notices now open with Couldn’t copy and name no gesture. The old keys have no other readers on main (only InlineCode.tsx, ImgWithFallback.tsx and the catalogs).
  • The session chip picks the short form only when label === sessionKey. Both branches have a unit test.
  • The broken-image notice uses the same basenameOf(... ) || path tail as the path chip.
  • The harness POST /api/file-kinds route matches the batch call that usePathKind makes on main.
  • The UX lane's "the path " concern was answered on this head. I leave that wording to the maintainer.

One should-fix inline: the folder chip notice changed but no test pins its new text.

children: React.ReactNode
}) {
const { copied, press, failureBubble } = useTitleCuedCopy(folderPath, i18nT('components.markdownRenderer.the_copy_failed_ctrl_cmd_click_copies_the_folder_path_label', { label }))
const { copied, press, failureBubble } = useTitleCuedCopy(folderPath, i18nT('components.markdownRenderer.couldnt_copy_the_folder_path_label', { label }))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 The folder chip notice changed, but no test pins its new text

This PR changes five notices. Unit tests pin the session (both forms), path and broken-image text, and two of them also assert no ctrl|cmd|click. The folder chip's notice is the only changed one with no assertion in a unit test or in the harness. If a later edit puts the gesture back into this one string, no test goes red.

const { copied, press, failureBubble } = useTitleCuedCopy(folderPath, i18nT('components.markdownRenderer.couldnt_copy_the_folder_path_label', { label }))

Why it matters: the goal is that every chip's notice shares the opener and names no gesture. Four of five are pinned; the fifth can drift again, which is how the strings drifted apart before.

Suggestion: in website/src/test/MarkdownRenderer.folderChip.test.tsx, add one refused-copy case: Ctrl/Cmd+click a folder chip with the clipboard refusing, then assert /^Couldn’t copy the folder path goal\/worker\.$/ and not.toHaveTextContent(/ctrl|cmd|click/i). If an existing test already pins this notice, tell me and I will withdraw this.

@iamwhatever
iamwhatever force-pushed the fix/14294-chip-failure-notices branch from 5734dfb to d2dced1 Compare October 19, 2026 09:14
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in the website/src/i18n/locales catalogs since this head went green (d3e6f27 -> 6088686); CI re-running. New head d2dced1. Locally on this head: i18n gate 1022/1022, chip tests 97/97, tsc clean.

@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 Oct 19, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • The image notice names a different thing than the chip shows (span=41409f6efa33)

rebutted, same ruling as e0e61e745b0a on 5734dfb: #14294 asks for the path's tail on this notice ("append the path's tail as the path chip does", UX suggestion 354b844823c4 on #14036).
The chip copies the PATH, not the alt text; the notice names what failed to copy. The full path is in the chip's tooltip.
Severity Low (Watch). Naming the image by its alt text instead is a one-line change in ImgWithFallback.tsx; left as the maintainer's call rather than a new round.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • The path notice names a shorter path than the chip shows (span=26919e380c30)

rebutted, same ruling as 03cb78b54372 and 71b064f40b8a: the file-name tail is main's path-chip wording from #14036; this PR changes only the opener in front of it.
This is the third round of the same wording point; per the prepare-PR loop it goes to the maintainer instead of another code round. One-string option if wanted: "Couldn’t copy the path to {{label}}."

@iamwhatever

Copy link
Copy Markdown
Contributor Author

answered: yes. #14294 is the deferred-finding issue #14036 filed for its own UX Review spans 05eb87ef3031, 60a6ef3b2474 and 5955e7289014, accepted there and postponed.
Its body records that the three gesture-in-notice wordings tried on #14036 were each misread, and that the Ctrl/Cmd+click to copy tooltip stays the gesture cue. The replacement comment cites #14294 for that.
The issue is tier:T3, so maintainer sign-off on #14294 remains the merge gate.

@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 Oct 19, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Review-ready at head d2dced1.

  • PR Readiness: passed (readiness: passed); all 103 checks green; mergeable; the green is fresh against main.
  • Design and First Principles: PASS, punchlines answered. UX: CONCERNS (advisory), each Watch item answered on this head.
  • Open for the maintainer: (1) Inline chip failure notices: one "Couldn't copy" opener, no gesture in the notice, the object named plainly #14294 is tier:T3, so the design sign-off is yours. (2) UX has raised the same wording point three rounds running: the path and image notices name the file name, not the full path or the image's alt text. Answered without code changes; the one-string alternative is in the disposition if you want it.
  • Known, left on purpose: a doc comment in website/src/components/markdown/copyFeedback.tsx (lines 152-164) still describes the old session/broken-image wording. No lane raised it, and fixing it would add a 7th code file past this item's budget.

This Crew will not merge, approve, or enable auto-merge.

@chenmingwei23
chenmingwei23 merged commit af3c3fa into main Oct 19, 2026
103 of 104 checks passed
@chenmingwei23
chenmingwei23 deleted the fix/14294-chip-failure-notices branch October 19, 2026 14:08
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 19, 2026
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.

Inline chip failure notices: one "Couldn't copy" opener, no gesture in the notice, the object named plainly

3 participants