[web] Design review: last row's menu not clipped, Hostname focused after loading, popover closes on Esc and outside click, phone engine chip in the top bar, paused and needs-attention copy with Restore in the panel, change bar offers and countdown, focus after share and kept, fingerprint check when signing by hand, draft kept through sign-in
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
||||
<script lang="ts">
|
||||
// Handoff §2.4: the engine chip (click 1 of the switch). On the main screen's header on a
|
||||
// desktop, in the top bar on a phone (§2.16).
|
||||
import { Icon } from "@ianitor/ui";
|
||||
import { app } from "../lib/app.svelte";
|
||||
|
||||
const o = $derived(app.overview);
|
||||
const engineName = $derived(o?.engine.running === "caddy" ? "Caddy" : "Pingora");
|
||||
const engineLabel = $derived(
|
||||
o?.engine.state === "switching" ? "Engine: switching" : `Engine: ${engineName}${o?.engine.state === "stopped" ? ", not answering" : ""}. Change engine`,
|
||||
);
|
||||
</script>
|
||||
|
||||
{#if o}
|
||||
<button type="button" class="ia-engine" data-engine-chip aria-haspopup="dialog" aria-expanded={app.panel?.kind === "engine"} aria-label={engineLabel}
|
||||
onclick={() => (app.panel = app.panel?.kind === "engine" ? null : { kind: "engine" })}>
|
||||
{#if o.engine.state === "switching"}<Icon name="clock" /> Engine Switching…{:else}
|
||||
<span class="ia-status" data-s={o.engine.state === "stopped" ? "down" : "healthy"}><span class="ia-dot"></span></span>
|
||||
<small class="desktop">Engine</small> {engineName}{#if o.engine.running === "caddy"} <small>(fallback)</small>{/if}{/if}
|
||||
<Icon name="chevron" />
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
@media (max-width: 719.98px) { .desktop { display: none; } }
|
||||
</style>
|
||||
Reference in New Issue
Block a user