From a08b3ab37a62173191ff4d5b7ae93f5e71326c80 Mon Sep 17 00:00:00 2001 From: James Xylight Date: Wed, 25 Jun 2025 16:53:21 -0700 Subject: [PATCH 01/14] impr: add confirm dialog for deleting pictrsimage, close #565 --- src/lib/components/lemmy/PictrsImage.svelte | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/lib/components/lemmy/PictrsImage.svelte b/src/lib/components/lemmy/PictrsImage.svelte index dee041a8..2ec0324e 100644 --- a/src/lib/components/lemmy/PictrsImage.svelte +++ b/src/lib/components/lemmy/PictrsImage.svelte @@ -7,7 +7,7 @@ import { client } from '$lib/lemmy.svelte' import { instanceToURL } from '$lib/util.svelte' import type { LocalImage, Person } from 'lemmy-js-client' - import { Button, toast } from 'mono-svelte' + import { action, Button, modal, toast } from 'mono-svelte' import { ArrowDownTray, Icon, Trash } from 'svelte-hero-icons' import UserLink from '$lib/components/lemmy/user/UserLink.svelte' @@ -67,7 +67,24 @@ +{/snippet} + +
{$t('filter.inbox.messages')} - {#snippet extended()} - - {/snippet}
{#await data.messages}
@@ -119,8 +121,17 @@ {@const previews = conversationPreviews(conversations)}
%sveltekit.body%
- - diff --git a/src/style/app.css b/src/style/app.css index e43601cd..d9e2f38d 100644 --- a/src/style/app.css +++ b/src/style/app.css @@ -29,18 +29,18 @@ --color-slate-900: rgb(var(--c-s-900, 15 23 42)); --color-slate-950: rgb(var(--c-s-950, 2 6 23)); - --color-zinc-50: rgb(var(--c-z-50, 251 253 255)); - --color-zinc-100: rgb(var(--c-z-100, 246 247 249)); - --color-zinc-200: rgb(var(--c-z-200, 229 231 235)); - --color-zinc-300: rgb(var(--c-z-300, 217 221 226)); - --color-zinc-400: rgb(var(--c-z-400, 171 177 188)); - --color-zinc-500: rgb(var(--c-z-500, 127 133 146)); - --color-zinc-600: rgb(var(--c-z-600, 95 104 117)); - --color-zinc-700: rgb(var(--c-z-700, 75 84 99)); - --color-zinc-800: rgb(var(--c-z-800, 42 50 63)); - --color-zinc-900: rgb(var(--c-z-900, 32 37 50)); - --color-zinc-925: rgb(var(--c-z-925, 28 32 43)); - --color-zinc-950: rgb(var(--c-z-950, 23 27 36)); + --color-zinc-50: rgb(var(--c-z-50, 252 252 254)); + --color-zinc-100: rgb(var(--c-z-100, 248 248 251)); + --color-zinc-200: rgb(var(--c-z-200, 235 235 240)); + --color-zinc-300: rgb(var(--c-z-300, 222 222 228)); + --color-zinc-400: rgb(var(--c-z-400, 175 175 185)); + --color-zinc-500: rgb(var(--c-z-500, 128 128 138)); + --color-zinc-600: rgb(var(--c-z-600, 98 98 108)); + --color-zinc-700: rgb(var(--c-z-700, 68 68 76)); + --color-zinc-800: rgb(var(--c-z-800, 47 47 54)); + --color-zinc-900: rgb(var(--c-z-900, 34 34 39)); + --color-zinc-925: rgb(var(--c-z-925, 28 28 32)); + --color-zinc-950: rgb(var(--c-z-950, 25 25 29)); --color-primary-100: rgb(var(--c-p-100, 241 245 249)); --color-primary-900: rgb(var(--c-p-900, 15 23 42)); From d25cfc2be40f7f0404ec252818bb28a76bab832f Mon Sep 17 00:00:00 2001 From: James Xylight Date: Wed, 25 Jun 2025 17:13:10 -0700 Subject: [PATCH 07/14] impr: keep photon default theme with custom instance theme, close #541 --- src/lib/ui/presets.ts | 85 ++++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 41 deletions(-) diff --git a/src/lib/ui/presets.ts b/src/lib/ui/presets.ts index 8ea84728..900d6557 100644 --- a/src/lib/ui/presets.ts +++ b/src/lib/ui/presets.ts @@ -1,59 +1,62 @@ import { env } from '$env/dynamic/public' import type { Theme, ThemeColors } from './colors.svelte' +const PHOTON_DEFAULT = { + slate: { + 25: '252 253 254', + 50: '248 250 252', + 100: '241 245 249', + 200: '226 232 240', + 300: '203 213 225', + 400: '148 163 184', + 500: '100 116 139', + 600: '71 85 105', + 700: '51 65 85', + 800: '30 41 59', + 900: '15 23 42', + 950: '2 6 23', + }, + zinc: { + '50': '252 252 254', + '100': '248 248 251', + '200': '235 235 240', + '300': '222 222 228', + '400': '175 175 185', + '500': '128 128 138', + '600': '98 98 108', + '700': '68 68 76', + '800': '47 47 54', + '900': '34 34 39', + '925': '28 28 32', + '950': '25 25 29', + }, + primary: { + 100: '241 245 249', + 900: '15 23 42', + }, + other: { + black: '0 0 0', + white: '255 255 255', + }, +} + export function getDefaultColors(): ThemeColors { - return env.PUBLIC_THEME - ? JSON.parse(env.PUBLIC_THEME) - : { - slate: { - 25: '252 253 254', - 50: '248 250 252', - 100: '241 245 249', - 200: '226 232 240', - 300: '203 213 225', - 400: '148 163 184', - 500: '100 116 139', - 600: '71 85 105', - 700: '51 65 85', - 800: '30 41 59', - 900: '15 23 42', - 950: '2 6 23', - }, - zinc: { - '50': '252 252 254', - '100': '248 248 251', - '200': '235 235 240', - '300': '222 222 228', - '400': '175 175 185', - '500': '128 128 138', - '600': '98 98 108', - '700': '68 68 76', - '800': '47 47 54', - '900': '34 34 39', - '925': '28 28 32', - '950': '25 25 29', - }, - primary: { - 100: '241 245 249', - 900: '15 23 42', - }, - other: { - black: '0 0 0', - white: '255 255 255', - }, - } + return env.PUBLIC_THEME ? JSON.parse(env.PUBLIC_THEME) : PHOTON_DEFAULT } export function getDefaultTheme(): Theme { return { id: 0, colors: getDefaultColors(), - name: 'Default', + name: env.PUBLIC_THEME ? 'Instance Default' : 'Mono', } } export const presets: Theme[] = [ getDefaultTheme(), + ...(env.PUBLIC_THEME + ? [{ colors: PHOTON_DEFAULT, id: -10, name: 'Mono' }] + : []), { colors: { slate: { From f21b843cb50a6dd25f1aa858c47eda15e8527e46 Mon Sep 17 00:00:00 2001 From: James Xylight Date: Wed, 25 Jun 2025 17:18:38 -0700 Subject: [PATCH 08/14] impr: black out nsfw community icons, close #536 --- .../lemmy/community/CommunityItem.svelte | 8 ++++++- src/lib/components/lemmy/post/PostMeta.svelte | 24 +++++++++++++------ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/lib/components/lemmy/community/CommunityItem.svelte b/src/lib/components/lemmy/community/CommunityItem.svelte index afdbdd7b..4da3c118 100644 --- a/src/lib/components/lemmy/community/CommunityItem.svelte +++ b/src/lib/components/lemmy/community/CommunityItem.svelte @@ -20,6 +20,7 @@ Trash, } from 'svelte-hero-icons' import Subscribe from '../../../../routes/communities/Subscribe.svelte' + import { settings } from '$lib/settings.svelte' let showInfo = $state(false) interface Props { @@ -65,11 +66,16 @@ ? 'flex-col gap-2' : 'flex-row'} gap-2 items-center" > - {#if icon}{@render icon()}{:else} + {#if icon}{@render icon()}{:else if community.community.nsfw && settings.nsfwBlur} +
+ {:else} {/if}
- + {#if community.nsfw && settings.nsfwBlur} +
+ {:else} + + {/if} {/snippet} {#snippet popover()} From eb6e4c59e0c6439d693c026b88656aae8da7bfba Mon Sep 17 00:00:00 2001 From: James Xylight Date: Wed, 25 Jun 2025 17:24:20 -0700 Subject: [PATCH 09/14] fix: search page pageination doesn't work --- src/lib/components/lemmy/comment/CommentActions.svelte | 2 +- src/routes/search/+page.svelte | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/components/lemmy/comment/CommentActions.svelte b/src/lib/components/lemmy/comment/CommentActions.svelte index 198ab2df..78685723 100644 --- a/src/lib/components/lemmy/comment/CommentActions.svelte +++ b/src/lib/components/lemmy/comment/CommentActions.svelte @@ -88,7 +88,7 @@ }} > -
{$t('comment.actions.link')}
+
{$t('post.actions.more.share')}
{#if profile.data?.jwt} {#if comment.creator.id == profile.data.user?.local_user_view.person.id} diff --git a/src/routes/search/+page.svelte b/src/routes/search/+page.svelte index cc6a5184..57123dc8 100644 --- a/src/routes/search/+page.svelte +++ b/src/routes/search/+page.svelte @@ -36,8 +36,6 @@ let searchElement: HTMLInputElement | undefined = $state() let form = $state() - let pageNum = $state(data.filters.value.page) - let moreOptions = $state(false) @@ -200,6 +198,9 @@
{#if data.results.value.length > 0} - `?page=${page}`} /> + `?page=${page}`} + /> {/if} {/if} From a2040b486d1b215101e488ab9409843d660d30dd Mon Sep 17 00:00:00 2001 From: James Xylight Date: Wed, 25 Jun 2025 17:30:02 -0700 Subject: [PATCH 10/14] fix: youtube videos start at wrong timestamp, close #531 --- .../lemmy/post/media/PostIframe.svelte | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/lib/components/lemmy/post/media/PostIframe.svelte b/src/lib/components/lemmy/post/media/PostIframe.svelte index 8f9fa7ae..b4216cb9 100644 --- a/src/lib/components/lemmy/post/media/PostIframe.svelte +++ b/src/lib/components/lemmy/post/media/PostIframe.svelte @@ -46,11 +46,21 @@ const videoID = youtubeVideoID(inputUrl) - if (autoplay) url.searchParams.set('autoplay', '1') + if (videoID) { + const embedUrl = new URL( + `https://${youtubeDomain(settings.embeds.youtube)}/embed/${videoID}`, + ) - return `https://${youtubeDomain( - settings.embeds.youtube, - )}/embed/${videoID}?${url.searchParams.toString()}` + embedUrl.searchParams.set('start', url.searchParams.get('t') ?? '') + + url.searchParams.forEach((value, key) => { + embedUrl.searchParams.set(key, value) + }) + + if (autoplay) embedUrl.searchParams.set('autoplay', '1') + + return embedUrl.toString() + } } return '' From 551c3aa8e805025f112391382791bd6bf406a309 Mon Sep 17 00:00:00 2001 From: James Xylight Date: Wed, 25 Jun 2025 17:34:11 -0700 Subject: [PATCH 11/14] fix: browser title doesn't update enough, close #287 --- src/routes/+layout.svelte | 5 +---- src/routes/+page.svelte | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 588dde6d..2f5a87df 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -61,9 +61,7 @@ ? 'font-inter' : settings.font == 'system' ? 'font-system' - : settings.font == 'satoshi/nunito' - ? 'font-nunito' - : 'font-sans', + : 'font-sans', ) } }) @@ -81,7 +79,6 @@ {#if site.data?.site_view} - {site.data?.site_view.site.name} + + {site.data?.site_view.site.name} + +
From 05632276841830847c0cba8c5b9db46792436a3d Mon Sep 17 00:00:00 2001 From: James Xylight Date: Wed, 25 Jun 2025 17:44:37 -0700 Subject: [PATCH 12/14] feat: add option to make post titles open link, close #476 --- src/lib/components/lemmy/post/Post.svelte | 1 + src/lib/components/lemmy/post/PostMeta.svelte | 9 ++++++++- src/lib/i18n/en.json | 4 ++++ src/lib/settings.svelte.ts | 2 ++ src/routes/settings/+page.svelte | 5 +++++ 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/lib/components/lemmy/post/Post.svelte b/src/lib/components/lemmy/post/Post.svelte index 901d25ec..b7b72476 100644 --- a/src/lib/components/lemmy/post/Post.svelte +++ b/src/lib/components/lemmy/post/Post.svelte @@ -133,6 +133,7 @@ style="grid-area: meta;" edited={post.post.updated} tags={tags?.tags} + postUrl={post.post.url} {view} {extraBadges} /> diff --git a/src/lib/components/lemmy/post/PostMeta.svelte b/src/lib/components/lemmy/post/PostMeta.svelte index 25f34ae8..5e83fde4 100644 --- a/src/lib/components/lemmy/post/PostMeta.svelte +++ b/src/lib/components/lemmy/post/PostMeta.svelte @@ -98,6 +98,7 @@ style?: string titleClass?: string extraBadges?: import('svelte').Snippet + postUrl?: string } let { @@ -122,6 +123,7 @@ admin: false, }, tags = [], + postUrl, style = '', titleClass = '', extraBadges, @@ -332,7 +334,12 @@
{#if title && id}
+ Date: Wed, 25 Jun 2025 17:50:06 -0700 Subject: [PATCH 13/14] fix: stop propagation for colorscheme button, close #425 --- src/lib/components/ui/navbar/Profile.svelte | 36 +++++++++------------ 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/src/lib/components/ui/navbar/Profile.svelte b/src/lib/components/ui/navbar/Profile.svelte index 0c823116..f421ee36 100644 --- a/src/lib/components/ui/navbar/Profile.svelte +++ b/src/lib/components/ui/navbar/Profile.svelte @@ -133,7 +133,7 @@ {/snippet} {$t('nav.menu.settings')} - + e.stopPropagation()}> {#snippet prefix()} {/snippet} {$t('nav.menu.colorscheme.label')} - - -
{})}> - -
+
{#snippet prefix()} From ccff1ac887b2feb612e65b187c0fbf8ba691182c Mon Sep 17 00:00:00 2001 From: James Xylight Date: Wed, 25 Jun 2025 17:59:39 -0700 Subject: [PATCH 14/14] fix: eslint stop propagation error --- src/lib/components/ui/navbar/Profile.svelte | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lib/components/ui/navbar/Profile.svelte b/src/lib/components/ui/navbar/Profile.svelte index f421ee36..007df3c2 100644 --- a/src/lib/components/ui/navbar/Profile.svelte +++ b/src/lib/components/ui/navbar/Profile.svelte @@ -1,6 +1,4 @@