Skip to content

fix: report clipboard and toast outcomes accurately - #878

Merged
pasqualevitiello merged 2 commits into
mainfrom
codex/fix-copy-toast-feedback
Oct 15, 2026
Merged

pasqualevitiello merged 2 commits into
mainfrom
codex/fix-copy-toast-feedback

Conversation

@pasqualevitiello

@pasqualevitiello pasqualevitiello commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Clipboard examples could show Copied before the write succeeded, the code example left Copy enabled when its textarea was empty, the report button could leave Generating report visible after success, and promise toasts emitted unhandled rejections. Reuse the existing clipboard hook (with registry dependencies), disable the code copy action until there is content, close the report progress toast in cleanup, and handle the promise helper's rejection.

Use the supported add/update toast lifecycle for the cancellable example: loading becomes success, an actual failure becomes error, and cancellation becomes neutral information feedback. Every outcome removes Cancel and restores the button to idle. Include regenerated registry assets. Covers F05, F06, F12, and D04.

Validation

  • Targeted TypeScript and Biome checks passed.
  • Registry dependency validation and registry generation passed.
  • Isolated browser checks verified all three copy examples stay idle while clipboard writes are pending, show Copied on success, reset afterward, and keep idle feedback on rejection without an unhandled promise rejection.
  • The code-copy button is disabled for an empty textarea, enables after typing, and disables again after keyboard deletion clears it.
  • Controlled success/failure/cancellation verified report progress cleanup, including a hovered toast with paused expiry.
  • Promise toast success/failure and cancellable toast success/failure/keyboard cancellation produced the expected feedback without unhandled rejections.
  • Actual keyboard cancellation cleared the pending operation timer, removed Cancel, restored Download, and showed an information icon. Light/dark cancellation states were inspected.

Reviewer callouts

The existing clipboard hook logs denied writes and exposes no new user-facing error state. The promise helper forces rejected promises to error styling, so the cancellable example uses the supported add/update API to distinguish cancellation from failure. Browser verification used controlled fixture clipboard responses/task timers to avoid background-tab throttling; no full application build or E2E suite was run. Reverting this commit restores the previous examples.

@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
coss-com Ready Ready Preview Oct 14, 2026 7:43pm UTC
coss-com-ui Ready Ready Preview Oct 14, 2026 7:43pm UTC
coss-examples-calcom Ready Ready Preview Oct 14, 2026 7:43pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
coss-com-origin Skipped Skipped Oct 14, 2026 7:43pm UTC

Request Review

@pasqualevitiello
pasqualevitiello merged commit 72b7cca into main Oct 15, 2026
14 checks passed
@pasqualevitiello
pasqualevitiello deleted the codex/fix-copy-toast-feedback branch October 15, 2026 06:05
@linear-code

linear-code Bot commented Oct 15, 2026

Copy link
Copy Markdown

ENG-6152

This branch was successfully deployed

3 active and 1 inactive deployments
Preview – coss-com-ui — f70f9cf5 Deployed Oct 14, 2026 by vercel[bot]
Preview – coss-examples-calcom — f70f9cf5 Deployed Oct 14, 2026 by vercel[bot]
Preview – coss-com — f70f9cf5 Deployed Oct 14, 2026 by vercel[bot]
Preview – coss-com-origin — f70f9cf5 Deployed Oct 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants