~ knotless Search/
↑↓ move↵ open⇧↵ all results

grain.social/grain

photography-focused photo sharing platform

grain.social
1 collaborator
0
2

next: no console warnings as screens are pushed and gone back from

Merged chadtmiller.com asked to merge into feature/hud from grain.social/grain:next/console

Only what this pull adds. It is built on The next grain.social and grain-ios, drawn by HUD.

vendor/hud/web/renderer/src/Picture.svelte+11−2
@@ -41,6 +41,15 @@
void first;
if (shown === null) onready?.();
});
// An <img> taken out of the page keeps loading, and says so after: by
// then it is no one's (the screen it was on let go), so what it says is
// heard only while the picture is drawn, never reading its props or
// state once they are gone (Svelte's derived_inert).
let drawn = true;
$effect(() => () => {
drawn = false;
});
</script>
{#if shown === null && person}
@@ -60,8 +69,8 @@
srcset={times === 0 ? srcset : undefined}
src={shown}
{alt}
onload={onready}
onerror={() => (failed = { of: first, times: times + 1 })}
onload={() => drawn && onready?.()}
onerror={() => drawn && (failed = { of: first, times: times + 1 })}
/>
{/if}
vendor/hud/web/shell/src/Head.svelte+4−1
@@ -14,8 +14,11 @@
<svelte:head>
<title>{head.title}</title>
<!-- A new link for each hero, its attributes set before it is in the head: one changed in place would fetch its href (another size) before its srcset said which. -->
{#if head.preload}
<link rel="preload" as="image" {...head.preload} />
{#key head.preload.href}
<link rel="preload" as="image" {...head.preload} />
{/key}
{/if}
<meta name="description" content={head.description} />
{#if head.noindex}
vendor/hud/web/shell/src/Pager.svelte+1−1
@@ -296,7 +296,7 @@
{#if Math.abs(i - at) <= 1}
{@const where = place(i)}
{@const page = pages[i]}
<section class="page" class:side={i !== at} aria-hidden={i !== at} inert={i !== at} style:--slot={where.slot} style:--off={where.off}>
<section class="page" class:side={i !== at} inert={i !== at} style:--slot={where.slot} style:--off={where.off}>
{#if !page?.view}
<Skeleton node={recallSkeleton(calls[i])} delayed />
{:else if page.signIn}
vendor/hud/web/shell/src/Stack.svelte+42−4
@@ -455,6 +455,44 @@
else if (view) head = headOfView(view, areas, top?.measure);
});
// Focus follows the screen on top, as a native stack's does: a screen
// opened takes it at its title (its level, while it has none), and one
// gone back to has it again where it was left, so it never stays in a
// level covered (`inert`) or let go. Only where it was in this stack:
// elsewhere (the frame's tabs, the search) it stays where it is.
let stackElement: HTMLElement | undefined = $state();
/** Where focus was in each level now covered, by its id. */
const focusedIn = new Map<number, Element>();
let topId: number | undefined;
/** The top level's id as it changes, and whether focus is to follow it there. */
let follow: number | null = null;
$effect.pre(() => {
const id = top?.id;
untrack(() => {
const was = topId;
topId = id;
if (was === undefined || id === undefined || was === id) return;
for (const kept of focusedIn.keys()) if (!levels.some((l) => l.id === kept)) focusedIn.delete(kept);
const focused = document.activeElement;
if (!focused || !stackElement?.contains(focused)) return;
if (levels.some((l) => l.id === was)) focusedIn.set(was, focused);
follow = id;
});
});
$effect(() => {
void top?.id;
untrack(() => {
const id = follow;
follow = null;
if (id === null || id !== top?.id) return;
const level = stackElement?.querySelector<HTMLElement>(':scope > section.level:not(.under)');
const back = focusedIn.get(id);
focusedIn.delete(id);
const to = back instanceof HTMLElement && back.isConnected ? back : (level?.querySelector<HTMLElement>(':scope > .screen-bar > h1') ?? level);
to?.focus({ preventScroll: true });
});
});
// The root afresh whenever its call changes (signing in or out changes
// it), but at first not where the server's page (`seed`) or `sync` has
// set the stack already.
@@ -641,7 +679,7 @@
{/if}
{/snippet}
<div class="stack" hidden={!active}>
<div class="stack" hidden={!active} bind:this={stackElement}>
{#if !root}
<section class="level">
<header class="screen-bar"><h1 class:wordmark>{wordmark ?? title}</h1></header>
@@ -653,7 +691,7 @@
{/if}
{#each levels as level, i (level.id)}
{@const shown = level === top}
<section class="level" class:under={!shown} aria-hidden={!shown} inert={!shown} aria-busy={level.refreshing}>
<section class="level" class:under={!shown} inert={!shown} aria-busy={level.refreshing} tabindex="-1">
<!-- Its screen drawn as it last was while its call is made again: a line along its top, taking no room. -->
{#if level.refreshing}<span class="refreshing" aria-hidden="true"></span>{/if}
<!-- While its screen loads, `reserved` where the screen's last tree had a Bar with buttons: the desktop frame keeps it, so its buttons fill in with no jump. -->
@@ -663,9 +701,9 @@
<button type="button" class="back" onclick={onback} aria-label="Back">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="m15 18-6-6 6-6" /></svg>
</button>
{#if named}<h1 class="screen">{named}</h1>{/if}
{#if named}<h1 class="screen" tabindex="-1">{named}</h1>{/if}
{:else}
<h1 class:wordmark>{wordmark ?? title}</h1>
<h1 class:wordmark tabindex="-1">{wordmark ?? title}</h1>
{/if}
<span class="tools">{@render tools(level)}</span>
</header>
vendor/hud/COMMIT+1−1
@@ -1 +1 @@
2318f428b3e8fedf70b6805b460a0be779d2c992
94b9fb92f7427c5e3286019ac0dfc30f7500e94a