Add BranchName WithTrailingAction story#7920
Conversation
|
Demonstrate a trailing action pattern (copy button) for BranchName, serving as a reference for future implementation work. Add WithTrailingActionMenu story with SelectPanel Demonstrates branch switching via SelectPanel anchored to BranchName, showing the 'Change base branch' pattern. Remove overflow:hidden to prevent focus ring clipping
9957e42 to
aad16e8
Compare
joshblack
left a comment
There was a problem hiding this comment.
Just had one comment for the live region announcements but wanted to approve in advance so you didn't have to wait another day lol
| {/* Screen reader announcement for copy success */} | ||
| {copied && ( | ||
| <VisuallyHidden> | ||
| <Announce>Copied!</Announce> |
There was a problem hiding this comment.
The announcement might be better suited in handleCopy with announce straight from @primer/live-region-element instead of rendering it, in particular if the announcement is hidden. e.g.
import { announce } from '@primer/live-region-element'
const handleCopy = () => {
setCopied(true)
void navigator.clipboard.writeText(branchName)
announce('Copied!');
setTimeout(() => setCopied(false), 2000)
}
Overview
Adds a feature story demonstrating the trailing action pattern (copy button) for BranchName. This story serves as a reference for the implementation work to upstream this pattern from github-ui's PullRequestBranchName.
The story demonstrates:
Changelog
New
WithTrailingActionstory in BranchName featuresChanged
None
Removed
None
Rollout strategy
Testing & Reviewing
View the story in Storybook: Components > BranchName > Features > With Trailing Action
Merge checklist