Kundenansicht neu: vorübergehende iPhone-Messung wieder entfernt
Die Messung auscca29a4hat beide Ursachen gezeigt (Chat kürzer als der Bildschirm, verkleinerte Seite mit Hineinzoomen beim Tippen). Nach1a09bebzeigt sie am iPhone: Maßstab bleibt beim Tippen 0,85, Fenster 1002 px, Leiste unten. diag-hoehe.js, routes/diagHoehe.js, die Zeile in server/index.js und test/diagHoehe.test.js sind raus; server/index.js ist wieder wie vor der Messung. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1a09bebe41
commit
ff8adadf00
7 files changed
+4
-175
No files matched your search
@@ -1,76 +0,0 @@
|
||||
/* VORÜBERGEHENDE MESSUNG (2026-10-29), wird nach der Klärung wieder entfernt: Am iPhone (App vom Home-Bildschirm) steht die Leiste zu hoch.
|
||||
Schickt Bildschirmwerte (Fenster, visualViewport, Bildschirm, Safe-Area, vh-Einheiten, Lage der Leiste) an
|
||||
/api/diag/hoehe; der Server schreibt sie ins Log (server/routes/diagHoehe.js). Keine Inhalte, keine Eingaben. Höchstens MAX Meldungen je Seite. */
|
||||
|
||||
const MAX = 80
|
||||
const ZIEL = '/api/diag/hoehe'
|
||||
const rund = (x) => (Number.isFinite(x) ? Math.round(x * 10) / 10 : null)
|
||||
|
||||
export function starteDiagHoehe({ win = window, doc = document, zoom = null }) {
|
||||
const t0 = Date.now()
|
||||
let n = 0
|
||||
const probe = (stil) => {
|
||||
const el = doc.createElement('div')
|
||||
el.setAttribute('aria-hidden', 'true')
|
||||
el.style.cssText = `position:fixed;left:0;top:0;width:0;visibility:hidden;pointer-events:none;${stil}`
|
||||
doc.body.append(el)
|
||||
return el
|
||||
}
|
||||
const sa = probe('height:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)')
|
||||
const vh = probe('height:100vh'); const dvh = probe('height:100dvh'); const svh = probe('height:100svh'); const lvh = probe('height:100lvh')
|
||||
const unten = probe('top:auto;bottom:0;height:1px') // wo „bottom: 0“ eines festen Elements wirklich landet
|
||||
|
||||
function messe(art, extra) {
|
||||
const vv = win.visualViewport
|
||||
const cs = win.getComputedStyle(sa)
|
||||
const leiste = doc.getElementById('kn-leiste')?.getBoundingClientRect()
|
||||
const huelle = doc.querySelector('.kn-huelle')?.getBoundingClientRect()
|
||||
const aktiv = doc.activeElement
|
||||
return {
|
||||
art, ms: Date.now() - t0, hash: win.location.hash,
|
||||
iw: win.innerWidth, ih: win.innerHeight, ow: win.outerWidth, oh: win.outerHeight,
|
||||
cw: doc.documentElement.clientWidth, ch: doc.documentElement.clientHeight, dh: doc.documentElement.scrollHeight,
|
||||
sw: win.screen?.width, sh: win.screen?.height, sah: win.screen?.availHeight, dpr: win.devicePixelRatio,
|
||||
vv: vv ? [rund(vv.width), rund(vv.height), rund(vv.offsetTop), rund(vv.pageTop), Math.round(vv.scale * 1000) / 1000] : null,
|
||||
zf: zoom?.faktor?.() ?? null, swd: doc.documentElement.scrollWidth,
|
||||
fs: aktiv && aktiv !== doc.body ? win.getComputedStyle(aktiv).fontSize : null,
|
||||
sy: rund(win.scrollY),
|
||||
sa: [cs.paddingTop, cs.paddingRight, cs.paddingBottom, cs.paddingLeft].map((p) => rund(parseFloat(p))),
|
||||
vh: [vh.offsetHeight, dvh.offsetHeight, svh.offsetHeight, lvh.offsetHeight],
|
||||
unten: rund(unten.getBoundingClientRect().bottom),
|
||||
leiste: leiste ? [rund(leiste.top), rund(leiste.bottom), rund(leiste.height)] : null,
|
||||
huelle: huelle ? [rund(huelle.top), rund(huelle.height)] : null,
|
||||
app: Boolean(win.matchMedia?.('(display-mode: standalone)').matches), ns: win.navigator?.standalone ?? null,
|
||||
ori: win.screen?.orientation?.type ?? null,
|
||||
fokus: aktiv && aktiv !== doc.body ? aktiv.tagName : null,
|
||||
tast: doc.body.classList.contains('kn-tastatur'),
|
||||
...(n === 0 ? { ua: String(win.navigator?.userAgent ?? '').slice(0, 200) } : {}),
|
||||
...(extra ?? {}),
|
||||
}
|
||||
}
|
||||
|
||||
function sende(art, extra) {
|
||||
if (n >= MAX) return
|
||||
let daten
|
||||
try { daten = messe(art, extra) } catch (fehler) { daten = { art, fehler: String(fehler?.message ?? fehler).slice(0, 200) } }
|
||||
n += 1
|
||||
try {
|
||||
win.fetch(ZIEL, { method: 'POST', credentials: 'same-origin', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(daten), keepalive: true }).catch(() => {})
|
||||
} catch { /* Messung darf nie stören */ }
|
||||
}
|
||||
|
||||
const spaeter = (fn, ms) => win.setTimeout(fn, ms)
|
||||
const entprellt = (art) => { let id = null; return () => { if (id) win.clearTimeout(id); id = spaeter(() => { id = null; sende(art) }, 250) } }
|
||||
sende('start')
|
||||
spaeter(() => sende('start+1s'), 1000)
|
||||
spaeter(() => sende('start+4s'), 4000)
|
||||
win.addEventListener('resize', entprellt('resize'))
|
||||
win.visualViewport?.addEventListener('resize', entprellt('vv-resize'))
|
||||
win.visualViewport?.addEventListener('scroll', entprellt('vv-scroll'))
|
||||
doc.addEventListener('focusin', (ev) => { if (ev.target?.matches?.('textarea, input')) sende('fokus') })
|
||||
doc.addEventListener('focusout', (ev) => { if (ev.target?.matches?.('textarea, input')) { spaeter(() => sende('unfokus+300ms'), 300); spaeter(() => sende('unfokus+1s'), 1000) } })
|
||||
doc.addEventListener('visibilitychange', () => { if (doc.visibilityState === 'visible') { sende('sichtbar'); spaeter(() => sende('sichtbar+1s'), 1000) } })
|
||||
win.addEventListener('hashchange', () => spaeter(() => sende('route'), 600))
|
||||
win.addEventListener('pageshow', (ev) => { if (ev.persisted) sende('pageshow') })
|
||||
return { sende }
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import * as routerStandard from './router.js'
|
||||
import { BEREICHE, FUNKTIONS_ETAGEN, hashFuerAnsicht, hashFuerRoute, elternVon, titelFuer, zeigtWiderrufsstreifen } from './routen.js'
|
||||
import { HANDY_ABFRAGE, baueNavigation, beobachteTastatur, istTextfeld, leisteSichtbar } from './leiste.js'
|
||||
import { beobachteZoom } from './zoom-ausgleich.js'
|
||||
import { starteDiagHoehe } from './diag-hoehe.js'
|
||||
import { baueEtage } from './etage.js'
|
||||
import { erzeugeZaehler } from './zaehler.js'
|
||||
import { baueStreifen, ladeFristen, ladeFristenNeu } from './fristen-streifen.js'
|
||||
@@ -280,9 +279,7 @@ export async function starteHuelle({ win = window, doc = document, api = apiStan
|
||||
else handyMq.addListener?.(beiMedien)
|
||||
beobachteTastatur({ win, doc, onChange: (z) => doc.body.classList.toggle('kn-tastatur', !leisteSichtbar(z)) })
|
||||
// iOS: bei verkleinerter Seite die Feldschrift so vergrößern, dass iOS beim Tippen nicht hineinzoomt (zoom-ausgleich.js)
|
||||
const zoom = istIos() ? beobachteZoom({ win, doc, istTextfeld }) : null
|
||||
// VORÜBERGEHENDE MESSUNG (2026-10-29, diag-hoehe.js): Bildschirmwerte am iPhone ins Server-Log, wird nach der Klärung entfernt
|
||||
if (istIos() && istHandy() && !viewAs) starteDiagHoehe({ win, doc, zoom })
|
||||
if (istIos()) beobachteZoom({ win, doc, istTextfeld })
|
||||
|
||||
// 7. Fristen und Zähler laden parallel und brechen den Start nie ab
|
||||
ladeFristen(api).then((daten) => { fristen = daten; streifen.setze(daten); aktualisiereKonto() })
|
||||
|
||||
Reference in new issue
Block a user