diff --git a/__snapshots__/repo-details--long-and-no-spaces.png b/__snapshots__/repo-details--long-and-no-spaces.png index b580b2f..ac79911 100644 Binary files a/__snapshots__/repo-details--long-and-no-spaces.png and b/__snapshots__/repo-details--long-and-no-spaces.png differ diff --git a/__snapshots__/repo-details--long-details.png b/__snapshots__/repo-details--long-details.png index d929d0b..55ac4f9 100644 Binary files a/__snapshots__/repo-details--long-details.png and b/__snapshots__/repo-details--long-details.png differ diff --git a/__snapshots__/repo-details--no-clone.png b/__snapshots__/repo-details--no-clone.png new file mode 100644 index 0000000..bb6eefe Binary files /dev/null and b/__snapshots__/repo-details--no-clone.png differ diff --git a/__snapshots__/repo-details--no-description.png b/__snapshots__/repo-details--no-description.png index 0611246..d8397d9 100644 Binary files a/__snapshots__/repo-details--no-description.png and b/__snapshots__/repo-details--no-description.png differ diff --git a/__snapshots__/repo-details--no-maintainers-or-relays.png b/__snapshots__/repo-details--no-maintainers-or-relays.png index 9e3b091..bb41c16 100644 Binary files a/__snapshots__/repo-details--no-maintainers-or-relays.png and b/__snapshots__/repo-details--no-maintainers-or-relays.png differ diff --git a/__snapshots__/repo-details--no-maintainers.png b/__snapshots__/repo-details--no-maintainers.png index e7c5574..494eb2a 100644 Binary files a/__snapshots__/repo-details--no-maintainers.png and b/__snapshots__/repo-details--no-maintainers.png differ diff --git a/__snapshots__/repo-details--no-name-or-description.png b/__snapshots__/repo-details--no-name-or-description.png index 771281f..cf26994 100644 Binary files a/__snapshots__/repo-details--no-name-or-description.png and b/__snapshots__/repo-details--no-name-or-description.png differ diff --git a/__snapshots__/repo-details--no-relays.png b/__snapshots__/repo-details--no-relays.png index a4b4958..9c82cfd 100644 Binary files a/__snapshots__/repo-details--no-relays.png and b/__snapshots__/repo-details--no-relays.png differ diff --git a/__snapshots__/repo-details--no-tags.png b/__snapshots__/repo-details--no-tags.png index 6a82f28..6676bf3 100644 Binary files a/__snapshots__/repo-details--no-tags.png and b/__snapshots__/repo-details--no-tags.png differ diff --git a/__snapshots__/repo-details--one-maintainer-s-profile-has-no-display-name-or-name.png b/__snapshots__/repo-details--one-maintainer-s-profile-has-no-display-name-or-name.png index 7f31bd6..573a940 100644 Binary files a/__snapshots__/repo-details--one-maintainer-s-profile-has-no-display-name-or-name.png and b/__snapshots__/repo-details--one-maintainer-s-profile-has-no-display-name-or-name.png differ diff --git a/__snapshots__/repo-details--one-maintainer-s-profile-not-loaded.png b/__snapshots__/repo-details--one-maintainer-s-profile-not-loaded.png index fe07d0f..f3b6bac 100644 Binary files a/__snapshots__/repo-details--one-maintainer-s-profile-not-loaded.png and b/__snapshots__/repo-details--one-maintainer-s-profile-not-loaded.png differ diff --git a/__snapshots__/repo-details--one-maintainer-s-profile-only-has-display-name-but-no-name.png b/__snapshots__/repo-details--one-maintainer-s-profile-only-has-display-name-but-no-name.png index e474630..891d8b7 100644 Binary files a/__snapshots__/repo-details--one-maintainer-s-profile-only-has-display-name-but-no-name.png and b/__snapshots__/repo-details--one-maintainer-s-profile-only-has-display-name-but-no-name.png differ diff --git a/__snapshots__/repo-details--short-details.png b/__snapshots__/repo-details--short-details.png index 1c99dd1..6e73754 100644 Binary files a/__snapshots__/repo-details--short-details.png and b/__snapshots__/repo-details--short-details.png differ diff --git a/__snapshots__/repo-details.test.js.snap b/__snapshots__/repo-details.test.js.snap index 24e0b3e..73bdcd0 100644 --- a/__snapshots__/repo-details.test.js.snap +++ b/__snapshots__/repo-details.test.js.snap @@ -25,7 +25,7 @@ exports[`Repo/Details Long Details smoke-test 1`] = `

- git server + clone

- git server + clone

`; -exports[`Repo/Details No Description smoke-test 1`] = ` +exports[`Repo/Details No Clone smoke-test 1`] = `
-
-
+

+ description +

+

+ short description +

svelte @@ -220,15 +224,8 @@ exports[`Repo/Details No Description smoke-test 1`] = `
-

- git server -

-
- github.com/example/example - +
+

@@ -297,14 +294,10 @@ exports[`Repo/Details No Description smoke-test 1`] = `

`; -exports[`Repo/Details No Git Server smoke-test 1`] = ` +exports[`Repo/Details No Description smoke-test 1`] = `
-

- description -

-

- short description -

+
+
svelte @@ -320,8 +313,15 @@ exports[`Repo/Details No Git Server smoke-test 1`] = `
-
-
+

+ clone +

+ + github.com/example/example +

@@ -414,7 +414,7 @@ exports[`Repo/Details No Maintainers or Relays smoke-test 1`] = `

- git server + clone

- git server + clone

- git server + clone

- git server + clone

- git server + clone

- git server + clone

- git server + clone

- git server + clone

- git server + clone

- export interface Args { - name: string - description: string - repo_id: string - loading?: boolean - created_at: number - } - export const defaults: Args = { - name: '', - repo_id: '', - description: '', - loading: false, - created_at: 0, - } - - diff --git a/src/lib/components/repo/RepoDetails.stories.svelte b/src/lib/components/repo/RepoDetails.stories.svelte index b3737c4..35a5c2b 100644 --- a/src/lib/components/repo/RepoDetails.stories.svelte +++ b/src/lib/components/repo/RepoDetails.stories.svelte @@ -27,7 +27,7 @@ - + diff --git a/src/lib/components/repo/RepoDetails.svelte b/src/lib/components/repo/RepoDetails.svelte index bc233db..908fc02 100644 --- a/src/lib/components/repo/RepoDetails.svelte +++ b/src/lib/components/repo/RepoDetails.svelte @@ -6,7 +6,7 @@ repo_id, name, description, - git_server, + clone, tags, maintainers, relays, @@ -41,16 +41,16 @@ {#if loading}
- {:else if git_server.length == 0} + {:else if clone.length == 0}
diff --git a/src/lib/components/repo/RepoHeader.svelte b/src/lib/components/repo/RepoHeader.svelte index 7e41e6b..33780ef 100644 --- a/src/lib/components/repo/RepoHeader.svelte +++ b/src/lib/components/repo/RepoHeader.svelte @@ -4,9 +4,10 @@ export let { repo_id, + unique_commit, name, description, - git_server, + clone, tags, maintainers, relays, diff --git a/src/lib/components/repo/type.ts b/src/lib/components/repo/type.ts index b109ffe..66d10be 100644 --- a/src/lib/components/repo/type.ts +++ b/src/lib/components/repo/type.ts @@ -1,10 +1,11 @@ -import type { User } from '../users/type' +import { defaults as user_defaults, type User } from '../users/type' export interface Repo { repo_id: string + unique_commit: string | undefined name: string description: string - git_server: string + clone: string tags: string[] maintainers: User[] relays: string[] @@ -12,11 +13,29 @@ export interface Repo { } export const defaults: Repo = { repo_id: '', + unique_commit: '', name: '', description: '', - git_server: '', + clone: '', tags: [], maintainers: [], relays: [], loading: true, } + +export interface RepoSummary { + name: string + description: string + repo_id: string + maintainers: User[] + loading?: boolean + created_at: number +} +export const summary_defaults: RepoSummary = { + name: '', + repo_id: '', + description: '', + maintainers: [{ ...user_defaults }], + loading: false, + created_at: 0, +} diff --git a/src/lib/components/repo/vectors.ts b/src/lib/components/repo/vectors.ts index 1ac4302..f8e296c 100644 --- a/src/lib/components/repo/vectors.ts +++ b/src/lib/components/repo/vectors.ts @@ -1,28 +1,28 @@ -import type { Args as SummaryCardArgs } from '../RepoSummaryCard.svelte' import { UserVectors, withName } from '../users/vectors' -import type { Repo } from './type' +import type { Repo, RepoSummary } from './type' export const RepoSummaryCardArgsVectors = { Short: { name: 'Short Name', description: 'short description', - } as SummaryCardArgs, + } as RepoSummary, Long: { name: 'Long Name that goes on and on and on and on and on and on and on and on and on', description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quis nisl eget turpis congue molestie. Nulla vitae purus nec augue accumsan facilisis sed sed ligula. Vestibulum sed risus lacinia risus lacinia molestie. Ut lorem quam, consequat eget tempus in, rhoncus vel nunc. Duis efficitur a leo vel sodales. Nam id fermentum lacus. Etiam nec placerat velit. Praesent ac consectetur est. Aenean iaculis commodo enim.', - } as SummaryCardArgs, + } as RepoSummary, LongNoSpaces: { name: 'LongNameLongNameLongNameLongNameLongNameLongNameLongNameLongName', description: 'LoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsum>', - } as SummaryCardArgs, + } as RepoSummary, } const base: Repo = { repo_id: '9ee507fc4357d7ee16a5d8901bedcd103f23c17d', + unique_commit: '9ee507fc4357d7ee16a5d8901bedcd103f23c17d', name: 'Short Name', description: 'short description', - git_server: 'github.com/example/example', + clone: 'github.com/example/example', tags: ['svelte', 'nostr', 'code-collaboration', 'git'], relays: ['relay.damus.io', 'relay.snort.social', 'relayable.org'], maintainers: [ @@ -50,7 +50,7 @@ export const RepoDetailsArgsVectors = { NoNameOrDescription: { ...base, name: '', description: '' } as Repo, NoDescription: { ...base, description: '' } as Repo, NoTags: { ...base, tags: [] } as Repo, - NoGitServer: { ...base, git_server: '' } as Repo, + NoGitServer: { ...base, clone: '' } as Repo, MaintainersOneProfileNotLoaded: { ...base, maintainers: [ diff --git a/src/lib/stores/repo.ts b/src/lib/stores/repo.ts index 64e244a..e50190d 100644 --- a/src/lib/stores/repo.ts +++ b/src/lib/stores/repo.ts @@ -48,9 +48,10 @@ export const ensureSelectedRepo = async (repo_id: string): Promise => { selected_repo.set({ loading: false, repo_id: event.replaceableDTag(), + unique_commit: event.getMatchingTags('r'), name: event.tagValue('name') || '', description: event.tagValue('description') || '', - git_server: event.tagValue('git-server') || '', + clone: event.tagValue('clone') || '', tags: event.getMatchingTags('t') || [], maintainers: event.getMatchingTags('p').map( (t: string[]) => diff --git a/src/lib/wrappers/ReposRecent.svelte b/src/lib/wrappers/ReposRecent.svelte index 1e4bea8..a5a77e6 100644 --- a/src/lib/wrappers/ReposRecent.svelte +++ b/src/lib/wrappers/ReposRecent.svelte @@ -1,6 +1,6 @@