Commit c4f865d1 authored by Aryan Noshirvnai's avatar Aryan Noshirvnai

Gate Remix behind a build-time flag, off by default

Ahead of the first automated prod deploy, Remix stays hidden (no nav
entry, /remix redirects to /library) rather than going live for real
users - it's fully built and already exercised elsewhere, just not ready
to ship yet. Set VITE_ENABLE_REMIX=true at build time when it is; no
other code change needed.
Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
parent bb243689
Pipeline #1167 failed
...@@ -18,6 +18,10 @@ VITE_API_BASE_URL=http://144.76.210.145:8000 ...@@ -18,6 +18,10 @@ VITE_API_BASE_URL=http://144.76.210.145:8000
# already caused a real outage in this project once: # already caused a real outage in this project once:
BACKEND_PROXY_TARGET=http://127.0.0.1:8000 BACKEND_PROXY_TARGET=http://127.0.0.1:8000
# Remix is fully built but deliberately not yet exposed to prod users - off (the nav entry and
# /remix route both disappear, redirecting to /library) unless this is explicitly set:
VITE_ENABLE_REMIX=false
# There is no dev-only auto-login token pair anymore (removed 2026-08-15) - it was a # There is no dev-only auto-login token pair anymore (removed 2026-08-15) - it was a
# single-use, rotating refresh token baked into a static file and shared across every # single-use, rotating refresh token baked into a static file and shared across every
# consumer (every dev session, every test run, every curl); the instant any one of them used # consumer (every dev session, every test run, every curl); the instant any one of them used
......
...@@ -2,6 +2,7 @@ import { lazy, Suspense } from 'react' ...@@ -2,6 +2,7 @@ import { lazy, Suspense } from 'react'
import { Navigate, Route, Routes } from 'react-router-dom' import { Navigate, Route, Routes } from 'react-router-dom'
import { ProtectedRoute } from './components/ProtectedRoute' import { ProtectedRoute } from './components/ProtectedRoute'
import { RequireRole } from './components/RequireRole' import { RequireRole } from './components/RequireRole'
import { REMIX_ENABLED } from './config/flags'
// Lazy, not eager, imports - every page used to ship in one ~590KB bundle loaded before *any* // Lazy, not eager, imports - every page used to ship in one ~590KB bundle loaded before *any*
// route could render, including the very first one someone hits (Login or Library). Splitting // route could render, including the very first one someone hits (Login or Library). Splitting
...@@ -48,7 +49,10 @@ export function App() { ...@@ -48,7 +49,10 @@ export function App() {
<Route path="/upload" element={protect(<Upload />)} /> <Route path="/upload" element={protect(<Upload />)} />
<Route path="/discovery" element={protect(<Discovery />)} /> <Route path="/discovery" element={protect(<Discovery />)} />
<Route path="/social" element={protect(<Social />)} /> <Route path="/social" element={protect(<Social />)} />
<Route path="/remix" element={protect(<Remix />)} /> {/* Gated by a build-time flag (see config/flags.ts) rather than removed - fully built
and used elsewhere, just not yet exposed to prod users. Redirects rather than 404s
so a stale link/bookmark lands somewhere real instead of a dead end. */}
<Route path="/remix" element={REMIX_ENABLED ? protect(<Remix />) : <Navigate to="/library" replace />} />
<Route path="/soundmarks" element={protect(<Soundmarks />)} /> <Route path="/soundmarks" element={protect(<Soundmarks />)} />
{/* Old, now-merged routes - redirect rather than 404 in case anything still links here. */} {/* Old, now-merged routes - redirect rather than 404 in case anything still links here. */}
<Route path="/rooms" element={<Navigate to="/social" replace />} /> <Route path="/rooms" element={<Navigate to="/social" replace />} />
......
...@@ -27,13 +27,14 @@ import { PlaybackErrorToast } from './PlaybackErrorToast' ...@@ -27,13 +27,14 @@ import { PlaybackErrorToast } from './PlaybackErrorToast'
import { InstallBanner } from './InstallBanner' import { InstallBanner } from './InstallBanner'
import { useBackButtonClose } from '../hooks/useBackButtonClose' import { useBackButtonClose } from '../hooks/useBackButtonClose'
import { useMountTransition } from '../hooks/useMountTransition' import { useMountTransition } from '../hooks/useMountTransition'
import { REMIX_ENABLED } from '../config/flags'
const MORE_SHEET_ANIMATION_MS = 300 const MORE_SHEET_ANIMATION_MS = 300
// Rooms/Channels/Posts share one "Social" destination and Nearby/Drops share one // Rooms/Channels/Posts share one "Social" destination and Nearby/Drops share one
// "Soundmarks" destination (both merged 2026-08-23) - each hub page owns its own in-page // "Soundmarks" destination (both merged 2026-08-23) - each hub page owns its own in-page
// sub-tab switcher instead of splitting related features across the top-level nav. // sub-tab switcher instead of splitting related features across the top-level nav.
const NAV_ITEMS: { to: string; label: string; icon: LucideIcon }[] = [ const ALL_NAV_ITEMS: { to: string; label: string; icon: LucideIcon }[] = [
{ to: '/library', label: 'Library', icon: Library }, { to: '/library', label: 'Library', icon: Library },
{ to: '/playlists', label: 'Playlists', icon: ListMusic }, { to: '/playlists', label: 'Playlists', icon: ListMusic },
{ to: '/upload', label: 'Upload', icon: Upload }, { to: '/upload', label: 'Upload', icon: Upload },
...@@ -44,6 +45,8 @@ const NAV_ITEMS: { to: string; label: string; icon: LucideIcon }[] = [ ...@@ -44,6 +45,8 @@ const NAV_ITEMS: { to: string; label: string; icon: LucideIcon }[] = [
{ to: '/telegram-link', label: 'Telegram', icon: Link2 }, { to: '/telegram-link', label: 'Telegram', icon: Link2 },
] ]
const NAV_ITEMS = REMIX_ENABLED ? ALL_NAV_ITEMS : ALL_NAV_ITEMS.filter((item) => item.to !== '/remix')
// The 5 most-reached destinations get a fixed mobile tab (matches the design system's // The 5 most-reached destinations get a fixed mobile tab (matches the design system's
// "5-tab reachability" spec); everything else lives behind the More sheet, 6th tab. Desktop's // "5-tab reachability" spec); everything else lives behind the More sheet, 6th tab. Desktop's
// sidebar has room to just list all of NAV_ITEMS, so this split is mobile-only. // sidebar has room to just list all of NAV_ITEMS, so this split is mobile-only.
......
// Build-time feature flags, read once at module load (Vite inlines import.meta.env.* at build
// time, so these are fixed per-build, not per-request - flipping one means rebuilding/redeploying,
// not just restarting a server).
// Off by default on purpose: Remix is fully built and already live on staging/dev, but hasn't
// been exposed to real prod users yet - this keeps it out of the nav and off /remix (redirects
// away) without touching routing code or git history each time. Set VITE_ENABLE_REMIX=true at
// build time (a CI variable, not a code change) once it's ready to go live.
export const REMIX_ENABLED = import.meta.env.VITE_ENABLE_REMIX === 'true'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment