-
Notifications
You must be signed in to change notification settings - Fork 4
ENG-1183: Button to minimise clipboard #626
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
base: main
Are you sure you want to change the base?
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
📝 WalkthroughWalkthroughThe Clipboard component was enhanced with a collapsible panel feature. A new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Pre-merge checks✅ Passed checks (3 passed)
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: 0
🧹 Nitpick comments (2)
apps/roam/src/components/canvas/Clipboard.tsx (2)
1079-1086: Consider using a dynamic icon that reflects the collapsed state.The button's tooltip changes based on
isCollapsed, but the icon remains static. This is inconsistent with the existing pattern in this file (line 889) where the chevron icon changes based on state. Using a dynamic icon would provide better visual feedback to users.🔎 Suggested fix: Use conditional icon
<Button - icon={<Icon icon="minus" />} + icon={<Icon icon={isCollapsed ? "plus" : "minus"} />} onClick={() => setIsCollapsed(!isCollapsed)} minimal small className="h-6 min-h-0 p-1" title={isCollapsed ? "Expand clipboard" : "Collapse clipboard"} />Alternative option using chevrons (consistent with line 889):
<Button - icon={<Icon icon="minus" />} + icon={<Icon icon={isCollapsed ? "chevron-up" : "chevron-down"} />} onClick={() => setIsCollapsed(!isCollapsed)} minimal small className="h-6 min-h-0 p-1" title={isCollapsed ? "Expand clipboard" : "Collapse clipboard"} />
1048-1048: Consider adding an explicit return type.Per coding guidelines, functions should have explicit return types. While TypeScript correctly infers the return type for this component, adding it explicitly improves code documentation and catches potential type errors earlier.
🔎 Suggested fix
-export const ClipboardPanel = () => { +export const ClipboardPanel = (): React.ReactElement | null => {As per coding guidelines for
**/*.{ts,tsx}: "Use explicit return types for functions"
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/roam/src/components/canvas/Clipboard.tsx(3 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/main.mdc)
**/*.{ts,tsx}: Use Tailwind CSS for styling where possible
When refactoring inline styles, use tailwind classes
Prefertypeoverinterfacein TypeScript
Use explicit return types for functions
Avoidanytypes when possible
Prefer arrow functions over regular function declarations
Use named parameters (object destructuring) when a function has more than 2 parameters
Use PascalCase for components and types
Use camelCase for variables and functions
Use UPPERCASE for constants
Function names should describe their purpose clearly
Prefer early returns over nested conditionals for better readability
Files:
apps/roam/src/components/canvas/Clipboard.tsx
apps/roam/**/*.{js,ts,tsx,jsx,json}
📄 CodeRabbit inference engine (.cursor/rules/roam.mdc)
Prefer existing dependencies from package.json when working on the Roam Research extension
Files:
apps/roam/src/components/canvas/Clipboard.tsx
apps/roam/**/*.{ts,tsx,jsx,js,css,scss}
📄 CodeRabbit inference engine (.cursor/rules/roam.mdc)
Use BlueprintJS 3 components and Tailwind CSS for platform-native UI in the Roam Research extension
Files:
apps/roam/src/components/canvas/Clipboard.tsx
apps/roam/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/roam.mdc)
apps/roam/**/*.{ts,tsx,js,jsx}: Use the roamAlphaApi docs from https://roamresearch.com/#/app/developer-documentation/page/tIaOPdXCj when implementing Roam functionality
Use Roam Depot/Extension API docs from https://roamresearch.com/#/app/developer-documentation/page/y31lhjIqU when implementing extension functionality
Files:
apps/roam/src/components/canvas/Clipboard.tsx
apps/roam/**
📄 CodeRabbit inference engine (.cursor/rules/roam.mdc)
Implement the Discourse Graph protocol in the Roam Research extension
Files:
apps/roam/src/components/canvas/Clipboard.tsx
🧠 Learnings (2)
📚 Learning: 2025-11-25T00:52:41.934Z
Learnt from: CR
Repo: DiscourseGraphs/discourse-graph PR: 0
File: .cursor/rules/roam.mdc:0-0
Timestamp: 2025-11-25T00:52:41.934Z
Learning: Applies to apps/roam/**/*.{ts,tsx,js,jsx} : Use the roamAlphaApi docs from https://roamresearch.com/#/app/developer-documentation/page/tIaOPdXCj when implementing Roam functionality
Applied to files:
apps/roam/src/components/canvas/Clipboard.tsx
📚 Learning: 2025-11-25T00:52:41.934Z
Learnt from: CR
Repo: DiscourseGraphs/discourse-graph PR: 0
File: .cursor/rules/roam.mdc:0-0
Timestamp: 2025-11-25T00:52:41.934Z
Learning: Applies to apps/roam/**/*.{ts,tsx,jsx,js,css,scss} : Use BlueprintJS 3 components and Tailwind CSS for platform-native UI in the Roam Research extension
Applied to files:
apps/roam/src/components/canvas/Clipboard.tsx
🔇 Additional comments (2)
apps/roam/src/components/canvas/Clipboard.tsx (2)
1051-1051: LGTM! Clean state addition.The
isCollapsedstate is properly initialized and the default expanded state provides a good initial user experience.
1097-1144: LGTM! Conditional rendering correctly implements the collapse functionality.The content is properly hidden when collapsed and displayed when expanded. The use of fragments keeps the component structure clean.

https://www.loom.com/share/d6539da17c7d46a893b13ffb3e13d2a5
Summary by CodeRabbit
New Features
✏️ Tip: You can customize this high-level summary in your review settings.