Play the platform music on the shared Learn page too
Reversing yesterday's call at Karti's direction. The provider moves from Shell up above the router in App, so a share-code visitor gets the same character as a member rather than a silent page. The reason that is safe is the same reason "autoplay" was never really autoplay: the browser refuses audio until the page has had a real gesture, so nothing plays the instant a link opens — it starts once someone is actually using the page. The anonymous page renders OUTSIDE Shell and therefore has no app header, so the mute control is added to its own chrome. Music with no way to stop it is the worst version of this feature, and a visitor who cannot find the switch does not conclude the site has taste. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+14
-3
@@ -10,6 +10,7 @@ import { ThemeProvider } from '@/lib/theme';
|
||||
import { IdentityProvider, useIdentityQuery } from '@/lib/identity';
|
||||
import { LayoutProvider } from '@/lib/layout';
|
||||
import { PiggyContextProvider } from '@/lib/piggy-context';
|
||||
import { PlatformAudioProvider } from '@/lib/audio';
|
||||
import { Shell } from '@/components/Shell';
|
||||
import { SignIn } from '@/pages/SignIn';
|
||||
import { CreateProfile } from '@/pages/CreateProfile';
|
||||
@@ -85,9 +86,19 @@ export function App() {
|
||||
void patch('/api/me/preferences', prefs).catch(() => {});
|
||||
}}
|
||||
>
|
||||
<BrowserRouter>
|
||||
<AuthGate config={config} />
|
||||
</BrowserRouter>
|
||||
{/*
|
||||
Above the router, so the music survives navigation AND covers the
|
||||
anonymous Learn page — a share-code visitor gets the same platform
|
||||
character as a member. It never plays unbidden: the browser refuses
|
||||
audio until the page has had a real gesture, so it begins when
|
||||
someone actually starts using the page, and the header control mutes
|
||||
it for good on that device.
|
||||
*/}
|
||||
<PlatformAudioProvider>
|
||||
<BrowserRouter>
|
||||
<AuthGate config={config} />
|
||||
</BrowserRouter>
|
||||
</PlatformAudioProvider>
|
||||
{/* Inside ThemeProvider: the host reads the resolved light/dark value. */}
|
||||
<Toaster />
|
||||
</ThemeProvider>
|
||||
|
||||
Reference in New Issue
Block a user