From d8d049518b2d7f5761e3dd4d384d4d20646d2281 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Thu, 27 Apr 2023 12:35:46 +0200 Subject: [PATCH] Improve patch timeline and add description Signed-off-by: Sebastian Martinez --- httpd-client/index.ts | 18 +- httpd-client/lib/project.ts | 2 +- httpd-client/lib/project/patch.ts | 2 +- scripts/run-httpd-with-fixtures | 2 +- src/components/Authorship.svelte | 20 +- src/components/Comment.svelte | 12 +- src/components/Dropdown.svelte | 2 +- src/components/ErrorMessage.svelte | 3 + src/components/InlineMarkdown.svelte | 5 +- src/components/Markdown.svelte | 4 + src/components/TextInput.svelte | 6 - src/components/Thread.svelte | 22 +- src/views/projects/Cob/AssigneeInput.svelte | 23 +- src/views/projects/Cob/CobHeader.svelte | 105 +++-- src/views/projects/Cob/Revision.svelte | 263 ++++++++++++ src/views/projects/Cob/TagInput.svelte | 23 +- src/views/projects/Commit/CommitTeaser.svelte | 1 - src/views/projects/Issue.svelte | 89 ++-- src/views/projects/Issue/New.svelte | 60 ++- src/views/projects/Patch.svelte | 382 +++++++++--------- src/views/projects/View.svelte | 10 +- tests/e2e/project.spec.ts | 6 +- tests/e2e/project/commits.spec.ts | 6 +- 23 files changed, 686 insertions(+), 380 deletions(-) create mode 100644 src/views/projects/Cob/Revision.svelte diff --git a/httpd-client/index.ts b/httpd-client/index.ts index b1bd7e86a..902b821bf 100644 --- a/httpd-client/index.ts +++ b/httpd-client/index.ts @@ -1,5 +1,11 @@ import type { BaseUrl } from "./lib/fetcher.js"; -import type { Blob, Project, Remote, Tree } from "./lib/project.js"; +import type { + Blob, + Project, + Remote, + Tree, + DiffResponse, +} from "./lib/project.js"; import type { Comment } from "./lib/project/comment.js"; import type { Commit, @@ -9,7 +15,13 @@ import type { HunkLine, } from "./lib/project/commit.js"; import type { Issue, IssueState } from "./lib/project/issue.js"; -import type { Merge, Patch, PatchState, Review } from "./lib/project/patch.js"; +import type { + Merge, + Patch, + PatchState, + Review, + Revision, +} from "./lib/project/patch.js"; import type { RequestOptions, Method } from "./lib/fetcher.js"; import type { ZodSchema } from "zod"; @@ -27,6 +39,7 @@ export type { CommitHeader, Diff, DiffAddedDeletedModifiedChangeset, + DiffResponse, HunkLine, Issue, IssueState, @@ -36,6 +49,7 @@ export type { Project, Remote, Review, + Revision, Tree, }; diff --git a/httpd-client/lib/project.ts b/httpd-client/lib/project.ts index e6ba38b93..491c68c4a 100644 --- a/httpd-client/lib/project.ts +++ b/httpd-client/lib/project.ts @@ -153,7 +153,7 @@ const remoteSchema = strictObject({ const remotesSchema = array(remoteSchema) satisfies ZodSchema; -interface DiffResponse { +export interface DiffResponse { commits: CommitHeader[]; diff: Diff; } diff --git a/httpd-client/lib/project/patch.ts b/httpd-client/lib/project/patch.ts index 200193e01..90c0f8e8f 100644 --- a/httpd-client/lib/project/patch.ts +++ b/httpd-client/lib/project/patch.ts @@ -85,7 +85,7 @@ const reviewSchema = strictObject({ timestamp: number(), }) satisfies ZodSchema; -interface Revision { +export interface Revision { id: string; description: string; base: string; diff --git a/scripts/run-httpd-with-fixtures b/scripts/run-httpd-with-fixtures index 2da66cab7..25022c16d 100755 --- a/scripts/run-httpd-with-fixtures +++ b/scripts/run-httpd-with-fixtures @@ -1,7 +1,7 @@ #!/bin/bash set -e -REV=414477a31676d5e75efa7f3e8dc6624bcf2b2e52 +REV=b29321dbf7999ec7ec9b7ac9192071e512ada407 REPO_ROOT=$(git rev-parse --show-toplevel) FIXTURE=$REPO_ROOT/tests/fixtures/seeds/palm.tar.bz2 diff --git a/src/components/Authorship.svelte b/src/components/Authorship.svelte index 8fd717b95..368457790 100644 --- a/src/components/Authorship.svelte +++ b/src/components/Authorship.svelte @@ -15,7 +15,7 @@ .authorship { display: inline-flex; align-items: center; - color: var(--color-foreground-6); + color: inherit; padding: 0.125rem 0; gap: 0.25rem; } @@ -29,7 +29,7 @@ } - + {#if !noAvatar} {/if} @@ -39,14 +39,16 @@ {formatNodeId(authorId).replace("did:key:", "")} - - {#if !caption} - - {:else} + {#if !caption} + + {:else} + {caption} - {/if} - + + {/if} {#if timestamp} - {formatTimestamp(timestamp)} + + {formatTimestamp(timestamp)} + {/if} diff --git a/src/components/Comment.svelte b/src/components/Comment.svelte index 54a92eef6..5a7d7a52e 100644 --- a/src/components/Comment.svelte +++ b/src/components/Comment.svelte @@ -20,13 +20,12 @@ - +
+ +
{#each replies as reply}
(); export let action: "create" | "edit" | "view"; - export let edit: boolean = false; + export let editInProgress: boolean = false; export let assignees: string[] = []; let updatedAssignees: string[] = assignees; @@ -45,9 +45,6 @@ -