feat(frontend)!: sveltekit 3 on the v0.7.0 template, adapter-static 4, biome unpinned at 2.5.15

This commit is contained in:
hh committed 2026-10-10 22:49:16 +00:00
1 parent c7e6e3c2d3
commit 2acb893962
18 files changed
+121 -109

No files matched your search

+37 -22
View File
@@ -1,10 +1,8 @@
<script lang="ts">
import { onMount } from "svelte";
import { goto } from "$app/navigation";
import { page } from "$app/state";
import { api } from "$lib/api/client";
import Note from "$lib/components/Note.svelte";
import StripLog from "$lib/components/StripLog.svelte";
import { api } from "#lib/api/client.js";
import Note from "#lib/components/Note.svelte";
import StripLog from "#lib/components/StripLog.svelte";
import {
ago,
blob,
@@ -19,8 +17,10 @@
shortSha,
spaceName,
text,
} from "$lib/lodge";
import { describe } from "$lib/session.svelte";
} from "#lib/lodge.js";
import { describe } from "#lib/session.svelte.js";
import { goto } from "$app/navigation";
import { page } from "$app/state";
interface Opened {
before: string | null;
@@ -97,7 +97,7 @@
);
const href = (patch: Record<string, string | number>) => {
const next = new URLSearchParams(query);
const next = new URLSearchParams(query.toString());
for (const [param, value] of Object.entries(patch)) {
if (value === "" || (param === "at" && value === latest)) {
next.delete(param);
@@ -112,9 +112,8 @@
const select = (seq: number, scrubbing: boolean) => {
confirming = "";
goto(href({ at: seq }), {
keepFocus: true,
noScroll: true,
replaceState: scrubbing,
replace: scrubbing,
reset: false,
});
};
@@ -214,7 +213,7 @@
});
confirming = "";
await load();
await goto(href({ at: "" }), { noScroll: true });
await goto(href({ at: "" }), { reset: false });
} catch (error) {
problem = describe(error);
} finally {
@@ -254,7 +253,9 @@
</title>
</svelte:head>
{#snippet slashed(value: string)}
{#snippet slashed(
value: string
)}
{#each value.split("/") as part, index (index)}
{index ? "/" : ""}<wbr>{part}
{/each}
@@ -316,7 +317,11 @@
<span class="kind">{changeKind(change)}</span>
{#if change.hash}
<a
href={href({ path: change.path, space: change.space, view: "changes" })}
href={href({
path: change.path,
space: change.space,
view: "changes",
})}
>{@render slashed(change.path)}</a
>
{:else}
@@ -336,15 +341,21 @@
{group === SHARED ? "Shared notes" : `Branch ${spaceName(group)}`}
</h3>
<ul class="rows">
{#each Object.entries(repoState?.spaces[group] ?? {}).sort( ([a], [b]) => a.localeCompare(b) ) as [file, info] (file)}
{#each Object.entries(repoState?.spaces[group] ?? {}).sort(([a], [b]) =>
a.localeCompare(b)
) as [file, info] (file)}
<li>
<a
aria-current={group === space && file === path ? "true" : undefined}
aria-current={group === space && file === path
? "true"
: undefined}
href={href({ path: file, space: group, view: "" })}
>
<span class="file">
<span class="dir"
>{@render slashed(file.slice(0, file.lastIndexOf("/") + 1))}</span
>{@render slashed(
file.slice(0, file.lastIndexOf("/") + 1)
)}</span
>{file.slice(file.lastIndexOf("/") + 1)}
</span>
<span aria-hidden="true" class="track">
@@ -414,7 +425,11 @@
{#if entry}
<div class="controls">
{#each [["read", "Read"], ["changes", "Changes"], ["source", "Source"]] as [id, title] (id)}
{#each [
["read", "Read"],
["changes", "Changes"],
["source", "Source"],
] as [id, title] (id)}
{#if markdown || id !== "read"}
<a
aria-current={view === id ? "true" : undefined}
@@ -438,8 +453,8 @@
<button
class="act danger"
onclick={() => {
confirming = "";
}}
confirming = "";
}}
type="button"
>
Keep current
@@ -449,8 +464,8 @@
<button
class="act"
onclick={() => {
confirming = "restore";
}}
confirming = "restore";
}}
type="button"
>
Restore this version