Repository navigation
feat(ch-copy-button): copy value to clipboard with feedback - #140
Merged
Merged
Conversation
5 of 6 tasks
Composes ch-button so variant, size, disabled and label behave as there. The slot content is the label; on a successful clipboard write the button shows copiedLabel and a check icon for copiedDuration ms, then reverts. Emits chCopy on success and chCopyError when the clipboard API is missing (insecure context) or the write rejects. Slot forwarding through two shadow roots is covered in the browser project, which mock-doc cannot project.
hectorpalmatellez
force-pushed
the
feat/copy-button-137
branch
from
November 28, 2026 22:45
409666c to
d95a75e
Compare
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.
Summary
Closes #137 —
ch-copy-button, a clipboard button composed onch-button.valueis written vianavigator.clipboard.writeText; emptyvaluedisables the button.copiedLabel(defaultCopied) + a check icon show forcopiedDurationms (default 2000), then revert.chCopyon success,chCopyErrorwhen the clipboard API is missing (insecure context) or the write rejects.variant,size,disabled,labelforward to the innerch-button; icon-only use warns viawarnMissingNamelikech-button.docs/ai.md(now 40 components), gallery entry,llms.txt+docs-siteregenerated.Test plan
pnpm lint,pnpm run format:checkpnpm build+ wrapper buildspnpm exec vitest run --project components— 333 tests (7 new)pnpm exec vitest run --project browser— includes new spec verifying real slot projection through two shadow roots (mock-doc cannot project a slot assigned to another component's slot)pnpm run generate:gallery && pnpm run generate:llms && pnpm run check:aiNote: needs a release after merge before
check:releasedpasses onmain.