diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 16f64e4a..5f7d272e 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,5 +1,5 @@ import { useEffect, type ReactElement } from 'react'; -import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; +import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom'; import { LandingPage } from './pages/LandingPage'; import { EditorPage } from './pages/EditorPage'; import { ExamplesPage } from './pages/ExamplesPage'; @@ -43,8 +43,17 @@ import './App.css'; * Index entries (path === '') belong to the locale-prefixed parent's * `index` slot — they render at exactly `//`. */ +// In Tauri desktop builds the marketing landing page is a disorienting +// first screen — users opened the desktop app to land in the editor. +// `/` redirects there. Web builds still see the LandingPage. +const ROOT_ELEMENT: ReactElement = import.meta.env.VITE_DESKTOP ? ( + +) : ( + +); + const ROUTES: { path: string; element: ReactElement; index?: boolean }[] = [ - { path: '/', element: , index: true }, + { path: '/', element: ROOT_ELEMENT, index: true }, { path: 'editor', element: }, { path: 'examples', element: }, // /examples/ = SEO landing (preview, badges, "Open in Simulator" CTA). diff --git a/frontend/src/components/layout/AppHeader.tsx b/frontend/src/components/layout/AppHeader.tsx index 7bb535ef..fd4c49b8 100644 --- a/frontend/src/components/layout/AppHeader.tsx +++ b/frontend/src/components/layout/AppHeader.tsx @@ -104,7 +104,13 @@ export const AppHeader: React.FC = ({ autoSave }) => { - {/* Main nav links (desktop) */} + {/* Main nav links (web only). The Tauri desktop build hides + this nav and surfaces the equivalent actions via the + native menubar (see pro/desktop/src-tauri/src/menu.rs in + velxio-prod). VITE_DESKTOP is the env flag the Tauri + build sets — main.tsx already uses it to gate the @pro + overlay, same pattern here. */} + {!import.meta.env.VITE_DESKTOP && ( + )} {/* Right: language + share + auth + mobile hamburger */} @@ -224,16 +231,19 @@ export const AppHeader: React.FC = ({ autoSave }) => { OSS image has no auth backend either. */}
- {/* Mobile hamburger */} - + {/* Mobile hamburger — useless in desktop where the nav it + would expand is itself hidden. */} + {!import.meta.env.VITE_DESKTOP && ( + + )}