-
-
Notifications
You must be signed in to change notification settings - Fork 23
Feat: Add copy-all button to reduce copy steps on search page #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughRefactors SearchResult.tsx to construct command strings via variables, restructures the layout to group per-command copy controls, and adds a new “Copy all” button that copies the combined add-bucket and install commands to the clipboard. No exported/public API changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant SR as SearchResult Component
participant CC1 as CopyToClipboardComponent (Bucket)
participant CC2 as CopyToClipboardComponent (Install)
participant CAB as CopyToClipboardButton (Copy all)
participant CB as Clipboard
rect rgba(200,220,255,0.2)
note over SR: On render: build bucketCommand, appCommand, fullCommand
end
U->>CC1: Click "Copy add bucket"
CC1->>CB: Copy bucketCommand
CB-->>U: Clipboard updated
U->>CC2: Click "Copy install"
CC2->>CB: Copy appCommand
CB-->>U: Clipboard updated
rect rgba(220,255,220,0.2)
note right of CAB: New combined action
U->>CAB: Click "Copy all"
CAB->>SR: Request fullCommand
SR-->>CAB: fullCommand (bucket + newline + app)
CAB->>CB: Copy fullCommand
CB-->>U: Clipboard updated
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks (5 passed)✅ Passed checks (5 passed)
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/components/SearchResult.tsx (1)
203-219: Nice UX! Add id and aria-label to the “Copy all” buttonGreat addition and layout. For test hooks and accessibility, add a stable id and aria-label.
Apply this diff:
- <Col xs="auto" className="copy-command-group ps-1 d-flex"> + <Col xs="auto" className="copy-command-group ps-1 d-flex"> <CopyToClipboardButton - className="copy-command-button" + className="copy-command-button" + id="copy-all-command" + aria-label="Copy both commands to clipboard" title="Copy all to clipboard" variant="outline-secondary" onClick={() => handleCopyToClipboard(`${fullCommand}`)} /> </Col>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/components/SearchResult.tsx(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/components/SearchResult.tsx (2)
src/components/Home.tsx (3)
SyntaxHighlighterWithCopyBtnProps(77-96)newContentToCopy(65-71)handleCopyToClipboard(90-90)src/components/CopyToClipboardButton.tsx (1)
props(10-35)
|
Thanks for the PR, it works well 👍 |
Motivation and Context
Users currently need to copy twice on the search page to install an app if the bucket isn’t added.
Description
This PR makes the following changes:
Summary by CodeRabbit
New Features
Style
Refactor