From e79685b8a6d2cc9917cc665d6d5a5693bac6469a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Mon, 5 Jun 2023 11:26:11 +0200 Subject: [PATCH] Improve patch view visuals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - underline in commit hover state - indent revision comments - dim "Revision" text in header - fix vertical alignment of header items in right-hand-side - don't show first revision description, it's already shown as part of the patch description Signed-off-by: Rūdolfs Ošiņš --- public/typography.css | 3 - src/components/Thread.svelte | 2 +- src/views/projects/Blob.svelte | 2 +- src/views/projects/Cob/Revision.svelte | 64 +++++++++++++-------- src/views/projects/Issue.svelte | 4 +- src/views/projects/Patch.svelte | 3 +- src/views/projects/Patch/PatchTeaser.svelte | 2 +- 7 files changed, 48 insertions(+), 32 deletions(-) diff --git a/public/typography.css b/public/typography.css index 1ce5b810e..409e390f6 100644 --- a/public/typography.css +++ b/public/typography.css @@ -141,9 +141,6 @@ p { color: var(--color-foreground-5); font-style: italic; } -.txt-faded { - color: var(--color-foreground-5); -} .txt-link { color: var(--color-foreground-6); text-decoration: none; diff --git a/src/components/Thread.svelte b/src/components/Thread.svelte index f8b4dfcbd..e7b77c1bf 100644 --- a/src/components/Thread.svelte +++ b/src/components/Thread.svelte @@ -66,7 +66,7 @@ } -
+
- {parentDir} + {parentDir} ​ {blob.name} diff --git a/src/views/projects/Cob/Revision.svelte b/src/views/projects/Cob/Revision.svelte index 92abb5dba..7b3db7ee4 100644 --- a/src/views/projects/Cob/Revision.svelte +++ b/src/views/projects/Cob/Revision.svelte @@ -3,8 +3,9 @@ import type { Timeline } from "@app/views/projects/Patch.svelte"; import * as utils from "@app/lib/utils"; - import { onMount } from "svelte"; import { HttpdClient } from "@httpd-client"; + import { onMount } from "svelte"; + import { twemoji } from "@app/lib/utils"; import Authorship from "@app/components/Authorship.svelte"; import Avatar from "@app/components/Avatar.svelte"; @@ -36,6 +37,7 @@ export let timelines: Timeline[]; export let previousRevId: string | undefined = undefined; export let previousRevOid: string | undefined = undefined; + export let first: boolean; const api = new HttpdClient(baseUrl); @@ -78,10 +80,8 @@
@@ -181,7 +192,8 @@ on:click={() => (expanded = !expanded)} />
- Revision {utils.formatObjectId(revisionId)} + Revision + {utils.formatObjectId(revisionId)}
@@ -241,26 +253,30 @@
{#each timelines as element} {#if element.type === "thread"} - +
+ +
{:else if element.type === "revision"} {@const caption = patchId === element.inner.id ? "opened this patch" : `updated to ${utils.formatObjectId(element.inner.id)}`} - {#if element.inner.description} - + {#if element.inner.description && !first} +
+ +
{/if} -
+
{caption} {#if response?.commits} -
+
{#each response.commits as commit, i}
@@ -275,9 +291,11 @@ revision: commit.id, search: undefined, }}> - +
+ +
@@ -296,8 +314,7 @@
{/if} {:else if element.type === "merge"} -
+
-
+
{:else}
diff --git a/src/views/projects/Issue.svelte b/src/views/projects/Issue.svelte index facb5dd67..93bf94928 100644 --- a/src/views/projects/Issue.svelte +++ b/src/views/projects/Issue.svelte @@ -257,7 +257,9 @@
{#each threads as thread (thread.root.id)} - +
+ +
{/each}
{#if $httpdStore.state === "authenticated"} diff --git a/src/views/projects/Patch.svelte b/src/views/projects/Patch.svelte index 064be2337..07505a31e 100644 --- a/src/views/projects/Patch.svelte +++ b/src/views/projects/Patch.svelte @@ -223,7 +223,7 @@ gap: 0.5rem; } .draft { - color: var(--color-foreground-4); + color: var(--color-foreground-6); } .open { color: var(--color-positive-6); @@ -382,6 +382,7 @@ {projectDefaultBranch} {projectHead} {...revision} + first={index === 0} on:reply={createReply} patchId={patch.id} authorId={patch.author.id} diff --git a/src/views/projects/Patch/PatchTeaser.svelte b/src/views/projects/Patch/PatchTeaser.svelte index fdadd0f87..ced508efc 100644 --- a/src/views/projects/Patch/PatchTeaser.svelte +++ b/src/views/projects/Patch/PatchTeaser.svelte @@ -88,7 +88,7 @@ text-overflow: ellipsis; } .draft { - color: var(--color-foreground-4); + color: var(--color-foreground-6); } .open { color: var(--color-positive-6);