Skip to content

chore(core): the catalog gains the Comments copy-link failure message - #11376

Merged
cixzhang merged 2 commits into
mainfrom
core/comments-link-copy-failed-message
Nov 12, 2026
Merged

cixzhang merged 2 commits into
mainfrom
core/comments-link-copy-failed-message

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

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-contracts DEC-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.json gains @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

Scope

Components: i18n catalog (Core)

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • Catalog checks above pass.
  • Pre-commit hooks (lint-staged, pnpm check:repo) pass.

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.
@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 12, 2026 1:10pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 12, 2026
@astracat-bot

astracat-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 12, 2026, 1:21 PM UTC

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 9cd65ac

Storybook · Sandbox · built from this PR's head

Package size: @astryxdesign/core 7.38 MB packed (+54 B); no new dependencies.

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 462463b

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 12, 2026

@astracat-bot astracat-bot Bot 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.

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.md files 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.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 12, 2026 13:03
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 9cd65ac

@astracat-bot astracat-bot Bot 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.

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.

Automated review (maintainer link)

@cixzhang
cixzhang merged commit a4fe015 into main Nov 12, 2026
131 checks passed
@cixzhang
cixzhang deleted the core/comments-link-copy-failed-message branch November 12, 2026 13:45
cixzhang added a commit that referenced this pull request Nov 12, 2026
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).
cixzhang added a commit that referenced this pull request Nov 15, 2026
…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.

This branch was successfully deployed

1 active deployment
Preview — 9cd65acd Deployed Nov 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant