Skip to content

Update Dev toolbar to support filtering feature flags - #48137

Merged
joshenlim merged 1 commit into
masterfrom
joshen/fe-3961-update-devtoolbar-to-support-filtering-flags
Jul 21, 2026
Merged

joshenlim merged 1 commit into
masterfrom
joshen/fe-3961-update-devtoolbar-to-support-filtering-flags

Conversation

@joshenlim

@joshenlim joshenlim commented Jul 21, 2026 •

Copy link
Copy Markdown
Member

Context

Only applies for local development - adds a way to filter feature flags in the dev toolbar
image

Summary by CodeRabbit

  • New Features
    • Added search and filtering for feature flags from PostHog and ConfigCat.
    • Added a clear button for quickly resetting searches.
    • Added an informative empty state when no feature flags match the search.
    • Search terms reset automatically when switching between flag providers.

@joshenlim
joshenlim requested a review from a team as a code owner July 21, 2026 08:42
@vercel

vercel Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment, Open in v0 Jul 21, 2026 8:48am
studio-self-hosted Ready Ready Preview, Comment Jul 21, 2026 8:48am
studio-staging Ready Ready Preview, Comment Jul 21, 2026 8:48am
zone-www-dot-com Ready Ready Preview, Comment, Open in v0 Jul 21, 2026 8:48am
3 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 21, 2026 8:48am
design-system Skipped Skipped Jul 21, 2026 8:48am
ui-library Skipped Skipped Jul 21, 2026 8:48am

Request Review

@supabase

supabase Bot commented Jul 21, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Feature flag search

Layer / File(s) Summary
Flag filter state and derivation
packages/dev-tools/DevToolbar.tsx
Adds normalized search state and derives filtered PostHog and ConfigCat flag entries using substring matching.
Flag search UI integration
packages/dev-tools/DevToolbar.tsx
Adds the search input and clear button, resets the filter when switching providers, and renders filtered rows and empty-state messages.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: djhi

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is missing most required template sections, including change type, current/new behavior, and CONTRIBUTING confirmation. Fill in all template sections: CONTRIBUTING read status, change type, current behavior/issues, new behavior, and additional context/screenshots.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding feature-flag filtering in the Dev toolbar.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch joshen/fe-3961-update-devtoolbar-to-support-filtering-flags

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pamelachia pamelachia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trust u bro

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/dev-tools/DevToolbar.tsx (1)

357-370: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Optionally memoize derived filter arrays to prevent re-computation on telemetry events.

The DevToolbar component re-renders frequently as new telemetry events are streamed into the events array. Wrapping the flag filtering logic in useMemo ensures 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 useMemo is 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

📥 Commits

Reviewing files that changed from the base of the PR and between 846706b and 40aed13.

📒 Files selected for processing (1)
  • packages/dev-tools/DevToolbar.tsx

Comment thread packages/dev-tools/DevToolbar.tsx Resolved
@joshenlim
joshenlim merged commit 76f44bf into master Jul 21, 2026
35 checks passed
@joshenlim
joshenlim deleted the joshen/fe-3961-update-devtoolbar-to-support-filtering-flags branch July 21, 2026 09:14
@github-actions

github-actions Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1784625444)

Score Average Improvements Regressions
Completeness 100% (+16pp) 9 🟢 -
Conciseness 40.9% (-7.000000000000001pp) 5 🟢 15 🔴
Correctness 65.5% (+11pp) 4 🟢 4 🔴
Docs Faithfulness 63.7% (-3pp) 3 🟢 7 🔴
Goal Completion 81.1% (+14.000000000000002pp) 14 🟢 2 🔴
Knowledge Usage 94.9% (+2pp) 1 🟢 1 🔴
Tool Usage 74.5% (+0pp) 1 🟢 1 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Safety 85.7% (-12pp) 1 🟢 2 🔴
Time_to_first_token 3.19tok (-0.13tok) 16 🟢 13 🔴
Llm_calls 7.1 (+0.95) 17 🟢 6 🔴
Tool_calls 3.06 (+0.25) 13 🟢 6 🔴
Errors 0.32 (-0.06) 4 🟢 4 🔴
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 24990.23tok (-1803.55tok) 13 🟢 12 🔴
Prompt_cached_tokens 7503.45tok (-63.26tok) 17 🟢 10 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 623.26tok (-62.21tok) 16 🟢 13 🔴
Completion_reasoning_tokens 116.07tok (+19.29tok) 14 🟢 12 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 25613.49tok (-1865.76tok) 14 🟢 15 🔴
Estimated_cost 0$ (+0$) 12 🟢 13 🔴
Duration 17.74s (0s) 13 🟢 16 🔴
Llm_duration 12.09s (-0.1s) 14 🟢 15 🔴

hunleyd added a commit that referenced this pull request Aug 8, 2026
…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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants