Add stat effects to menu options and improve popover positioning#184
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughBackend: add optional effects.stats to labelLines schema and seed data (enriches multiple menuOptions and adds two new label lines). Frontend: TechnicalPopover now measures viewport space and flips above the anchor when needed. ChangesBackend effects.stats support
Frontend popover adaptive positioning
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/frontend/src/components/write-mode/TechnicalPopover.tsx`:
- Around line 72-87: The positioning effect in TechnicalPopover (the useEffect
that reads popoverRef and calls setIsFlipped) must be made robust: replace
useEffect with useLayoutEffect so the flip is computed before paint (preventing
the initial layout jump), include the props that change content (type and data)
in the dependency array, and register window resize and scroll listeners that
call the same measurement function (reading popoverRef.getBoundingClientRect(),
computing spaceBelow, and calling setIsFlipped) with proper cleanup in the
returned disposer; keep the measurement logic factored into a named function
(e.g., measureAndSetFlip) so it can be invoked from the layout effect and event
handlers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 55a88ecd-d0aa-4266-8b40-fc83b3ab2cfe
📒 Files selected for processing (4)
apps/backend/scripts/seed-technical-badges.tsapps/backend/src/db/schema/tables/label-lines.tsapps/backend/src/services/labels.service.tsapps/frontend/src/components/write-mode/TechnicalPopover.tsx
Summary by CodeRabbit