Repository navigation
fix: retain copy confirmation for accessibility - #5864
Open
ahonamatata wants to merge 4 commits into
Open
ahonamatata wants to merge 4 commits into
ahonamatata wants to merge 4 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 068c5ef2-5e03-4d29-8666-f2b34b1bcc92
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 068c5ef2-5e03-4d29-8666-f2b34b1bcc92
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 068c5ef2-5e03-4d29-8666-f2b34b1bcc92
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 068c5ef2-5e03-4d29-8666-f2b34b1bcc92
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The Fluent theme still overrides the confirmation animation to 500 ms, leaving the reported visual issue unresolved there.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Retains visual and assistive copy confirmation for five seconds.
Changes:
- Adds a persistent atomic status portal with timer cleanup.
- Extends confirmation duration and adds integration coverage.
- Updates the changelog.
| File | Description |
|---|---|
ActivityCopyButton.ts |
Extends legacy animation duration. |
ActivityCopyButton.tsx |
Adds status portal and timeout handling. |
ActivityCopyButton.module.css |
Extends animation and visually hides status. |
CHANGELOG.md |
Records the accessibility fix. |
behavior.html |
Tests status semantics, repetition, and cleanup. |
behavior.hideAndShow.html |
Tests confirmation duration and visibility changes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| &.activity-copy-button--copied { | ||
| .activity-copy-button__copied-text { | ||
| animation: webchat__activity-copy-button__copied-animation 0.7s linear; | ||
| animation: webchat__activity-copy-button__copied-animation 5s linear; |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Changelog Entry
Description
After activating Copy, Web Chat displayed
Copiedfor only 700 ms and removed its polite live-region announcement after about 1 second. Windows Narrator could miss a queued polite announcement during that short window, while sighted users could also miss the visual confirmation.The copy confirmation now remains visible for 5 seconds and uses a persistent atomic status region portaled directly to the
.webchatroot. This places the status outside response-labelled message ancestors and the shared transcript live region. An independent ponyfill timeout controls its lifetime, so cleanup does not depend on CSS animation events and unrelated announcements are not retained.Design
The defect had two independent causes:
Copiedstate after 0.7 seconds.A duration-only CSS change would not make the assistive-technology message more reliable. Increasing the shared live-region timeout would retain unrelated transcript announcements. Rendering the status inside the message row would also add
Copiedto an ancestor accessible name.Instead, the Copy button portals a persistent
role="status"witharia-atomic="true"to the nearest.webchatroot. Each activation replaces a keyed child, making repeated identicalCopiedmessages observable while the status container remains mounted. A 5-second timeout fromusePonyfill()resets on every activation, clears on unmount, removes the status content, and restores the visual button state even when animation events are disabled or absent. The existing animation remains an independent visual completion path.Clipboard behavior, focus, localization, and the shared
LiveRegionTwinimplementation are unchanged.Specific Changes
Copiedconfirmation from 0.7 seconds to 5 seconds.CHANGELOG.md.Reproduction on current
mainmain, the visibleCopiedstate has ended and the shared live-region announcement has already been removed.Validation
Validated pushed head
fbdede960c67ea41dcd73ebc2e724251e5dfd1a7:npm clean-install --userconfig .npmrc: passed on Windows, installing 1,753 packages without tracked dependency changes.npm run build-browser: passed, building the test harness IIFE and ESM bundles.node_modules/.bin/eslint.cmd --report-unused-disable-directives --max-warnings 0 packages/component/src: passed.git diff --check HEAD^ HEAD: passed.npm clean-install --userconfig .npmrc && npm run build: passed. CRLF normalization occurred only in the disposable validation copy.UP.npm test -- --testPathPattern '__tests__/html2/copyButton/behavior\.html$': passed, 1 suite, 1 test, and 3 snapshots in 15.028 seconds.npm test -- --testPathPattern '__tests__/html2/copyButton/behavior\.hideAndShow\.html$': passed, 1 suite, 1 test, and 3 snapshots in 12.114 seconds.npm run precommit:typecheck --workspace ./packages/component: passed in the built isolated Linux environment.Copiedafter activation.Regression Coverage
behavior.htmlfails on unmodifiedmainafter 1 second because the 0.7-second visual confirmation is already hidden and there is no persistent root-level atomic status. It also verifies placement outsidearia-labelledbyancestors and the shared live region, repeated activation, and timer cleanup when CSS animation is disabled.behavior.hideAndShow.htmlfails on unmodifiedmainbecause the visualCopiedconfirmation is no longer visible after 1 second. It also verifies return to the normal state after the remaining duration and after Web Chat is hidden and shown.CHANGELOG.mdNo user-facing documentation change is required beyond the changelog.
Review Checklist
z-index)package.jsonandpackage-lock.jsonreviewed