Kotlin-Compile-Fehler im Plugin + Safe-Area der Titelleiste [apk]
All checks were successful
Build APK / build-apk (push) Successful in 4m1s

NetDiagScannerPlugin.kt (latente Bugs, erst durch aktivierten Kotlin-Compiler sichtbar):
- traceroute: hop.first/.second -> hop.ip/.ms (Hop ist data class, kein Pair)
- startStressTest: getInteger() liefert Int?, mit '?: 0' abgesichert

Titelleiste klebte an der Statusleiste / war oben abgeschnitten:
- safe-top/safe-bottom enthalten jetzt den Basis-Innenabstand via calc() --
  sonst ueberschreibt die unlayered CSS-Klasse das padding von Tailwind py-*
- Header/Toast/Update-Banner/Login auf pb-*/px-* statt py-*/p-* umgestellt
Siehe KB #551.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Eduard Wisch 2026-05-19 16:17:22 +02:00
parent 250e0f9eba
commit 280a973476
6 changed files with 15 additions and 11 deletions

View file

@ -319,9 +319,9 @@ class NetDiagScannerPlugin : Plugin() {
val hop = pingWithTtl(host, ttl)
hops.put(JSObject()
.put("ttl", ttl)
.put("ip", hop.first)
.put("ms", hop.second))
if (hop.first == host || hop.reachedTarget) break
.put("ip", hop.ip)
.put("ms", hop.ms))
if (hop.ip == host || hop.reachedTarget) break
}
resolve(call, JSObject().put("hops", hops))
} catch (e: Exception) {
@ -397,7 +397,7 @@ class NetDiagScannerPlugin : Plugin() {
while (System.currentTimeMillis() < end && run.active) {
val q = measurePing(host, 5)
run.samples++
run.lossSum += q.getInteger("lossPct", 0)
run.lossSum += q.getInteger("lossPct", 0) ?: 0
run.avgSum += q.getDouble("avgMs")
run.maxMs = Math.max(run.maxMs, q.getDouble("maxMs"))
}

View file

@ -15,12 +15,16 @@ body {
-webkit-tap-highlight-color: transparent;
}
/* Sichere Bereiche (Notch / Statusleiste) */
/* Sichere Bereiche (Notch / Statusleiste).
Enthalten bewusst den Basis-Innenabstand (0.75rem) sonst überschreibt
diese Klasse das padding-top/-bottom von Tailwind py-* (unlayered CSS
schlägt @layer utilities) und der Inhalt klebt an Statusleiste/Notch.
Elemente daher mit pb-*/px-* statt py-* kombinieren. Siehe KB #551. */
.safe-top {
padding-top: env(safe-area-inset-top);
padding-top: calc(0.75rem + env(safe-area-inset-top));
}
.safe-bottom {
padding-bottom: env(safe-area-inset-bottom);
padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
}
/* Ampel-Farben für Messergebnisse */

View file

@ -19,7 +19,7 @@
);
</script>
<header class="flex items-center gap-2 border-b border-zinc-800 bg-zinc-900 px-3 py-3 safe-top">
<header class="flex items-center gap-2 border-b border-zinc-800 bg-zinc-900 px-3 pb-3 safe-top">
{#if back}
<button class="rounded p-1 active:bg-zinc-800" onclick={() => history.back()} aria-label="Zurück">
<ChevronLeft size={24} />

View file

@ -8,7 +8,7 @@
};
</script>
<div class="pointer-events-none fixed inset-x-0 top-0 z-50 flex flex-col items-center gap-2 p-3 safe-top">
<div class="pointer-events-none fixed inset-x-0 top-0 z-50 flex flex-col items-center gap-2 px-3 pb-3 safe-top">
{#each toast.items as item (item.id)}
<div class="rounded-lg px-4 py-2 text-sm text-white shadow-lg {colors[item.type]}">
{item.text}

View file

@ -66,7 +66,7 @@
{:else}
{#if updateInfo}
<button
class="bg-sky-700 px-4 py-2 text-sm text-white safe-top"
class="bg-sky-700 px-4 pb-2 text-sm text-white safe-top"
onclick={() => updateInfo && openUpdate(updateInfo)}
>
Neue Version {updateInfo.version} verfügbar — tippen zum Aktualisieren

View file

@ -35,7 +35,7 @@
}
</script>
<div class="flex min-h-screen flex-col items-center justify-center gap-6 p-6 safe-top safe-bottom">
<div class="flex min-h-screen flex-col items-center justify-center gap-6 px-6 safe-top safe-bottom">
<div class="text-center">
<h1 class="text-2xl font-bold text-sky-400">NetDiag</h1>
<p class="text-sm text-zinc-400">Netzwerk-Diagnose</p>