Repository navigation
chore(core): the catalog gains the Comments copy-link failure message - #11376
Conversation
Lab's Comments shows and announces @astryx.comments.linkCopyFailed when copying a comment link fails. The message lives in Core's catalog, so it lands on its own before the Lab change.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
|
/approve-spec 462463b |
There was a problem hiding this comment.
Changes requested: the catalog entry itself is fine, but the changeset describes a fix this pull request does not make.
.changeset/comments-link-copy-failed-message.mdfiles the entry under Core's Fixes and says Lab's Comments shows and announces the message, yet nothing at this head reads@astryx.comments.linkCopyFailed, so reword it as an internal entry such as[chore] Internal: Core's English catalog gains `@astryx.comments.linkCopyFailed` ("Failed to copy value to clipboard.") for Lab's Comments. Apps import nothing new.
The new entry has a translator description, reuses the CodeBlock and Timestamp failure text, and changes no component. When #10435 rebases onto this, its identical en.json hunk drops out; drop its Core changeset too, or Core's changelog lists the message twice.
Claims and files checked
- Changeset: the English catalog gains the new key with the failure text: verified.
- Changeset: it is the message Lab's Comments shows and announces on a failed copy: false at this head, since no component reads the key.
- Changeset: filed as a fix: false, since nothing in Core is fixed.
- Changeset: a Core patch: verified.
- Description: catalog messages live in Core: verified.
- Description: splitting out the Core part lets the Lab change count as Lab-only: verified in substance against the repository's Lab-only decision.
- Description: the Lab change then changes no Core file: not checkable here; it still carries the same catalog hunk and its own Core changeset until it rebases.
- Description: the key is not public API: verified for exports and types; once released, apps can still reword it through the provider's overrides.
- Description: the translator description covers the label, tooltip and announcement for two seconds: verified against the Lab change.
- Description: no component reads the key until the Lab change merges: verified.
- Description: the catalog and runtime checks pass: not run in this review; the entry conforms on inspection.
- Description: no CI impact; no public API, behavior, visual or policy change; no internal context: verified.
- Description: pre-commit hooks pass: not checked.
- File
.changeset/comments-link-copy-failed-message.md: the finding above. - File
packages/core/locales/en.json: clear, and it agrees with the changeset on the key and its text.
|
/approve-spec 9cd65ac |
There was a problem hiding this comment.
Approved pending CI: CI has not finished on this head yet.
The changeset now files the catalog entry as an internal [chore], which resolves the earlier request, and the entry itself has a translator description and changes no component. When #10435 rebases onto this, drop its identical en.json hunk and its own Core changeset, or Core's changelog lists the message twice.
Claims and files checked
- Changeset: a Core patch: verified.
- Changeset: filed as an internal chore: verified, since nothing in Core reads the key yet.
- Changeset: the English catalog gains the new key with the failure text, for Lab's Comments: verified.
- Changeset: apps import nothing new: verified; no export or entry point changes.
- Description: Lab's Comments uses the one new message to show and announce a failed copy: verified against #10435.
- Description: catalog messages live in Core: verified.
- Description: the Lab change then changes no Core file: a plan for #10435, not checkable at this head; #10435 still carries the same catalog hunk and its own Core changeset until it rebases.
- Description: splitting out the Core part keeps the Lab change Lab-only: verified in substance against the repository's Lab-only rule.
- Description: the key is not public API: verified for exports and types; once released, apps can still reword it through the provider's overrides.
- Description: the translator description covers the label, tooltip and announcement for two seconds: verified against #10435.
- Description: the catalog and runtime checks pass: verified in CI's lint run on this head.
- Description: no component reads the key until the Lab change merges: verified.
- Description: no CI impact; no public API, behavior, visual or policy change; Lab product changes split out; no internal context: verified.
- Description: pre-commit hooks pass: the repository checks pass in CI; lint-staged not checked.
- File
.changeset/comments-link-copy-failed-message.md: clear. - File
packages/core/locales/en.json: clear, and it agrees with the changeset on the key and its text.
Main now carries @astryx.comments.linkCopyFailed (#11376), so this branch's identical catalog hunk drops out and its Core changeset goes. A comment in CommentActions says why the failed state lives in Lab (architecture:knowledge-contracts DEC-19).
…10435) * fix(Comments): a failed comment-link copy shows and announces itself Copy comment link uses Core's useClipboardCopy, the hook CodeBlock's copy button uses, through a new internal entry (`@astryxdesign/core/internal/clipboard-copy`, not public API). A rejected write shows a cross for two seconds, names and tooltips the button "Failed to copy value to clipboard." and announces it once. It used to do nothing. * fix(useClipboard): a failed copy is announced assertively The internal useClipboardCopy announced a failed write on the polite live region. Status announcements put errors outside a live container on the assertive channel, so the failure now goes there. CodeBlock is the one shipped caller; its record (AR3) says so. Success stays polite. * Merge branch fix/copy-failure-assertive * test(Comments): a failed link copy is announced assertively The failure test reads the assertive region, now that the shared hook announces failures there. The internal entry's header names its one caller, and a comment that restated the icon ternary is gone. * Merge main into fix/comments-copy-link-failure; Comments reads a failed copy through public hooks Comments takes useClipboard's false result and holds its own two-second failed state, announced assertively through useAnnounce, so no new Core entry is needed: the internal/clipboard-copy entry, its test, and its export wiring are removed. Drops the assertive-failure changeset, which shipped with #10448, and the changeset names the Lab fix. * chore(changeset): name only Core, the published package the Comments fix touches * fix(Comments): unmounting a comment stops its failed-copy reset The failed-copy reset timer is cleared on unmount (architecture:react-component-runtime INV5). A unit case unmounts a comment while its failure shows and checks that the reset is stopped. * Merge main into fix/comments-copy-link-failure; Comments is Lab-only Main now carries @astryx.comments.linkCopyFailed (#11376), so this branch's identical catalog hunk drops out and its Core changeset goes. A comment in CommentActions says why the failed state lives in Lab (architecture:knowledge-contracts DEC-19). * fix(lab): Comments copy-link comments state the reason; an in-flight write sets no state after unmount The failed-copy comment drops its record citation and keeps only the reason; the tooltip comment covers a failed copy too. A clipboard write still in flight when the comment unmounts now sets no state. * Merge main into fix/comments-copy-link-failure * fix(lab): Comments reaches Core's shared failed-copy state Comments kept its own copy of the failed-write state that Core's useClipboardCopy owns for CodeBlock and Timestamp. Core now exposes the hook to Lab as the internal entry @astryxdesign/core/internal/clipboard-copy (Core and Lab only, by lint), and Comments calls it once. The in-flight guard moves into the hook: a write that settles after its caller unmounts sets no state, starts no timer and announces nothing, for every caller. data-link-copied no longer reads "copied" while a failure shows. react-component-runtime names the entry. * chore(core): a changeset for the clipboard hook's unmount guard The guard ships in Core, so CodeBlock and Timestamp get a patch [fix] entry. Drops a comment that restated the hook.
Maintainer impact
Lab's Comments (#10435) shows and announces a failed comment-link copy with one new message. Catalog messages live in Core, so this PR carries that Core part on its own; #10435 then changes no Core file and merges after this.
Intended invariant
architecture:knowledge-contractsDEC-19: a Lab change reads Core through its public surface and changes no Core file. The catalog key is not public API.Change
packages/core/locales/en.jsongains@astryx.comments.linkCopyFailed("Failed to copy value to clipboard."), described for translators as the label, tooltip and screen-reader announcement the Copy comment link button takes for two seconds after a failed clipboard write..changeset/comments-link-copy-failed-message.md: a Core patch for the new catalog message.Evidence
node scripts/check-i18n-catalog.mjsandnode scripts/generate-i18n-runtime.mjs --checkpass.Scope
Components: i18n catalog (Core)
Testing
pnpm check:repo) pass.