diff --git a/src/ui/CustomContextMenu.tsx b/src/ui/CustomContextMenu.tsx index 8a9cd3e..e4bc1ea 100644 --- a/src/ui/CustomContextMenu.tsx +++ b/src/ui/CustomContextMenu.tsx @@ -15,11 +15,13 @@ import { cameraHistory, } from "./cameraUtils" -// Feature flags - disable experimental features in production -const IS_PRODUCTION = import.meta.env.PROD -const ENABLE_DRAWFAST = !IS_PRODUCTION // Drawfast - dev only -const ENABLE_CALENDAR = !IS_PRODUCTION // Calendar - dev only -const ENABLE_WORKFLOW = !IS_PRODUCTION // Workflow - dev only +// Feature flags - enable experimental features in dev/staging, disable in production +// Use VITE_WORKER_ENV to determine environment (staging is NOT production) +const WORKER_ENV = import.meta.env.VITE_WORKER_ENV || 'production' +const IS_PRODUCTION_ONLY = WORKER_ENV === 'production' // Only true for actual production +const ENABLE_DRAWFAST = !IS_PRODUCTION_ONLY // Drawfast - dev/staging only +const ENABLE_CALENDAR = !IS_PRODUCTION_ONLY // Calendar - dev/staging only +const ENABLE_WORKFLOW = !IS_PRODUCTION_ONLY // Workflow - dev/staging only import { useState, useEffect } from "react" import { saveToPdf } from "../utils/pdfUtils" import { TLFrameShape } from "tldraw" @@ -135,6 +137,7 @@ export function CustomContextMenu(props: TLUiContextMenuProps) { + {ENABLE_DRAWFAST && } diff --git a/src/ui/CustomToolbar.tsx b/src/ui/CustomToolbar.tsx index 738afea..3f6e34d 100644 --- a/src/ui/CustomToolbar.tsx +++ b/src/ui/CustomToolbar.tsx @@ -17,11 +17,13 @@ import { FathomMeetingsPanel } from "../components/FathomMeetingsPanel" // Workflow Builder palette import WorkflowPalette from "../components/workflow/WorkflowPalette" -// Feature flags - disable experimental features in production -const IS_PRODUCTION = import.meta.env.PROD -const ENABLE_WORKFLOW = !IS_PRODUCTION // Workflow blocks - dev only -const ENABLE_CALENDAR = !IS_PRODUCTION // Calendar - dev only -const ENABLE_DRAWFAST = !IS_PRODUCTION // Drawfast - dev only +// Feature flags - enable experimental features in dev/staging, disable in production +// Use VITE_WORKER_ENV to determine environment (staging is NOT production) +const WORKER_ENV = import.meta.env.VITE_WORKER_ENV || 'production' +const IS_PRODUCTION_ONLY = WORKER_ENV === 'production' // Only true for actual production +const ENABLE_WORKFLOW = !IS_PRODUCTION_ONLY // Workflow blocks - dev/staging only +const ENABLE_CALENDAR = !IS_PRODUCTION_ONLY // Calendar - dev/staging only +const ENABLE_DRAWFAST = !IS_PRODUCTION_ONLY // Drawfast - dev/staging only import { getFathomApiKey, saveFathomApiKey, removeFathomApiKey, isFathomApiKeyConfigured } from "../lib/fathomApiKey" import { getMyConnections, updateEdgeMetadata, createConnection, removeConnection, updateTrustLevel } from "../lib/networking/connectionService" import { TRUST_LEVEL_COLORS, type TrustLevel, type UserConnectionWithProfile, type EdgeMetadata } from "../lib/networking/types"