-
Notifications
You must be signed in to change notification settings - Fork 3
[ENG-363] Node search menu UI bug #239
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
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughA custom Popper.js modifier named Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant NodeSearchMenu
participant Popover
participant Popper.js
User->>NodeSearchMenu: Triggers popover display
NodeSearchMenu->>Popover: Render with modifiers
Popover->>Popper.js: Apply modifiers (including custom offset)
Popper.js-->>Popover: Calculates position (subtracts 30px from top if needed)
Popover-->>NodeSearchMenu: Displays adjusted popover
Possibly related PRs
Suggested reviewers
Poem
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
CodeRabbit Configuration File (
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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 (1)
apps/roam/src/components/DiscourseNodeSearchMenu.tsx (1)
407-415: The positioning fix looks correct but consider addressing potential edge cases.The custom
offsetmodifier properly adjusts the popover position when placed above the target element. However, there are a few considerations:
- Magic number: The 30px offset is hardcoded - consider extracting it as a named constant for maintainability
- Defensive programming: Add safety checks for the data structure
- API compatibility: Ensure this syntax remains compatible with the Popper.js version used by Blueprint.js
Consider this defensive approach:
- offset: { - enabled: true, - fn: (data) => { - if (data.placement.startsWith("top")) { - data.offsets.popper.top -= 30; - } - return data; - }, - }, + offset: { + enabled: true, + fn: (data) => { + if (data.placement?.startsWith("top") && data.offsets?.popper) { + data.offsets.popper.top -= POPOVER_TOP_OFFSET; + } + return data; + }, + },And add at the top of the file:
+const POPOVER_TOP_OFFSET = 30; // Adjustment for top-positioned popover to prevent overlap
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/roam/src/components/DiscourseNodeSearchMenu.tsx(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: deploy
mdroidian
left a 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.
🔥
https://www.loom.com/share/c8e96010a98b43da83376cfa999ca9d5
Summary by CodeRabbit