Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
📝 WalkthroughWalkthroughChangesFeature flag search
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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
🧹 Nitpick comments (1)
packages/dev-tools/DevToolbar.tsx (1)
357-370: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low valueOptionally memoize derived filter arrays to prevent re-computation on telemetry events.
The
DevToolbarcomponent re-renders frequently as new telemetry events are streamed into theeventsarray. Wrapping the flag filtering logic inuseMemoensures that the array is only re-calculated when the flags or the search filter actually change, rather than on every event push.♻️ Proposed refactor
const normalizedFlagFilter = flagFilter.trim().toLowerCase() - const filteredPosthogEntries = normalizedFlagFilter - ? Object.entries(posthogFlags).filter(([flagName]) => - flagName.toLowerCase().includes(normalizedFlagFilter) - ) - : Object.entries(posthogFlags) - - const filteredConfigcatEntries = normalizedFlagFilter - ? Object.entries(configcatFlags).filter(([flagName]) => - flagName.toLowerCase().includes(normalizedFlagFilter) - ) - : Object.entries(configcatFlags) + const filteredPosthogEntries = useMemo(() => { + return normalizedFlagFilter + ? Object.entries(posthogFlags).filter(([flagName]) => + flagName.toLowerCase().includes(normalizedFlagFilter) + ) + : Object.entries(posthogFlags) + }, [posthogFlags, normalizedFlagFilter]) + + const filteredConfigcatEntries = useMemo(() => { + return normalizedFlagFilter + ? Object.entries(configcatFlags).filter(([flagName]) => + flagName.toLowerCase().includes(normalizedFlagFilter) + ) + : Object.entries(configcatFlags) + }, [configcatFlags, normalizedFlagFilter])(Note: Ensure
useMemois imported from React if you apply this change)🤖 Prompt for 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. In `@packages/dev-tools/DevToolbar.tsx` around lines 357 - 370, Memoize the derived filteredPosthogEntries and filteredConfigcatEntries calculations in DevToolbar with useMemo, using the corresponding flags objects and normalized search filter as dependencies so telemetry-driven re-renders do not recompute them. Add the useMemo import from React if it is not already available.
🤖 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 `@packages/dev-tools/DevToolbar.tsx`:
- Around line 549-557: Add sizing classes to the X icon rendered by the
clear-filter Button in DevToolbar, using w-4 h-4 so it matches the tiny input
and other toolbar icons without changing the existing clear behavior.
---
Nitpick comments:
In `@packages/dev-tools/DevToolbar.tsx`:
- Around line 357-370: Memoize the derived filteredPosthogEntries and
filteredConfigcatEntries calculations in DevToolbar with useMemo, using the
corresponding flags objects and normalized search filter as dependencies so
telemetry-driven re-renders do not recompute them. Add the useMemo import from
React if it is not already available.
🪄 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: c2a747a3-db92-4957-bc17-de5857889b95
📒 Files selected for processing (1)
packages/dev-tools/DevToolbar.tsx
Braintrust eval report
|
…fomap-entry-for-pitr-archiving-stale' into hunleyd/indata-979-studio-lintinfomap-entry-for-pitr-archiving-stale * origin/hunleyd/indata-979-studio-lintinfomap-entry-for-pitr-archiving-stale: (35 commits) chore: simplify CPU messaging for compute sizes (#48109) chore(studio): add valtio and react-hook-form ESLint ratchet rules (#48037) feat: Add ai/python federated content and data (#48043) feat: Add ai-skills federated content and data (#48045) feat: Add deployment/ci federated content and data (#48041) fix(studio): wire up siwc-enabled query param opt-in on sign-in/sign-up (#48126) fix(studio): stop stacking overlaid area series in report charts (#48034) Update Dev toolbar to support filtering feature flags (#48137) Update dev toolbar to support mocking org restrictions (#48136) feat: Add terraform federated content and data (#48010) Chore/add sessions database connections (#48094) fix(studio): guard panel collapse/resize on narrow viewports (#48098) Landing page agent focus (#47989) fix(studio): chip away explicit-tabindex ratchet debt (#48040) fix(studio): untangle nested buttons in editor tabs (#48101) fix(docs): broken link (#48117) docs: add VS Code to the AI coding agent plugin install picker (#48108) docs: add Kimi Code to MCP and AI coding agent plugin setup (#48099) fix: preserve function responses (#47920) fix(assistant): SQL approval buttons do nothing (#48102) ...
Context
Only applies for local development - adds a way to filter feature flags in the dev toolbar

Summary by CodeRabbit