From bcfea91c6315883e9dca6c3ad3b39c0413b8a656 Mon Sep 17 00:00:00 2001 From: James Xylight Date: Thu, 31 Jul 2025 22:34:24 -0700 Subject: [PATCH] design: increase spacing by screen size for comment trees --- .../lemmy/comment/CommentListVirtualizer.svelte | 2 +- src/lib/components/lemmy/comment/CommentTree.svelte | 12 +++++++----- .../[instance]/[id=integer]/CommentProvider.svelte | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/lib/components/lemmy/comment/CommentListVirtualizer.svelte b/src/lib/components/lemmy/comment/CommentListVirtualizer.svelte index 7c68db29..7db54d06 100644 --- a/src/lib/components/lemmy/comment/CommentListVirtualizer.svelte +++ b/src/lib/components/lemmy/comment/CommentListVirtualizer.svelte @@ -2,7 +2,7 @@ import VirtualList from '$lib/components/render/VirtualList.svelte' import type { Post } from 'lemmy-js-client' import type { CommentNodeI } from './comments.svelte' - import Comments from './CommentList.svelte' + import Comments from './CommentTree.svelte' import { onMount } from 'svelte' interface Props { diff --git a/src/lib/components/lemmy/comment/CommentTree.svelte b/src/lib/components/lemmy/comment/CommentTree.svelte index 8828ee1a..aa3540ea 100644 --- a/src/lib/components/lemmy/comment/CommentTree.svelte +++ b/src/lib/components/lemmy/comment/CommentTree.svelte @@ -9,7 +9,7 @@ import { Button, toast } from 'mono-svelte' import { ArrowDownCircle, Icon } from 'svelte-hero-icons' import Comment from './Comment.svelte' - import Comments from './CommentList.svelte' + import Comments from './CommentTree.svelte' import { buildCommentsTree, type CommentNodeI } from './comments.svelte' interface Props { @@ -93,10 +93,12 @@ bind:node={nodes[index]} postId={post.id} op={post.creator_id == node.comment_view.creator.id} - contentClass="{node.children.length > 0 || - node.comment_view.counts.child_count > 0 - ? 'border-l' - : ''} ml-2.5 border-slate-200 dark:border-zinc-800 pl-2.5" + contentClass={[ + (node.children.length > 0 || + node.comment_view.counts.child_count > 0) && + 'border-l', + 'ml-2.5 border-slate-200 dark:border-zinc-800 pl-3 sm:pl-4 lg:pl-5', + ]} bind:open={nodes[index].expanded} > {#if node.children?.length > 0} diff --git a/src/routes/post/[instance]/[id=integer]/CommentProvider.svelte b/src/routes/post/[instance]/[id=integer]/CommentProvider.svelte index 96ded05c..416dc047 100644 --- a/src/routes/post/[instance]/[id=integer]/CommentProvider.svelte +++ b/src/routes/post/[instance]/[id=integer]/CommentProvider.svelte @@ -4,7 +4,7 @@ import { profile } from '$lib/auth.svelte' import CommentForm from '$lib/components/lemmy/comment/CommentForm.svelte' import CommentListVirtualizer from '$lib/components/lemmy/comment/CommentListVirtualizer.svelte' - import Comments from '$lib/components/lemmy/comment/CommentList.svelte' + import Comments from '$lib/components/lemmy/comment/CommentTree.svelte' import { buildCommentsTree } from '$lib/components/lemmy/comment/comments.svelte' import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte' import { t } from '$lib/i18n/translations'