[ui] CalmRefresh: One quiet line and Refresh when a new version of the garden is waiting

This commit is contained in:
2026-11-02 01:18:08 +01:00
parent 8c84cbbb52
commit beea8eaa10
3 changed files with 73 additions and 1 deletions
+44 -1
View File
@@ -13,7 +13,9 @@
let {
letter = '',
sunset,
rose
rose,
updateReady = false,
onrefresh
}: {
/** The author's Markdown from docs/LETTER.md. Empty means there is no way to the page. */
letter?: string;
@@ -21,6 +23,10 @@
sunset?: SunsetWiring;
/** The rose and her care log. Absent, the garden has no rose. */
rose?: RoseWiring;
/** A new version of the garden is installed and waiting (calm-refresh.md). */
updateReady?: boolean;
/** Swap to the waiting version and reload. Only ever called by the player's tap. */
onrefresh?: () => void;
} = $props();
// --- The sunset (sunset-place.md) ---------------------------------------
@@ -143,6 +149,14 @@
</main>
{/if}
{#if updateReady && onrefresh}
<aside class="update" aria-label={en.update.ready}>
<p role="status">{en.update.ready}</p>
<button type="button" onclick={onrefresh}>{en.update.refresh}</button>
</aside>
{/if}
<style>
.shell {
min-height: 100dvh;
@@ -205,6 +219,35 @@
cursor: pointer;
}
.update {
position: sticky;
bottom: 0;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
gap: var(--space-2);
padding: var(--space-2) var(--space-3);
background: var(--paper);
border-top: 1px solid color-mix(in srgb, var(--ink-soft) 30%, transparent);
}
.update p {
margin: 0;
color: var(--ink-soft);
}
.update button {
font: inherit;
padding: var(--space-1) var(--space-3);
border-radius: 999px;
border: 1px solid var(--rose);
background: var(--paper);
color: var(--ink);
cursor: pointer;
}
.update button:focus-visible,
.quiet:focus-visible {
outline: 2px solid var(--rose);
outline-offset: 2px;
+5
View File
@@ -88,6 +88,11 @@ export const en = {
/** When the device refuses to keep anything (a private window). Calm, and true. */
notKept: 'This device could not keep your choice, so the garden will ask again next time.'
},
update: {
/** One quiet line when a new version waits; nothing reloads by itself (calm-refresh.md U2). */
ready: 'A new version of the garden is ready.',
refresh: 'Refresh'
},
letter: {
/** The help section's name (ROADMAP §1). The letter itself is the author's, in docs/LETTER.md. */
title: 'A Letter from the Gardener',