style: Adjust copy button position in APITabsComponent#8801
Conversation
…o 4px instead of 2px
WalkthroughThe change updates the horizontal positioning of the copy-to-clipboard button in the API code tabs component by adjusting its CSS class, specifically increasing the right offset. There are no alterations to functionality, event handlers, or exported entities. Changes
Sequence Diagram(s)No sequence diagram generated as the change is limited to UI styling and does not affect control flow or component interactions. ✨ 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/frontend/src/modals/apiModal/codeTabs/code-tabs.tsx (2)
23-23: Prefer thebooleanprimitive over theBooleanobject wrapper
useState<Boolean>uses the boxedBooleantype, which is rarely desirable and can introduce subtle issues when comparing values. The primitivebooleanis the idiomatic choice in TypeScript for state variables.- const [isCopied, setIsCopied] = useState<Boolean>(false); + const [isCopied, setIsCopied] = useState<boolean>(false);
147-153: Add an accessible label to the copy button and remove the unusedgrouputility classThe positional tweak looks fine, but the button currently lacks an
aria-label/title, so screen-readers provide no context. Thegroupclass is also unused because there are no child selectors relying on it. Streamline the markup and improve accessibility:- <Button - variant="ghost" - size="icon" - onClick={copyToClipboard} - data-testid="btn-copy-code" - className="!hover:bg-foreground group absolute right-4 top-2" - > + <Button + aria-label={isCopied ? "Code copied to clipboard" : "Copy code to clipboard"} + title={isCopied ? "Copied!" : "Copy"} + variant="ghost" + size="icon" + onClick={copyToClipboard} + data-testid="btn-copy-code" + className="!hover:bg-foreground absolute right-4 top-2" + >
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/frontend/src/modals/apiModal/codeTabs/code-tabs.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`src/frontend/**/*.{ts,tsx}`: Use React 18 with TypeScript for all UI components and frontend logic.
src/frontend/**/*.{ts,tsx}: Use React 18 with TypeScript for all UI components and frontend logic.
📄 Source: CodeRabbit Inference Engine (.cursor/rules/frontend_development.mdc)
List of files the instruction was applied to:
src/frontend/src/modals/apiModal/codeTabs/code-tabs.tsx
`src/frontend/**/*.{ts,tsx,js,jsx,css,scss}`: Use Tailwind CSS for styling all frontend components.
src/frontend/**/*.{ts,tsx,js,jsx,css,scss}: Use Tailwind CSS for styling all frontend components.
📄 Source: CodeRabbit Inference Engine (.cursor/rules/frontend_development.mdc)
List of files the instruction was applied to:
src/frontend/src/modals/apiModal/codeTabs/code-tabs.tsx
🧠 Learnings (1)
src/frontend/src/modals/apiModal/codeTabs/code-tabs.tsx (1)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.494Z
Learning: Applies to src/frontend/src/{components,hooks}/**/*.{ts,tsx} : Implement dark mode support in components and hooks where needed.
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Validate PR
- GitHub Check: Validate PR
- GitHub Check: autofix
🐛 (code-tabs.tsx): fix button positioning by adjusting right margin to 4px instead of 2px
🐛 (code-tabs.tsx): fix button positioning by adjusting right margin to 4px instead of 2px
🐛 (code-tabs.tsx): fix button positioning by adjusting right margin to 4px instead of 2px
🐛 (code-tabs.tsx): fix button positioning by adjusting right margin to 4px instead of 2px
This pull request includes a minor adjustment to the
APITabsComponentincode-tabs.tsx. The change modifies theclassNameproperty of the copy button to adjust its position slightly, moving it further to the right.Copy button isn't overlapping the scroll bar anymore on Firefox.