fix(spa): serve favicon/manifest at root + stop tab sticking on Loading... #402

Merged
vas2000-work merged 1 commit from fix/MAPPS-favicon-manifest-and-loading-title into main 2026-07-01 22:14:21 +02:00
Owner

Two staging-visible frontend bugs on msp.a8n.systems.

1. Favicon + PWA manifest not served (missing icon, manifest parse error)

favicon.svg/.ico, apple-touch-icon.png, manifest.webmanifest, and icon-192/512/maskable.png live under assets/, but dx build does not emit them into web/public at the root paths index.html and the manifest reference (/favicon.svg, /manifest.webmanifest, /icon-192.png, ...). Confirmed live: GET /favicon.svg and /manifest.webmanifest both return content-type: text/html - Caddy's try_files ... /index.html fallback. So the browser gets no favicon and logs manifest.webmanifest: Syntax error.

Fix: copy the seven files into the Caddy web root (/usr/share/caddy) in the Dockerfile runtime stage, so file_server serves them before the SPA fallback. (The manifest and index.html reference them at root, and the manifest's own icon srcs are /icon-192.png etc., so root is the right place.)

2. Tab stuck on "Loading... | Mokosh Platform"

AppLayout sets document.title = "{page} | Mokosh Platform". Detail pages pass title = "Loading..." while their record fetches, then swap in the record name - but while the dashboard data was CSP-blocked those fetches never resolved, leaving the tab on the placeholder.

Fix: treat the literal "Loading..." like an empty title in the document.title effect, so the tab reads a clean Mokosh Platform until the real title arrives (no functional change to the visible page header/skeleton).

Notes

  • Both are image-level; they ship in the next mokosh-apps release (v0.5.1). No dependency changes, no --locked concern (mokosh-apps builds without it).
Two staging-visible frontend bugs on msp.a8n.systems. ## 1. Favicon + PWA manifest not served (missing icon, manifest parse error) `favicon.svg`/`.ico`, `apple-touch-icon.png`, `manifest.webmanifest`, and `icon-192/512/maskable.png` live under `assets/`, but `dx build` does not emit them into `web/public` at the **root** paths index.html and the manifest reference (`/favicon.svg`, `/manifest.webmanifest`, `/icon-192.png`, ...). Confirmed live: `GET /favicon.svg` and `/manifest.webmanifest` both return `content-type: text/html` - Caddy's `try_files ... /index.html` fallback. So the browser gets no favicon and logs `manifest.webmanifest: Syntax error`. **Fix:** copy the seven files into the Caddy web root (`/usr/share/caddy`) in the Dockerfile runtime stage, so `file_server` serves them before the SPA fallback. (The manifest and index.html reference them at root, and the manifest's own icon `src`s are `/icon-192.png` etc., so root is the right place.) ## 2. Tab stuck on "Loading... | Mokosh Platform" `AppLayout` sets `document.title = "{page} | Mokosh Platform"`. Detail pages pass `title = "Loading..."` while their record fetches, then swap in the record name - but while the dashboard data was CSP-blocked those fetches never resolved, leaving the tab on the placeholder. **Fix:** treat the literal `"Loading..."` like an empty title in the `document.title` effect, so the tab reads a clean `Mokosh Platform` until the real title arrives (no functional change to the visible page header/skeleton). ## Notes - Both are image-level; they ship in the next mokosh-apps release (v0.5.1). No dependency changes, no `--locked` concern (mokosh-apps builds without it).
fix(spa): serve favicon/manifest at root + stop tab sticking on "Loading..."
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 2m18s
Create release / Create release from merged PR (pull_request) Has been skipped
a1414c6979
Two staging-visible frontend bugs.

1. Favicon + PWA manifest 404 to the SPA fallback. favicon.svg/.ico, apple-touch-icon.png, manifest.webmanifest and icon-192/512/maskable live under assets/, but `dx build` does not emit them into web/public at the root paths index.html and the manifest reference (/favicon.svg, /manifest.webmanifest, /icon-192.png, ...). Caddy's `try_files ... /index.html` then returned index.html (text/html) for each, so the browser showed no favicon and logged a manifest syntax error. Copy the seven files into the Caddy web root (/usr/share/caddy) in the runtime stage so file_server serves them before the SPA fallback.

2. Tab title stuck at "Loading... | Mokosh Platform". Detail pages hand AppLayout `title = "Loading..."` while their record fetches; when the data was CSP-blocked the fetch never resolved and the tab stayed on the placeholder. Treat the literal "Loading..." (like an empty title) as "no title yet" in AppLayout's document.title effect, so the tab reads a clean "Mokosh Platform" until the real title (record name) arrives.

#MAPPS-287
vas2000-work deleted branch fix/MAPPS-favicon-manifest-and-loading-title 2026-07-01 22:14:21 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!402
No description provided.