Repository navigation
fix(chat): chip copy-failure notices share one opener and name only what failed - #22124
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of 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 shipsInventory (6 items) — 5 justifiedIntent: 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.
[FIRST-PRINCIPLES-REVIEWED] d2dced1 Description read[DESCRIPTION-READ] 0fe7bdb75d1276c975013af0ba7aa315bc2cbb1ec5343624a8851ff6c08af80f That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of 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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of 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
[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 |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
|
|
|
|
|
bolichen97
left a comment
There was a problem hiding this comment.
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 copyand 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(... ) || pathtail as the path chip. - The harness
POST /api/file-kindsroute matches the batch call thatusePathKindmakes 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 })) |
There was a problem hiding this comment.
🟡 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.
5734dfb to
d2dced1
Compare
|
|
|
|
Review-ready at head d2dced1.
This Crew will not merge, approve, or enable auto-merge. |
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 …andThe 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
Ctrl/Cmd+click to copystays the cue for the gesture.Couldn’t copy — select the text to copy it manually). It already uses the shared opener.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 generateden-XA.json. The screenshot harnesswebsite/scripts/capture-inline-code-chip-cue.mjsasserts the new text. It also answers the batchedPOST /api/file-kindsprobe 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 (
grepon origin/main finds them only inInlineCode.tsx,ImgWithFallback.tsxand 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 getsCouldn’t copy the full session ID for chat-24., with noctrl,cmdorclickin it. A label that is the key getsCouldn’t copy the session ID chat-24-1784661951., without "full" or "for".website/src/test/MarkdownRenderer.inlineCodeCue.test.tsx: the path chip getsCouldn’t copy the path a.md.and names no gesture.website/src/test/MarkdownRenderer.brokenImage.test.tsx: the broken-image chip getsCouldn’t copy the image path 01-accounts.png.InlineCode.tsxandImgWithFallback.tsxreverted to origin/main, these three files fail 5 tests. With the fix they pass 74 of 74.--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.mjson a built dashboard twice. Run 1 used origin/main8768e91676, 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:

After:

Path chip refused:
Before:

After:

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

After:

Folder chip refused (
goal/worker):Before:

After:

Broken-image chip refused:
Before:

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
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)