mirror of
https://github.com/block/buzz.git
synced 2026-11-03 16:01:35 +00:00
- Add features.json manifest at repo root (single source of truth) - Implement useFeatureEnabled hook + FeatureGate component - Add ExperimentalFeaturesCard settings panel with opt-in toggles - Gate sidebar items: managed-agents, projects, workflows - Gate settings sections via featureGate descriptor field - Three tiers: stable (always on), experimental (opt-in), dev (dev-only) - Global 'Show developer features' toggle for dev tier suppression - localStorage persistence for user overrides - Designed for Flutter consumption (JSON manifest, platforms field) Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
18 lines
627 B
TypeScript
18 lines
627 B
TypeScript
import manifestJson from "../../../../features.json";
|
|
import type { FeatureDefinition, FeaturesManifest } from "./types";
|
|
|
|
const manifest = manifestJson as FeaturesManifest;
|
|
|
|
/** All features defined in the manifest */
|
|
export const allFeatures: FeatureDefinition[] = manifest.features;
|
|
|
|
/** Only features available on desktop */
|
|
export const desktopFeatures: FeatureDefinition[] = manifest.features.filter(
|
|
(f) => !f.platforms || f.platforms.includes("desktop"),
|
|
);
|
|
|
|
/** Look up a feature by id */
|
|
export function getFeature(id: string): FeatureDefinition | undefined {
|
|
return manifest.features.find((f) => f.id === id);
|
|
}
|