fix(ui): header title always centered, actions to right, real-time update detection

CSS header fixes:
- .header-content: justify-content:flex-end so .header-actions (camera, Gemini)
  naturally stays at the right edge as a flex child
- .header-title: removed overflow:hidden and text-overflow:ellipsis that were
  clipping the version number; title stays absolutely centered
- Cleaned up unused max-width:none and margin:0 from previous broken attempt

Real-time webapp update detection:
- Added module-level _loadedVersion captured at page load (version in HTML header)
- _checkWebappUpdate() now has two checks:
  1. webapp_version from server vs _loadedVersion: if different, the server was
     updated since this page was loaded → show '🔄 Nuova versione disponibile' banner
  2. GitHub latest release vs _loadedVersion (existing behaviour)
  Different banner messages: deploy-changed shows simple reload prompt;
  release-newer shows version + changelog link (same as before)
- TTL reduced from 6h to 5 min so updates are detected quickly
- _checkWebappUpdate() now also fires on visibilitychange so the user sees
  the banner as soon as they return to the tab after a deploy
This commit is contained in:
dadaloop82
2026-05-04 05:32:57 +00:00
parent 6756b16ecb
commit 968e26cc6a
2 changed files with 46 additions and 34 deletions
+1 -5
View File
@@ -108,10 +108,8 @@ body {
position: relative;
display: flex;
align-items: center;
justify-content: center;
justify-content: flex-end;
width: 100%;
max-width: none;
margin: 0;
}
.header-title {
@@ -128,8 +126,6 @@ body {
pointer-events: auto;
/* prevent title overlapping action buttons on small screens */
max-width: calc(100% - 200px);
overflow: hidden;
text-overflow: ellipsis;
}
.header-version {