From 1bfc5dbbc4e105b2417b2ba4f1bafc397d3a509d Mon Sep 17 00:00:00 2001 From: whoswhip Date: Sun, 21 Jun 2026 23:24:15 -0400 Subject: [PATCH] style: improve comments overall styling --- .../lib/components/PasteCommentItem.svelte | 67 ++++++++++--------- .../src/lib/components/PasteComments.svelte | 43 +++++++----- .../src/lib/components/RichTextEditor.svelte | 49 +++++++++----- 3 files changed, 98 insertions(+), 61 deletions(-) diff --git a/SharpbinV3.Client/src/lib/components/PasteCommentItem.svelte b/SharpbinV3.Client/src/lib/components/PasteCommentItem.svelte index c81f0b1..fc0df14 100644 --- a/SharpbinV3.Client/src/lib/components/PasteCommentItem.svelte +++ b/SharpbinV3.Client/src/lib/components/PasteCommentItem.svelte @@ -5,7 +5,7 @@ import { escapeHtml } from '$lib/utils/html'; import { user } from '$lib/stores/user'; import PasteCommentItem from '$lib/components/PasteCommentItem.svelte'; - import { ThumbsUp, ThumbsDown, Trash2, Shredder } from '@lucide/svelte'; + import { ThumbsUp, ThumbsDown, Trash2, Shredder, Reply, Quote } from '@lucide/svelte'; import { resolve } from '$app/paths'; import RichTextEditor from './RichTextEditor.svelte'; import { hasRole, roles } from '$lib/utils/auth'; @@ -93,9 +93,9 @@ } -
+
-
+
{#if node.author} {#if node.author.isBanned} BANNED @@ -113,7 +113,7 @@ {/if} {#if node.updatedAt} edited @@ -127,7 +127,7 @@
-
+
{#if expanded || !isLongComment} {@html parsedHtml} @@ -151,54 +151,53 @@ {/if}
-
+
{#if $user} {#if !replyOpen} {/if} {#if node.author?.uuid === $user.uuid || hasRole($user.roles, 4) || hasRole($user.roles, 2)} -
+
{#if hasRole($user.roles, roles.Moderator) || hasRole($user.roles, roles.Admin)} {/if}
@@ -245,6 +249,9 @@ onSubmit={submitReply} disabled={replySubmitting} submitting={replySubmitting} + submitLabel="Reply" + submittingLabel="Replying..." + compact /> {#if replyError}

{replyError}

@@ -252,7 +259,7 @@ {/if} {#if node.children.length > 0} -
+
{#if depth >= 3 && !showDeepReplies}
{#if $user} - +
+ +
{:else} -
+
Sign in to post comments and reactions.
{/if} @@ -270,15 +283,15 @@ {/if} {#if loading && comments.length === 0} -
+
Loading comments...
{:else if threadedComments.length === 0} -
+
No comments yet.
{:else} -
+
{#each threadedComments as node (node.id)} - import { Bold, Italic, CodeXml, Quote } from '@lucide/svelte'; + import { Bold, Italic, CodeXml, Quote, Send, Eye, Pencil } from '@lucide/svelte'; import { parseCommentMarkdown } from '$lib/utils/markdown'; interface Props { @@ -8,6 +8,7 @@ placeholder?: string; disabled?: boolean; submitting?: boolean; + compact?: boolean; submitLabel?: string; submittingLabel?: string; onSubmit?: (value: string) => void | Promise; @@ -19,6 +20,7 @@ placeholder = 'Write a comment...', disabled = false, submitting = false, + compact = false, submitLabel = 'Post comment', submittingLabel = 'Posting...', onSubmit @@ -30,6 +32,7 @@ const isDisabled = $derived(disabled || submitting); const canSubmit = $derived(!isDisabled && value.trim().length > 0); const parsedHtml = $derived(parseCommentMarkdown(value)); + const editorMinHeight = $derived(compact ? 'min-h-20' : 'min-h-24'); function focusEditor() { editor?.focus(); @@ -133,11 +136,13 @@ } -
+
{#if mode === 'raw'} {:else} -
+
{#if value.trim().length === 0} -
{placeholder}
+
{placeholder}
{:else}
@@ -159,57 +162,71 @@
{/if}
-
+