Skip to content

fix(chat): open a chip's bubble off the words it reports on, and name the recovery - #14036

Merged
iamwhatever merged 1 commit into
mainfrom
fix/inline-chip-followup
Sep 26, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
fix/inline-chip-followup

Conversation

@pepmach

@pepmach pepmach commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

#13599 moved every inline chip's copy outcome into a shared InstantTip bubble that opens 8px above the chip's first line fragment. Its round-4 review read the frames and found three things the merged head still does: for any chip past its message's first line the bubble lands on the sentence the reader is in the middle of; a chip near the right viewport edge keeps the clamp measured for the narrow Click to copy hint when the wider Copy failed notice replaces it, so the notice can be clipped off-screen; and Copy failed says what happened but not what to do about it ("no idea why it failed or what I should do about it"). A fourth item is hygiene: COPIED_FLASH_MS was exported "so tests advance exactly this" and no test imported it.

Why it matters

The bubble is now the only place a copy's outcome is reported, so where it lands and whether it stays on-screen decide whether the report is readable at all. A failure notice with no next step leaves the user with a clipboard that did not change and nothing to do about it.

What changed (motivation → approach → change)

website/src/components/InstantTip.tsx: useInstantTip accepts placement: 'flow'. The bubble opens above only when the anchor sits on the FIRST line of its flow container (read from layout), and below from any lower line — under the chip's box — so it never covers the words leading up to the chip. The container is a [data-tip-flow] element — the hook's own attribute, set by the markdown renderer on its per-message root (the element the lightbox marks data-image-scope); a test pins one marked root per message, none nested. The hook binds to the OUTERMOST marked ancestor, so a message's own raw-HTML <div data-tip-flow> (the sanitizer keeps data-*) captures nothing. The bubble is fitted after every new tip: a flow anchor's below bubble must stay inside the viewport AND the box the reader sees (the tip's floor: the container's bottom, or the nearer edge of an ancestor that clips it, since a portal bubble escapes the clip); one that would cross either — onto the timestamp and action row under a message — goes above instead (its flip); the explicit below is clamped. Every content change is a new tip, so the wide notice's clamp never survives into the narrow hint.

website/src/components/MarkdownRenderer.tsx: the per-message root carries data-tip-flow beside data-image-scope (element, class list and click delegation unchanged; the tag laid out one attribute per line, the comment above it saying why); the copy chip and the title-cued chips (session, path, broken image) open their bubbles with placement: 'flow'. CopyFailedNotice takes its wording from the chip; the four notices form one family, "Couldn’t copy …". The copy chip's clipboard text IS the span the reader sees, so its notice names the recovery: Couldn’t copy — select the text to copy it manually. The title-cued chips copy something their label need not show — the session chip the key behind a nickname, the broken-image chip the path behind its alt — so "select the text" would copy the wrong thing; each names what failed to copy: the session chip the full session ID for its visible label, the path chip the path's tail (a clamped bubble still names its chip), the broken-image chip its object (Couldn’t copy the image path). The session and path chips copy on Ctrl/Cmd+click and open or switch on a plain click, so their notices lead with the failure and then name that gesture — The copy failed. Ctrl/Cmd+click copies the full session ID for chat-42…., The copy failed. Ctrl/Cmd+click copies the path vitest.config.mts. — a verdict first, never an instruction. The gesture is ctrlKey || metaKey, so the copy says Ctrl/Cmd+click everywhere, the chips' tooltip included. copy_failed stays for the table copy. Four keys land in all 13 website/src/i18n/locales catalogs, each locale's register; the tooltip value changes in place.

Tests: the copy, cue and session-chip tests advance the confirmation by the exported COPIED_FLASH_MS, not a literal 1500.

Not here: a pointer arrow on the bubble and the session chip's in-flow check moving into it (#13608); any change to the chips' rest-state look.

Backwards compatibility

Compatible: every click does what it did. Visual: a chip past its message's first line opens its bubble below itself instead of above, unless the bubble would leave the message's box (or the pane), in which case it opens above as before; the four failure notices share one family — the copy chip's Couldn’t copy — select the text to copy it manually, the session chip's The copy failed. Ctrl/Cmd+click copies the full session ID for <its label>., the path chip's The copy failed. Ctrl/Cmd+click copies the path <its tail>., the broken-image chip's Couldn’t copy the image path. The per-message root gains a data-tip-flow attribute (no class, role or handler change). useInstantTip's above (default) and below placements are unchanged for their consumers; flow is opt-in. Four catalog keys added, none removed; the ctrl_click_to_copy tooltip reads Ctrl/Cmd+click to copy in every locale.

Tests

  • website/src/test/InstantTip.test.tsx: a held outcome wider than the hint it replaces re-clamps against the right viewport edge (anchor at 900 in a 1024 viewport: the 100px hint sits at 900, the 300px outcome moves to 716 — red on the merged head: expected 1200 to be less than or equal to 1016), and when the hold ends with focus still on the anchor the hint is measured afresh and returns to 900 (red: expected 716 to be 900); an explicit below bubble that would run off the bottom (anchor bottom 380, bubble 30px, viewport 400) is clamped to 362 (red: expected 388 to be 362); placement: 'flow' opens above from an anchor on its container's first line (first-line rect 100..118, anchor top 102 → 94/100, translate class, data-placement="above") and below from a lower one (a wrapped anchor's box bottom 214 + 8 at its left 20 → 222/20, no translate, data-placement="below"), goes above after all — at its first fragment, 338/600 — when below does not fit under a lower-line anchor (red: data-placement="below" received), and falls back to above without a flow container or without layout to read the first line from. A below bubble stays inside its container's box: with the container at 100..240 and a 30px bubble, an anchor at 144 opens below (172), a wrapped anchor whose box ends at 240 takes its flip and opens above its first fragment (188/240) — red on 4f14857e08: data-placement="below". Inside a host that clips the container (overflow-y: hidden, clip bottom 200, container running on to 400) the clip edge is the floor: an anchor at 130 opens below (158), one at 170 flips above (162) — red on a8c23a6bf6: data-placement="below". A data-tip-flow element NESTED inside the container — the shape raw HTML produces — does not capture the measurement: an anchor on the nested element's first line (150..168) but a lower line of the message (first line 100..118) opens below at 180, past the nested box's bottom (200) and inside the message's (300) — red on d4e9fb9bbc: data-placement="above".
  • website/src/test/MarkdownRenderer.inlineCodeCue.test.tsx: the flow container is the renderer's per-message root, which carries exactly two data- attributes — data-image-scope and the new data-tip-flow; a chip on its first line opens above (top 94) and a chip in a later paragraph opens below its box (178/60) — red on the merged head: data-placement="above" received; red on 922bc91914: no [data-tip-flow] element. data-tip-flow marks the per-message root only, never a nested subtree: two messages holding a quoted paragraph with a chip and an image (local paths — main's feat(security): redaction that explains itself (RFC prototype C+A) #12684 defers a remote image to a click, so it renders no <img>), a nested list, a table, a fenced block and a link — one marked root each, no marked ancestor or descendant, every chip and image resolving to its own message's root, and data-image-scope on the same two elements and nowhere else. The path chip's refused Ctrl/Cmd+click reads exactly The copy failed. Ctrl/Cmd+click copies the path a.md. — the failure first, then the gesture and the path's tail — and never "select the text" (red on b3eee0e856: Copy failed; on 4f14857e08: Couldn’t copy the path; on c663deaa71: no gesture; on 473a078fa1: a trailing (Ctrl+click); on 1d2691e5ac: the gesture-first sentence); its tooltip advertises Ctrl/Cmd+click to copy (red on 473a078fa1: Ctrl+click to copy). A message's own raw-HTML <div data-tip-flow> reaches the DOM (two marked elements: the root and, inside it, the div) and does not capture the chip it wraps: with the div laid out 150..200 the chip's below bubble (180..210) would cross ITS bottom and flip above, but the container is the root (100..240), so it opens below (180/60) — red on d4e9fb9bbc: data-placement="above". A chip past the first line opens below while the bubble fits inside the root's box (root 100..240, bubble 30px: a chip at 152 opens at 180), and one whose bubble would cross the root's bottom opens above instead (a chip at 212: top 204, data-placement="above"; red on 4f14857e08: data-placement="below").
  • website/src/test/MarkdownRenderer.sessionChip.test.tsx: a SHORT slot name's refused Ctrl/Cmd+click copies the full key and its notice leads with the failure, then names the gesture and the full session ID for the chip's visible label — exactly The copy failed. Ctrl/Cmd+click copies the full session ID for chat-24. — never "select the text", which would have the reader copy the nickname (red on 922bc91914: Couldn’t copy the session key; on 36d6d59fc2: Couldn’t copy the key for chat-24; on c663deaa71: no gesture; on 473a078fa1: a trailing (Ctrl+click); on 1d2691e5ac: the gesture-first sentence); the notice sits in the bubble and clears with the flash. The full-key chip's refusals read The copy failed. Ctrl/Cmd+click copies the full session ID for chat-24-1784661951.; its tooltip advertises Ctrl/Cmd+click to copy (red on 473a078fa1: Ctrl+click to copy).
  • website/src/test/streamingRevealIdleSettle.test.tsx: the root's class list is composed one term per state — exactly group ft-anim-smooth ft-streaming while a smooth stream runs, group ft-anim-smooth ft-streaming ft-idle once it settles, group alone without smooth. Pinned because this change lays the root tag out one attribute per line and rewrites the comment above streamClass (its old reason, a tag left byte-identical to base, is gone). The expression itself is main's: splitting ft-idle into a term of its own was tried and dropped, because a bare ' ft-streaming' term trips shadcn/no-unknown-classes — no stylesheet selects that class, a main question outside this change. The pin is green on 473a078fa1 too.
  • website/src/test/MarkdownRenderer.brokenImage.test.tsx: the alt-labelled chip's refused click reads exactly Couldn’t copy the image path — it copies the path behind its alt, which is not the text on the page (red on b3eee0e856: Copy failed).
  • website/src/test/MarkdownRenderer.inlineCodeCopy.test.tsx: the refused-write notice's text is exactly Couldn’t copy — select the text to copy it manually (red on the merged head: Copy failed; red on 922bc91914: Copy failed — select the text to copy it manually), and every later refusal in that file reads the same family.
  • The copy, cue and session-chip tests import COPIED_FLASH_MS (and COPY_FAILED_FLASH_MS) in place of their hardcoded 1500s.

Run: nine InstantTip / chip / consumer test files (InstantTip, MarkdownRenderer.test, .brokenImage, .inlineCodeCue, .sessionChip, .inlineCodeCopy, .inlineCodeBlock, .inlineCodeInLink, streamingRevealIdleSettle) and npx vitest run src/i18n (the catalog gates incl. French U+202F and the hi/bn register, at changed-value strictness against main) pass by name; tsc --noEmit and eslint on the changed files pass; the production build, the analyze build, check-bundle-size.mjs (715 chunks within budget) and check-chunk-cycles.mjs (no cycles) pass on the same tree; no added line carries a <div … onClick (the root's tag is laid out one attribute per line; its element and handler are main's; the comment above the tag states that reason). The single commit sits directly on current main. Rebased onto main 47594b8390 (#12684; past #14268, the platformdirs heal); the inherited Windows reds from #14249 clear. #12684 and this change both append keys at the end of the catalogs' markdownRenderer section: resolved keep-both, main's block first, every catalog re-parsed as JSON. No local GPT or Opus lane read this head: the server review lanes are its first model read; the mechanical gate above is the pre-push evidence. Await Fast Gate and Coverage Gate were red on the previous head because the Fast Gate run sat queued past the 725 s wait (runner starvation, #12800), not from this change.

Manual verification

website/scripts/capture-inline-code-chip-cue.mjs (the harness #13599 added, extended here) drove the built SPA in Chromium and asserted 117 facts from the live DOM before each frame; the ones this change adds: a first-line chip's hover bubble opens above at its first fragment (data-placement="above", top = fragment top − 8); with both clipboard layers stubbed to refuse, the notice reads Couldn’t copy — select the text to copy it manually verbatim and its bubble stays inside the viewport (right 881 ≤ 1172); the refused notice on a between-line chip opens below it and stays off the message's timestamp and action row; the wrapped copy chip's Copied! bubble opens BELOW it (data-placement="below", top = box bottom + 8 at the box's left) with the sentence's opening line ending above the bubble and the bubble inside the viewport; a copy chip on a message's LAST line opens its bubble above, at its first fragment, off the footer row; with the composer hidden and the viewport shortened so a between-line chip is the pane's last visible line, its bubble flips above (the flip path, live); the session chip's title advertises Ctrl/Cmd+click to copy; the session, path and broken-image chips' refused copies open the notice naming what failed to copy — exactly The copy failed. Ctrl/Cmd+click copies the full session ID for chat-42-1758000000., The copy failed. Ctrl/Cmd+click copies the path vitest.config.mts., Couldn’t copy the image path — at the pressed chip on the side the flow rule picks — the session chip's above (first line), the broken-image chip's above (the message's last line), the path chip's above and pulled left by the viewport clamp (its fragment starts at 1041 in a 1180 viewport; the bubble ends at 1172 and still overlaps the chip), every one of them off the footer row. On the merged head the same script read the wrapped chip's bubble above its first fragment, over the preceding sentence, and every notice as Copy failed.

Screenshots / video

Hovering a first-line chip: the bubble opens above, off the message.

Hover: "Click to copy" bubble above the npm test chip on the message's first line

A refused write on a chip past the first line, with lines of its own message under it: the notice names the recovery and the bubble opens under the chip, over the message's own next line — never on the timestamp and action row.

Refused write: the "Couldn’t copy — select the text to copy it manually" ErrorNotice inside the bubble below the NODE_ENV chip, over the message's next line, paragraph unchanged

A wrapped copy chip past the first line: Copied! opens below where the chip ends.

Long path chip and long copy chip wrapping over two lines, "Copied!" below the copy chip's last line

A copy chip on a message's last line: below it the bubble would sit on the timestamp and action row, so it opens above, off that row.

Hover on the "unset KIROCREW_SETTINGS" chip on the message's last line: "Click to copy" above the chip, the timestamp and icons under the message untouched

A between-line chip as the pane's last visible line (composer hidden, viewport shortened): below would run off the pane, so the bubble takes its flip and opens above.

Hover on the NODE_ENV chip at the bottom edge of a shortened pane: "Click to copy" above the chip

The title-cued chips' refused copies name what failed to copy, on the side the flow rule picks; the path chip's bubble is pulled left by the viewport clamp and still overlaps the chip.

Refused Ctrl/Cmd+click on the session chip: the "The copy failed. Ctrl/Cmd+click copies the full session ID for chat-42-1758000000." bubble above the chip on the message's first line, the line unchanged

Refused Ctrl/Cmd+click on the path chip: the "The copy failed. Ctrl/Cmd+click copies the path vitest.config.mts." bubble above the wrapped path, pulled left to stay inside the viewport, the line unchanged

Refused click on the broken-image chip on the message's last line: the "Couldn’t copy the image path" bubble above it, off the timestamp and action row, nothing added beside the chip

Related Issues

Fixes #14034

The round-4 review items on #13599's merged head. Related: #13513, #13608.

Pattern harvest

Rule candidate: review-prompt
Pattern: a tooltip or popover positioned relative to an inline anchor in running text without checking which lines of the surrounding prose it covers, or measured once against the viewport and never re-measured when its content changes width

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

@pepmach
pepmach requested review from a team and CrysisDeu September 25, 2026 23:58
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 25, 2026
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

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

Design-Verdict: PASS

Verify in attachment-02's trade-off — a below bubble deliberately covers the message's own next line — reads acceptably at real message densities.

[DESIGN-REVIEWED] 463cfaf

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ✅ PASS

Premise-level review of 463cfafc1962bdbba04c14499642cfdd54bafb59 — 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

Verify the red-on-base claims: each new test names its failure on the merged head; I cannot run them, a human can.

Not justified as shipped

  • Item 4 — rides along: the Ctrl+click to copy → Ctrl/Cmd+click relabel in all 13 catalogs is not one of the three reported defects, though its harm is derived — the gesture is ctrlKey || metaKey (MarkdownRenderer.tsx:2052), so the old label misnames it on macOS.
  • Item 5 — rides along: declared as "hygiene" — tests import COPIED_FLASH_MS instead of a literal 1500, giving the export the consumer its own comment promised (count on base: 0).
  • Item 6 — rides along: the explicit top-bar below bubble gains a bottom-edge clamp no defect reported; it falls out of the shared fit path, no surface of its own.

What this change ships

Inventory (6 items) — 3 justified

Intent: FIX — make a chip's copy-outcome bubble land readably (off the words being read, on-screen) and make the failure notice name a next step.

  1. A chip past its message's first line opens its bubble below the chip, flipping above only when below won't fit — justified
  2. A bubble whose content changes (hint ↔ notice) is re-measured, so a wide failure notice near the right edge stays on-screen — justified
  3. The four copy-failure notices now name the recovery or the object that failed to copy, one "Couldn't copy" family — justified
  4. Chip tooltips read "Ctrl/Cmd+click to copy" in every locale — rides along: not among the reported defects; harm derived from the code's own gesture check
  5. Tests advance the copied flash by the exported COPIED_FLASH_MS, not 1500 — rides along: declared hygiene, test-only
  6. A top-bar below bubble that would run off the viewport bottom is clamped — rides along: unreported, shares the fit path

[FIRST-PRINCIPLES-REVIEWED] 463cfaf

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 463cfafc1962bdbba04c14499642cfdd54bafb59 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 463cfaf

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

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — 🟡 CONCERNS

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

UX-Verdict: CONCERNS

"The copy failed. Ctrl/Cmd+click copies…" restates the gesture that just failed as the recovery, and "full session ID" read as jargon to the blind reader.

Watch

  • The session/path notices (the_copy_failed_ctrl_cmd_click_copies_the_full_session_id_for_label, …the_path_label) only ever render after the user Ctrl/Cmd+clicked, yet name that same gesture in present tense as if it works — the blind reader read it as "a keyboard-plus-click trick to copy something longer instead", i.e. a different action than the one that failed. Rare trigger (clipboard refusal) × real confusion × every occurrence → CONCERNS. Smallest fix: state the object that failed, not the gesture ("Couldn’t copy the full session ID for {{label}}.").
  • "Full session ID" vs the visible label collapses when the label IS the full key: shot-06 shows "…the full session ID for chat-42-1758000000." and the reader said "I don't know what a 'full session ID' is versus what I was copying before", listing "session ID" under words not understood. Same frequency/impact; drop "full … for {{label}}" when the label already equals the key.
  • The four notices split into two families ("Couldn’t copy —" vs "The copy failed.") for one event; the reader reported "the failure messages each name a different thing being copied, and I couldn't always tell which one I had asked for" — synonym drift a first-timer notices. One opener ("Couldn’t copy …") across all four resolves it and the two items above at once.

Suggestions

  • couldnt_copy_the_image_path dead-ends — it names no recovery and no object tail; append the path's tail as the path chip does, so the reader knows which image and what to retry.

[UX-REVIEWED] 463cfaf

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 463cfaf

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

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

@pepmach
pepmach force-pushed the fix/inline-chip-followup branch from 3d2e0f1 to e835c85 Compare September 26, 2026 00:42
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 26, 2026
@pepmach
pepmach force-pushed the fix/inline-chip-followup branch from e835c85 to b3eee0e Compare September 26, 2026 01:55
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 26, 2026
@pepmach
pepmach force-pushed the fix/inline-chip-followup branch from b3eee0e to 922bc91 Compare September 26, 2026 03:01
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 26, 2026
@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • rebutted — span=c09b1c3b66f2 — item 6, declared and kept: the explicit below shares the bubble's one fit path

The vertical fit is one code path in InstantTip's layout effect: after every new tip the bubble is measured against the viewport, and a below bubble that would run off the bottom either flips above (a flow anchor, which carries its above position) or clamps to the bottom edge (the explicit top-bar below, which has no above position to flip to). Leaving the second branch out would leave the pill — the one placement: 'below' consumer, as the lane counted — with the off-screen bubble the fix closes for the flow anchors: the same defect class, one consumer over.
Two lines, declared as a ride-along in the description, pinned by its own test (anchor bottom 380 in a 400 viewport, 30 px bubble: top 362 — red before: 388). Kept; inventory only, as the lane reads it.

@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • rebutted — span=2af87c60a06f — accepted by design: the trade is intended — a below flash covers what follows the chip, never the words leading up to it

The lane's reading stands as written: "Every copy on a wrapped or last-line chip, transient, friction only" — the wrapped chip's Copied! and the failure notice open under the chip's box for COPIED_FLASH_MS / COPY_FAILED_FLASH_MS and clear themselves; nothing enters the text flow and the covered words are back when the flash ends.
The alternative is the shape this PR removes: a bubble above a lower-line chip covers the sentence the reader is in the middle of, for the same time, on every copy (#13599's review: "it makes the message unreadable while it's up"). Below covers what follows the chip, which the reader has not reached; a first-line chip still opens above, off the message. This is the intended trade, stated in the description, and it is the author's confirmation the lane asks for.

@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 Sep 26, 2026
@pepmach
pepmach force-pushed the fix/inline-chip-followup branch from d4e9fb9 to 473a078 Compare September 26, 2026 18:41
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 26, 2026
@pepmach
pepmach force-pushed the fix/inline-chip-followup branch from 473a078 to 1d2691e Compare September 26, 2026 19:52
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 26, 2026
… the recovery

A copy chip's bubble opened above its first line fragment, so for any chip
past its message's first line it covered the sentence the reader was in.
The bubble now opens above only from the message's first line and below
from any lower one (`useInstantTip({ placement: 'flow' })`, decided from the
first text line of the `[data-tip-flow]` container -- the hook's own
attribute, which the markdown renderer sets on its per-message root beside
the lightbox's `data-image-scope`; the hook binds to the OUTERMOST marked
ancestor, since the sanitizer keeps `data-*` on raw HTML and a message's own
`<div data-tip-flow>` must not capture a chip's first line or floor), and a
bubble below stays inside the box the reader sees -- the container, or the
nearer edge of an ancestor that clips it: one that would cross the message's
bottom edge -- and land on the timestamp and action row under it -- opens
above instead, as does one that would run off the bottom of the viewport.
viewport. A new outcome or the end of a hold re-anchors an open bubble, so
the clamp measured for the narrow hint never survives into the wider failure
notice, nor the reverse. The four failure notices share one family: the copy
chip's names the next step ("Couldn't copy -- select the text to copy it
manually"); the session, path and broken-image chips' name what failed to
copy ("Couldn't copy the full session ID for <the chip's label>" / "the path
<its tail>" / "the image path"), because their value is not the text they
show; the session and path chips, whose plain click opens or switches, lead
with the failure and then name the gesture -- "The copy failed. Ctrl/Cmd+click
copies the full session ID for <label>." -- so the verdict comes first, the
gesture reads as what the chip does rather than as an instruction, and a reader
who did not press it is not taught that a plain click copies. The gesture is `ctrlKey || metaKey`, so every string
about it says "Ctrl/Cmd+click", the two chips' "Ctrl/Cmd+click to copy"
tooltip included. Four catalog keys across the 13 locales, one tooltip value
changed in place. The renderer's root tag is laid out one attribute per line
(the accessible-interactive-elements rule greps added lines for a div carrying
its handler) and the comment above `streamClass` says so instead of claiming
the tag is byte-identical to base. The copy, cue and session-chip tests advance
the confirmation by the exported `COPIED_FLASH_MS`.

Fixes #14034
@pepmach
pepmach force-pushed the fix/inline-chip-followup branch from 1d2691e to 463cfaf Compare September 26, 2026 20:45
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Sep 26, 2026
@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

Agreed on the reading: the notice renders only after a Ctrl/Cmd+click was refused, so naming the gesture in present tense invites the "a trick to copy something longer instead" misreading. This head's wording is the third form the gesture has taken in this PR (a trailing parenthetical, a gesture-first sentence, a failure-first pair) and each drew a new reading, so the fix is the lane's own — drop the gesture from the notice and name the object: Couldn’t copy the full session ID for {{label}}. — not a fourth form.
Out of scope on this head: it is one wording change together with the two items below, and it re-touches all 13 catalogs, the pins and two frames. #14294 (deferred-finding, owner pepmach, Due 2026-10-09) carries the lane's smallest fix verbatim as Task 1. The Ctrl/Cmd+click to copy tooltip stays the gesture's cue meanwhile.

@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

Agreed: when the chip's visible text IS the full key, "the full session ID for chat-42-1758000000" names the same thing twice and the reader cannot place "full session ID". SessionChip has both the label and the key, so the lane's smallest fix — drop full … for {{label}} when the label already equals the key — is a second catalog key chosen by label === sessionKey, plus its pins.
#14294 Task 2 quotes it verbatim; same owner and date. Left as-is on this head so the wording lands once, with Tasks 1 and 3, instead of in another round of partial rewording.

@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

Agreed: Couldn’t copy — (copy chip, broken-image chip) and The copy failed. … (session, path) are two openers for the same refusal, and one opener resolves this and the two items above at once. The split is this PR's own doing: its earlier heads had one family, and the gesture rounds pulled two notices out of it.
#14294 Task 3 quotes the lane's fix verbatim — one Couldn’t copy … opener across all four notices. Deferred rather than fixed here so the four strings change together, once.

@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

Agreed: Couldn’t copy the image path says which kind of thing failed but not which image; the path chip already names its tail, and the broken-image chip has the same tail to hand (basenameOf on its path). #14294 carries it beside the three notice tasks so the four strings change together.

@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • rebutted — span=4042123f7c3d — item 4, declared and kept: the Ctrl/Cmd+click to copy relabel names the gesture the handlers accept

The handlers behind both chips accept e.ctrlKey || e.metaKey, so Ctrl+click to copy told a macOS user to press a key they never need; the relabel makes the tooltip say what the code does. Harm derived, as the lane notes, and it is the UX lane's own suggestion on this PR (c328d9bd90a2) taken at the one string that cues the gesture. One value in 13 catalogs plus the pins that read it; no code path changes. Declared in the description's compatibility and Tests sections. Kept.

@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • rebutted — span=fc9eaf53c3f6 — item 5, declared and kept: the COPIED_FLASH_MS import is one of the issue's four items

#14034, which this PR fixes, lists the dead COPIED_FLASH_MS export as its fourth item (the parent's First Principles lane: exported "so tests advance exactly this" with zero importers). Importing it in the copy, cue and session-chip tests in place of their literal 1500s is the smallest change that makes the export's comment true; the alternative — deleting the export — would send the tests back to the literal the parent review flagged.
One line per test file, no production change, declared as hygiene in the description's Tests section. Kept.

@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • rebutted — span=18f2540f6c34 — item 6, declared and kept: the explicit below shares the bubble's one fit path

The vertical fit is one code path in InstantTip's layout effect: after every new tip the bubble is measured against its limit, and a below bubble that would cross it either takes its flip (a flow anchor, which carries its above position) or clamps to the viewport's bottom edge (the explicit top-bar below, which has no above position to flip to). Leaving the second branch out would leave the pill — the one placement: 'below' consumer, as the lane counts it — with the off-screen bubble the fix closes for the flow anchors: the same defect class, one consumer over, reachable exactly when the lane says (a pane shorter than the top bar plus one bubble). The harm is nameable and small — a bubble the reader cannot see — and so is the branch that closes it.
Two lines, declared as a ride-along in the description's Tests section, pinned by its own test (anchor bottom 380 in a 400 viewport, 30 px bubble: top 362 — red before: 388). Kept.

@iamwhatever
iamwhatever enabled auto-merge (squash) September 26, 2026 22:51
@iamwhatever
iamwhatever merged commit 59d3fd4 into main Sep 26, 2026
96 checks passed
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 code chips: bubble occlusion, stale clamp on re-anchor, dead COPIED_FLASH_MS export, copy-failed recovery text

2 participants