feat(decnet_web/theme-lab): scaffold dev-gated /theme-lab route

Adds VITE_DECNET_DEVELOPER build-time gate: when unset, the
isDeveloperMode() helper collapses to a constant false and Vite
tree-shakes both the lazy import and the conditional <Route> out
of the prod bundle.

ThemeLab is currently a header stub; subsequent tasks fill it
with the design-system primitive zoo plus a Dark/Light toggle
for live token tuning. Route is intentionally absent from
ROUTE_LABELS / sidebar — direct URL only.
This commit is contained in:
2026-05-09 03:18:34 -04:00
parent 65ddaaa681
commit 846a50dbbf
6 changed files with 112 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ import ShortcutsHelp from './components/ShortcutsHelp/ShortcutsHelp';
import { ToastProvider } from './components/Toasts/ToastProvider';
import { useToast } from './components/Toasts/useToast';
import { useGlobalHotkeys } from './hooks/useGlobalHotkeys';
import { isDeveloperMode } from './lib/devGate';
// Page components are code-split per route. Each lands as its own
// chunk and only downloads when the user navigates to that path —
@@ -38,6 +39,10 @@ const RemoteUpdates = lazy(() => import('./components/RemoteUpdates'));
const SwarmHosts = lazy(() => import('./components/SwarmHosts'));
const MazeNET = lazy(() => import('./components/MazeNET/MazeNET'));
const TopologyList = lazy(() => import('./components/TopologyList/TopologyList'));
/* Dev-gated route: when VITE_DECNET_DEVELOPER is unset at build time,
* isDeveloperMode() collapses to `false` and Vite tree-shakes both
* the import below and the conditional <Route> out of the bundle. */
const ThemeLab = lazy(() => import('./components/ThemeLab/ThemeLab'));
/* Minimal fallback rendered while a lazy-loaded route chunk is in
* flight. Matches the house "dim mono" voice — no spinner library,
@@ -139,6 +144,9 @@ const AuthedShell: React.FC<AuthedShellProps> = ({ onLogout, onSearch, searchQue
<Route path="/swarm-updates" element={<RemoteUpdates />} />
<Route path="/swarm/hosts" element={<SwarmHosts />} />
<Route path="/swarm/enroll" element={<Navigate to="/swarm/hosts" replace />} />
{isDeveloperMode() && (
<Route path="/theme-lab" element={<ThemeLab />} />
)}
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
</Suspense>