Hide sidebar when app--minimalui is present on auth views

This commit is contained in:
svemagie
2026-03-08 05:20:39 +01:00
parent de2235f990
commit 51288e0006
2 changed files with 12 additions and 1 deletions

View File

@@ -77,6 +77,6 @@
- The frontend sharp runtime patch makes icon generation non-fatal on FreeBSD when `sharp` cannot load, preventing startup crashes in asset controller imports.
- The files upload route patch fixes browser multi-upload by posting to `/files/upload` (session-authenticated) instead of direct `/media` calls without bearer token.
- The files upload locale patch adds missing `files.upload.dropText`/`files.upload.browse`/`files.upload.submitMultiple` labels in endpoint locale files so UI text does not render raw translation keys.
- The frontend serviceworker patch ensures `@indiekit/frontend/lib/serviceworker.js` exists at runtime, forces network-only handling for `/auth` and `/session` pages, and patches frontend layout templates to unregister stale service workers and clear caches on load.
- The frontend serviceworker patch ensures `@indiekit/frontend/lib/serviceworker.js` exists at runtime, forces network-only handling for `/auth` and `/session` pages, patches frontend layout templates to unregister stale service workers and clear caches on load, and suppresses sidebar rendering whenever `app--minimalui` is present.
- The conversations guard patch prevents `Cannot read properties of undefined (reading 'find')` when the `conversation_items` collection is temporarily unavailable.
- The indieauth dev-mode guard patch prevents accidental production auth bypass by requiring explicit `INDIEKIT_ALLOW_DEV_AUTH=1` to enable dev auto-login.

View File

@@ -80,6 +80,10 @@ const activateNew = ` await clearOldCaches();
const registrationScriptRegex =
/<script type="module">\n\s*if \(navigator\.serviceWorker\) \{\n[\s\S]*?<\/script>/m;
const sidebarConditionOld = "{% if not minimalui %}";
const sidebarConditionNew =
"{% if not minimalui and ('app--minimalui' not in appClasses) %}";
const registrationDisableMarker = "disable stale service-worker caches";
const registrationDisableScript = `<script type="module">
if ("serviceWorker" in navigator) {
@@ -137,6 +141,13 @@ function patchServiceworker(content) {
function patchLayout(content) {
let updated = content;
if (
updated.includes(sidebarConditionOld) &&
!updated.includes(sidebarConditionNew)
) {
updated = updated.replace(sidebarConditionOld, sidebarConditionNew);
}
if (
!updated.includes(registrationDisableMarker) &&
registrationScriptRegex.test(updated)