Repository navigation
fix(splash): stop the web splash from showing a second time inside the Android app - #3
Merged
Merged
Conversation
added 2 commits
November 12, 2026 11:36
The app's WebView page ships its own BrandSplash and mounts it in the root layout. Inside the AppMintly wrapper that produced a second splash after the native NiramaySplashView retired: the component's images pointed at /brand/splash/*.jpg, which 404 under the /niramay base path, so it rendered as a blank cream screen with two broken-image icons before DisclaimerModal showed. BrandSplashMount consults the AppMintlyNative bridge synchronously during the first client render (the bridge is injected before any URL loads, so the check runs before BrandSplash is created) and returns null in the app. The web splash still ships unchanged for browser and PWA visitors, and its artwork now resolves against the deployed base path instead of the domain root.
scripts/test-brand-splash.ts renders the real mount point against a stub AppMintlyNative bridge (21 checks): suppressed in the app, unchanged in a browser, artwork URLs follow NEXT_PUBLIC_BASE_PATH, and a throwing or partial bridge fails open to the web splash instead of breaking the page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The owner-recorded 2.3.0 startup (167200.mp4, ~5.2–6.1 s) shows a second splash after the native
NiramaySplashViewretires: a blank cream screen with two broken-image icons, which then fades before the real welcome.Traced to this repository, not the APK. The WebView loads
https://pdfly-source.github.io/niramay/symptoms/, andapp/layout.tsx:131mounts this site's ownBrandSplash. Two things made it a defect inside the app:/brand/splash/mark.jpg), which 404s under the/niramaybase path.naturalWidthis 0 for both, so the overlay rendered as an empty canvas with two broken-image placeholders.Reproduced on live production before the change:
404 /brand/splash/mark.jpg,404 /brand/splash/wordmark.jpg, splash mounted with both images atnaturalWidth 0.What changed
components/brand/BrandSplash.tsxisNativeShell()reads the wrapper'sAppMintlyNative.isNativeApp()bridge. The wrapper injects it withaddJavascriptInterface()before any URL loads, so the check runs at module load and again during the first render:BrandSplashMountreturnsnullin the app, soBrandSplashis never mounted, never rendered, never faded. No CSS/opacity hiding.NEXT_PUBLIC_BASE_PATH(/niramay/brand/splash/...), matching howNiramayLogoalready builds URLs. Dev (empty base path) still resolves to/brand/splash/....BrandSplash's own design, timing, animation and reduced-motion CSS are untouched.app/layout.tsx— mountsBrandSplashMountinstead of the raw component (one import, one element).scripts/test-brand-splash.ts+npm run test:splash— new regression test.Verification
Component/unit test: 21/21 (
npm run test:splash), including a realrenderToStaticMarkupof the mount point with a stubbed bridge (suppressed) and without it (unchanged).Headless Chromium against the built preview (
NEXT_PUBLIC_BASE_PATH=/niramay, served under/niramay): 15/15<img>in the DOM/brand/requests/niramay, zero 4xxtsc --noEmitclean,eslintclean on touched files,npm run buildstatic export succeeds,npm run test:branding17/17.Scope
Website only. No APK rebuild, no catalog change, no release artifact touched. Other apps untouched. The native splash, its artwork bytes, package id and signing identity are unchanged.
Post-merge expectation
Existing Niramay 2.3.0 installs pick this up without reinstalling: GitHub Pages serves the page HTML with
cache-control: max-age=600, and the version-basedclearCache(true)purge exists only in the AppMintly native-updates build path, so no APK-side action would change the outcome.