From f8fdff7f0c1b8efdef9093c932e28e427799d6ef Mon Sep 17 00:00:00 2001 From: cashmere Date: Mon, 27 Jul 2026 01:21:02 +0200 Subject: feat: gate sounds/stickers/effects UI behind feature flags FEATURES in src/features.ts (all false) hides the assets-panel tabs and views, the clip effects properties tab, and the timeline effects badge. Existing project data still renders and stays editable (standalone effect tab, sticker config, renderer nodes untouched). --- apps/web/src/components/editor/panels/assets/index.tsx | 7 ++++--- apps/web/src/components/editor/panels/assets/tabbar.tsx | 10 +++++++++- apps/web/src/components/editor/panels/properties/registry.tsx | 9 +++++---- 3 files changed, 18 insertions(+), 8 deletions(-) (limited to 'apps/web/src/components/editor/panels') diff --git a/apps/web/src/components/editor/panels/assets/index.tsx b/apps/web/src/components/editor/panels/assets/index.tsx index bae73299..09d64eed 100644 --- a/apps/web/src/components/editor/panels/assets/index.tsx +++ b/apps/web/src/components/editor/panels/assets/index.tsx @@ -10,16 +10,17 @@ import { SoundsView } from "@/sounds/components/assets-view"; import { StickersView } from "@/stickers/components/assets-view"; import { TextView } from "@/text/components/assets-view"; import { EffectsView } from "@/effects/components/assets-view"; +import { FEATURES } from "@/features"; export function AssetsPanel() { const { activeTab } = useAssetsPanelStore(); const viewMap: Record = { media: , - sounds: , + sounds: FEATURES.sounds ? : null, text: , - stickers: , - effects: , + stickers: FEATURES.stickers ? : null, + effects: FEATURES.effects ? : null, transitions: (
Transitions view coming soon... diff --git a/apps/web/src/components/editor/panels/assets/tabbar.tsx b/apps/web/src/components/editor/panels/assets/tabbar.tsx index 3b084c0d..b468b5bb 100644 --- a/apps/web/src/components/editor/panels/assets/tabbar.tsx +++ b/apps/web/src/components/editor/panels/assets/tabbar.tsx @@ -13,6 +13,14 @@ import { tabs, useAssetsPanelStore, } from "@/components/editor/panels/assets/assets-panel-store"; +import { FEATURES } from "@/features"; + +const VISIBLE_TAB_KEYS = TAB_KEYS.filter((tabKey) => { + if (tabKey === "sounds") return FEATURES.sounds; + if (tabKey === "stickers") return FEATURES.stickers; + if (tabKey === "effects") return FEATURES.effects; + return true; +}); export function TabBar() { const { activeTab, setActiveTab } = useAssetsPanelStore(); @@ -51,7 +59,7 @@ export function TabBar() { ref={scrollRef} className="scrollbar-hidden relative flex size-full p-1 flex-col items-center justify-start gap-0.5 overflow-y-auto" > - {TAB_KEYS.map((tabKey) => { + {VISIBLE_TAB_KEYS.map((tabKey) => { const tab = tabs[tabKey]; return ( diff --git a/apps/web/src/components/editor/panels/properties/registry.tsx b/apps/web/src/components/editor/panels/properties/registry.tsx index 1eda6575..15f010f7 100644 --- a/apps/web/src/components/editor/panels/properties/registry.tsx +++ b/apps/web/src/components/editor/panels/properties/registry.tsx @@ -28,6 +28,7 @@ import { MasksTab } from "@/masks/components/masks-tab"; import { SpeedTab } from "@/speed/components/speed-tab"; import { GraphicTab } from "@/graphics/components/graphic-tab"; import { OcShapesIcon } from "@/components/icons"; +import { FEATURES } from "@/features"; const TRANSFORM_PARAM_KEYS = [ "transform.positionX", @@ -251,7 +252,7 @@ function getVideoConfig({ buildSpeedTab({ element }), buildBlendingTab({ element }), buildMasksTab({ element }), - buildClipEffectsTab({ element }), + ...(FEATURES.effects ? [buildClipEffectsTab({ element })] : []), ], }; } @@ -267,7 +268,7 @@ function getImageConfig({ buildTransformTab({ element }), buildBlendingTab({ element }), buildMasksTab({ element }), - buildClipEffectsTab({ element }), + ...(FEATURES.effects ? [buildClipEffectsTab({ element })] : []), ], }; } @@ -282,7 +283,7 @@ function getStickerConfig({ tabs: [ buildTransformTab({ element }), buildBlendingTab({ element }), - buildClipEffectsTab({ element }), + ...(FEATURES.effects ? [buildClipEffectsTab({ element })] : []), ], }; } @@ -299,7 +300,7 @@ function getGraphicConfig({ buildTransformTab({ element }), buildBlendingTab({ element }), buildMasksTab({ element }), - buildClipEffectsTab({ element }), + ...(FEATURES.effects ? [buildClipEffectsTab({ element })] : []), ], }; } -- cgit v1.3.1