johnandersen777.bsky.social/knotless
git that lives in your Atmosphere account
Forked from chadtmiller.com/knotless
0
0
<script lang="ts">
import type { RepoViewDetailed } from '#lib/lexicons/dev/knotless/defs.ts';
import type * as getTree from '#lib/lexicons/dev/knotless/getTree.ts';
import type { Answer, LastCommits } from '#lib/data.ts';
import FileList from '#lib/organisms/FileList.svelte';
import Readme from '#lib/organisms/Readme.svelte';
import { repoHref } from '#lib/format.ts';
import Icon from '#lib/atoms/Icon.svelte';
import CloneMenu from '#lib/molecules/CloneMenu.svelte';
import FileFinder from '#lib/organisms/FileFinder.svelte';
import Toolbar from '#lib/organisms/Toolbar.svelte';
import RepoPage from './RepoPage.svelte';
/** A directory at a revision, in one panel with the branch it is on, the ways to take it, a file to go to, and what it is written in; the commit that last changed each entry, the branches to see it on (and, given, the tags), and its README, of the repository `authority` owns. */
let {
repo: r,
authority,
tree: l,
branches,
tags,
last
}: {
repo: RepoViewDetailed;
authority: string;
tree: Answer<typeof getTree.main>;
branches: string[];
tags?: string[];
last: LastCommits | Promise<LastCommits>;
} = $props();
</script>
<RepoPage repo={r} tab="code" title={l.path ? `${l.path} · ${r.name}` : r.name}>
<FileList
{authority}
name={r.name}
rev={l.ref}
path={l.path}
last={l.lastCommit}
checks={l.checks}
entries={l.entries}
changes={last}
languages={l.languages}
>
{#snippet bar()}
<Toolbar
{authority}
name={r.name}
rev={l.ref}
view="tree"
path={l.path}
{branches}
head={r.defaultBranch}
{tags}
>
{#snippet end()}
<FileFinder {authority} name={r.name} rev={l.ref} />
{#if l.ref !== r.defaultBranch && branches.includes(l.ref)}<a
class="btn"
href={repoHref(
authority,
r.name,
`/pulls/new?branch=${encodeURIComponent(l.ref)}&expand=1`
)}><Icon name="pull" />Compare & pull</a
>{/if}
<CloneMenu {authority} name={r.name} rev={l.ref} />
{/snippet}
</Toolbar>
{/snippet}
</FileList>
{#if l.readme}<Readme readme={l.readme} />{/if}
</RepoPage>