diff --git a/mobile/src/lib/platform.ts b/mobile/src/lib/platform.ts index 076c3ac..b28e368 100644 --- a/mobile/src/lib/platform.ts +++ b/mobile/src/lib/platform.ts @@ -28,6 +28,11 @@ export const featureFlagClient = createFeatureFlagClient({ productId: PRODUCT_ID, platform: 'mobile', pollIntervalMs: 5 * 60 * 1000, + getAccessToken, + storage: { + getItem: (key: string) => mmkvStorage.getItem(key), + setItem: (key: string, value: string) => mmkvStorage.setItem(key, value), + }, }); export const killSwitchClient = createKillSwitchClient({ @@ -75,6 +80,13 @@ export function isFeatureEnabled(key: string): boolean { return featureFlagClient.isEnabled(key); } +export function getFeatureValue>( + key: string, + defaultValue: T, +): T { + return featureFlagClient.getValue(key, defaultValue); +} + export async function checkKillSwitch(): Promise<{ disabled: boolean; message: string | null }> { return killSwitchClient.check(); } diff --git a/web/src/components/Sidebar.tsx b/web/src/components/Sidebar.tsx index fea58e4..472e87f 100644 --- a/web/src/components/Sidebar.tsx +++ b/web/src/components/Sidebar.tsx @@ -4,11 +4,12 @@ import Link from "next/link"; import { usePathname } from "next/navigation"; import { House, Search, Settings, Sparkles, FolderKanban, ShieldCheck } from "lucide-react"; import { PRODUCT_NAME } from "@/lib/product-config"; +import { isFeatureEnabled } from "@/lib/feature-flags"; -const navItems = [ +const navItems: { href: string; label: string; icon: typeof House; flag?: string }[] = [ { href: "/dashboard", label: "Dashboard", icon: House }, { href: "/workspaces", label: "Workspaces", icon: FolderKanban }, - { href: "/reviews", label: "Reviews", icon: ShieldCheck }, + { href: "/reviews", label: "Reviews", icon: ShieldCheck, flag: "mcp_tools_enabled" }, { href: "/search", label: "Search", icon: Search }, { href: "/settings", label: "Settings", icon: Settings }, ]; @@ -33,7 +34,7 @@ export function Sidebar() {