Skip to content

Conversation

@alaister
Copy link
Member

@alaister alaister commented Aug 14, 2025

This PR adds client side (non-API-driven) support for disabling dashboard features. It extends the existing useIsFeatureEnabled() hook.

API Design

  • Allow for control from either or both the API side + Frontend side.
  • Fully type-safe with proper descriptions to allow for an easy UX. e.g.:
    Screenshot 2025-08-13 at 22 20 35
  • Minimal new patterns required.

How to add support for enabling/disabling a new feature in the dashboard:

  1. Add a name and description to enabled-features.schema.json

    The naming convention should be group:feature. This PR includes the examples: profile:show_email and profile:update. These names can conflict with existing feature names returned by the API. This is so we can have API or Frontend control over a feature.

  2. Add the default state (true/false for on/off) in enabled-features.json. Generally we should be defaulting to true for hosted studio.

  3. Implement useIsFeatureEnabled() to conditionally check if a feature is enabled.
    For a single check:

    const profileShowEmailEnabled = useIsFeatureEnabled('profile:show_email')

    For checking multiple features at a time:

    const { profileShowEmail: profileShowEmailEnabled, profileUpdate: profileUpdateEnabled } =
      useIsFeatureEnabled(['profile:show_email', 'profile:update'])

@alaister alaister requested a review from a team as a code owner August 14, 2025 02:13
@vercel
Copy link

vercel bot commented Aug 14, 2025

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

Project Deployment Preview Comments Updated (UTC)
design-system Ready Preview Comment Aug 15, 2025 5:29am
docs Ready Preview Comment Aug 15, 2025 5:29am
studio-self-hosted Ready Preview Comment Aug 15, 2025 5:29am
studio-staging Ready Preview Comment Aug 15, 2025 5:29am
ui-library Ready Preview Comment Aug 15, 2025 5:29am
zone-www-dot-com Ready Preview Comment Aug 15, 2025 5:29am
2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cms ⬜️ Ignored Aug 15, 2025 5:29am
studio ⬜️ Ignored Aug 15, 2025 5:29am

@supabase
Copy link

supabase bot commented Aug 14, 2025

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 ↗︎.

Copy link
Contributor

@charislam charislam left a comment

Choose a reason for hiding this comment

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

Tested locally toggling profile:email off and worked as expected!

@coveralls
Copy link

Coverage Status

coverage: 71.197%. remained the same
when pulling 292eff0 on feat/enabled-disable-features
into 41bfd35 on master.

@alaister alaister merged commit 915ba4b into master Aug 15, 2025
19 of 20 checks passed
@alaister alaister deleted the feat/enabled-disable-features branch August 15, 2025 17:45
PLyn pushed a commit that referenced this pull request Aug 25, 2025
* feat: enable/disable dashboard features

* use the set directly

* move enabled features to common

* remove sneaky any

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
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.

4 participants