From 9f1ad19391e83ffde15795de34a0a018d1fcf20a Mon Sep 17 00:00:00 2001 From: Xylight Date: Sun, 15 Sep 2024 14:11:02 -0700 Subject: [PATCH 1/2] design: make compact posts even more compact --- package.json | 2 +- .../lemmy/dropdowns/ViewSelect.svelte | 9 --- src/lib/components/lemmy/post/Post.svelte | 54 +++++++------ .../components/lemmy/post/PostActions.svelte | 4 +- src/lib/components/lemmy/post/PostMeta.svelte | 79 +++++++++++-------- .../lemmy/post/feed/PostFeed.svelte | 8 -- .../lemmy/post/feed/VirtualFeed.svelte | 8 -- .../lemmy/post/link/PostLink.svelte | 6 +- .../lemmy/post/media/PostMediaCompact.svelte | 5 +- 9 files changed, 83 insertions(+), 92 deletions(-) diff --git a/package.json b/package.json index b0934faf..7a9fbf95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "photon-lemmy", - "version": "1.31.3", + "version": "1.31.4", "devDependencies": { "@catdadcode/svelte-adapter-bun": "^0.5.7", "@dicebear/core": "^8.0.1", diff --git a/src/lib/components/lemmy/dropdowns/ViewSelect.svelte b/src/lib/components/lemmy/dropdowns/ViewSelect.svelte index 216a3142..c3db9b9f 100644 --- a/src/lib/components/lemmy/dropdowns/ViewSelect.svelte +++ b/src/lib/components/lemmy/dropdowns/ViewSelect.svelte @@ -52,13 +52,4 @@ /> {$t('filter.view.compact')} - diff --git a/src/lib/components/lemmy/post/Post.svelte b/src/lib/components/lemmy/post/Post.svelte index 27772d79..14957d93 100644 --- a/src/lib/components/lemmy/post/Post.svelte +++ b/src/lib/components/lemmy/post/Post.svelte @@ -82,18 +82,16 @@ --> - +
{ onClick(e) }} @@ -153,8 +151,8 @@ bind:post={post.post} bind:type class="{$userSettings.leftAlign - ? 'mr-2' - : 'ml-2'} flex-shrink no-list-margin" + ? 'mr-3' + : 'ml-3'} flex-shrink no-list-margin" style="grid-area: media;" {view} /> @@ -191,27 +189,35 @@ group-focus:inset-y-0.5 group-focus:-inset-x-4 group-focus:sm:-inset-x-5 group-focus:opacity-100 duration-150" /> - +
diff --git a/src/lib/components/lemmy/post/PostActions.svelte b/src/lib/components/lemmy/post/PostActions.svelte index ab2007f8..94052407 100644 --- a/src/lib/components/lemmy/post/PostActions.svelte +++ b/src/lib/components/lemmy/post/PostActions.svelte @@ -80,8 +80,8 @@ let localShare = false - $: buttonHeight = view == 'compact' ? 'h-[30px]' : 'h-8' - $: buttonSquare = view == 'compact' ? 'w-[30px] h-[30px]' : 'w-8 h-8' + $: buttonHeight = view == 'compact' ? 'h-7' : 'h-8' + $: buttonSquare = view == 'compact' ? 'w-7 h-7' : 'w-8 h-8' {#if editing} diff --git a/src/lib/components/lemmy/post/PostMeta.svelte b/src/lib/components/lemmy/post/PostMeta.svelte index 394dc676..68982fe0 100644 --- a/src/lib/components/lemmy/post/PostMeta.svelte +++ b/src/lib/components/lemmy/post/PostMeta.svelte @@ -115,6 +115,7 @@ class="grid w-full meta {community ? 'grid-rows-2' : 'grid-rows-1'} text-xs min-w-0 max-w-full" + class:compact={view == 'compact'} style={$$props.style ?? ''} > {#if showCommunity && community && subscribed} @@ -126,7 +127,7 @@ > @@ -145,42 +146,44 @@ {/if} - - {#if user} -
- - - {#if badges.moderator} - - {/if} - {#if badges.admin} - - {/if} - - -
- {/if} - {#if published} - - {/if} - {#if edited} -
- -
- {/if} -
+ {#if view != 'compact'} + + {#if user} +
+ + + {#if badges.moderator} + + {/if} + {#if badges.admin} + + {/if} + + +
+ {/if} + {#if published} + + {/if} + {#if edited} +
+ +
+ {/if} +
+ {/if}
{#if posts?.length == 0}
diff --git a/src/lib/components/lemmy/post/feed/VirtualFeed.svelte b/src/lib/components/lemmy/post/feed/VirtualFeed.svelte index 7c7470a0..37265f19 100644 --- a/src/lib/components/lemmy/post/feed/VirtualFeed.svelte +++ b/src/lib/components/lemmy/post/feed/VirtualFeed.svelte @@ -214,14 +214,6 @@ class="flex flex-col list-none {$userSettings.view == 'card' ? 'gap-3 md:gap-4' : 'divide-y'} divide-slate-200 dark:divide-zinc-800" - style={$userSettings.leftAlign - ? `--template-areas: -'media meta' -'media title' -'media body' -'embed embed' -'actions actions'; --template-columns: auto 1fr;` - : ``} > {#if posts?.length == 0}
diff --git a/src/lib/components/lemmy/post/link/PostLink.svelte b/src/lib/components/lemmy/post/link/PostLink.svelte index 21b20e96..742433cb 100644 --- a/src/lib/components/lemmy/post/link/PostLink.svelte +++ b/src/lib/components/lemmy/post/link/PostLink.svelte @@ -31,7 +31,7 @@ color="distinct" class="flex flex-col-reverse sm:flex-row overflow-hidden gap-4 embed-card z-0 relative - dark:border-t-zinc-800 border-opacity-80" + dark:border-t-zinc-800 border-opacity-80 max-w-full" rounding="xl" element="article" > @@ -125,7 +125,7 @@
{:else} -
+