Skip to content

feat: Beta Features System - Feature flags with config registry + DB state #287

@filipexyz

Description

@filipexyz

Summary

Implement a beta features system that allows developers to define experimental features in a config file and users to toggle them on/off via the Settings UI.

Motivation

We need a way to:

  • Ship experimental features without exposing them to all users by default
  • Let users opt-in to try beta functionality
  • Gate entire UI sections behind feature flags
  • Track which features are enabled without code changes

Design

Hybrid Config + Database approach:

Component Purpose
beta-features.toml Defines available features (name, description, maturity) - version controlled
forge_beta_feature_state table Stores user's enabled/disabled preferences
Settings UI "Beta Features" tab with toggles
<BetaFeatureGate> React component for conditional rendering

Developer Workflow

  1. Add feature to beta-features.toml:
[features.my_feature]
name = "My Feature"
description = "What it does"
maturity = "experimental"
  1. Use in code:
// Backend
if services.beta_features.is_enabled("my_feature").await? { ... }
// Frontend
<BetaFeatureGate feature="my_feature">
  <MyFeatureComponent />
</BetaFeatureGate>

Acceptance Criteria

  • Config file (beta-features.toml) for feature definitions
  • Database table for enabled/disabled state
  • Rust service with is_enabled() check
  • API endpoints: GET /api/forge/beta-features, POST .../toggle
  • React context with useBetaFeature() hook
  • <BetaFeatureGate> component for UI gating
  • Settings page with feature toggles
  • TypeScript types auto-generated

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions