From 602fab0f1e4661eb01370e7ec6f5108ec75e5a79 Mon Sep 17 00:00:00 2001 From: James Xylight Date: Sun, 31 Aug 2025 10:18:27 -0700 Subject: [PATCH 1/6] i18n: switch from mixed case to sentence case --- src/lib/components/ui/ExpandableImage.svelte | 2 +- .../ui/navbar/commands/actions.svelte.ts | 7 +- src/lib/i18n/en.json | 106 +++++++----------- src/routes/theme/+page.svelte | 8 +- 4 files changed, 49 insertions(+), 74 deletions(-) diff --git a/src/lib/components/ui/ExpandableImage.svelte b/src/lib/components/ui/ExpandableImage.svelte index 65efd924..7f4c6b17 100644 --- a/src/lib/components/ui/ExpandableImage.svelte +++ b/src/lib/components/ui/ExpandableImage.svelte @@ -76,7 +76,7 @@ color="tertiary" size="square-lg" rounding="pill" - title={$t('post.image.close')} + title={$t('common.back')} > {#snippet prefix()} diff --git a/src/lib/components/ui/navbar/commands/actions.svelte.ts b/src/lib/components/ui/navbar/commands/actions.svelte.ts index 39667e06..1168fc71 100644 --- a/src/lib/components/ui/navbar/commands/actions.svelte.ts +++ b/src/lib/components/ui/navbar/commands/actions.svelte.ts @@ -392,14 +392,9 @@ export function getGroups( actions: [ { href: '/create/post', - name: t.get('routes.createPost'), + name: t.get('form.post.create'), icon: PencilSquare, }, - { - href: '/create/community', - name: t.get('routes.createCommunity'), - icon: Newspaper, - }, ], }, { diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json index 7f9453a2..3661da88 100644 --- a/src/lib/i18n/en.json +++ b/src/lib/i18n/en.json @@ -22,7 +22,7 @@ "app": "App", "settings": "Settings", "colorscheme": { - "label": "Color Scheme", + "label": "Color scheme", "system": "System", "dark": "Dark", "light": "Light" @@ -34,7 +34,7 @@ "instance": "Instance" }, "commands": { - "prompt": "Command Palette", + "prompt": "Command palette", "recents": "Recents", "content": "Content", "search": "Search for {{default}}", @@ -52,15 +52,15 @@ "notifications": "Notifications" }, "account": { - "login": "Log In", - "logout": "Log Out", - "signup": "Sign Up", + "login": "Log in", + "logout": "Log out", + "signup": "Sign up", "accounts": "Accounts", - "changeinstance": "Change Instance", - "resetColor": "Reset Color", - "addGuest": "Add Guest", - "moveUp": "Move Up", - "moveDown": "Move Down", + "changeinstance": "Change instance", + "resetColor": "Reset color", + "addGuest": "Add guest", + "moveUp": "Move up", + "moveDown": "Move down", "guest": "Guest", "versionGate": "This version of Photon supports instances running {{version}} or higher." }, @@ -121,24 +121,24 @@ "name": "Name", "instance": "Instance URL", "password": "Password", - "confirmPassword": "Confirm Password", + "confirmPassword": "Confirm password", "2fa": "2FA Code", - "forgotpassword": "Forgot Password", + "forgotpassword": "Forgot password", "submit": "Submit", "edit": "Edit", "preview": "Preview", "post": { - "create": "Create Post", - "edit": "Edit Post", + "create": "Create post", + "edit": "Edit post", "community": "Community", "title": "Title", "url": "URL", "body": "Body", "nsfw": "NSFW", - "generateTitle": "Generate Title", - "uploadImage": "Upload Image", + "generateTitle": "Generate title", + "uploadImage": "Upload image", "selectFile": "Select a file", - "altText": "Alt Text", + "altText": "Alt text", "addUrl": "Add URL", "setLanguage": "Set language", "unset": "Unset", @@ -150,15 +150,15 @@ "avatar": "Avatar", "banner": "Banner", "email": "Email", - "matrix": "Matrix User", + "matrix": "Matrix user", "showNSFW": "Show NSFW content", - "scores": "Show Scores", - "bot": "Bot Account", - "showBots": "Show Bots", - "showRead": "Show Read Posts", - "currentPassword": "Current Password", - "newPassword": "New Password", - "verifyNewPassword": "Verify New Password", + "scores": "Show scores", + "bot": "Bot account", + "showBots": "Show bots", + "showRead": "Show read posts", + "currentPassword": "Current password", + "newPassword": "New password", + "verifyNewPassword": "Verify new password", "2fa": { "totp": "TOTP", "2fa": "2FA", @@ -166,7 +166,6 @@ "disabled": "2FA is disabled" }, "deleteAccount": { - "label": "Delete account", "deleteContent": "Delete content", "warning": "This will delete ALL of your submissions." }, @@ -253,7 +252,6 @@ "download": "Download" }, "logins": "Logins", - "welcome": "Welcome, {{default}}!", "delete": { "title": "Delete account", "warning": "This is permanent. Are you sure you want to do this?" @@ -284,8 +282,6 @@ "other": "Other results" }, "saved": "Saved", - "createPost": "Create Post", - "createCommunity": "Create Community", "post": { "crosspostCount": "Crossposts", "commentCount": "Comments", @@ -365,15 +361,15 @@ "sidebar": "Sidebar", "icon": "Icon", "banner": "Banner", - "downvotesEnabled": "Enable Downvotes", + "downvotesEnabled": "Enable downvotes", "nsfwEnabled": "Enable NSFW", "registration": { - "label": "Registration Mode", + "label": "Registration mode", "open": "Open", - "application": "Require Application", + "application": "Require application", "closed": "Closed" }, - "applicationQuestion": "Application Question", + "applicationQuestion": "Application question", "adminCommunityOnly": "Only admins can create communities", "requireVerifyEmail": "Require email verification", "emailAdminsOnApplication": "Email admins on receiving new applications", @@ -389,7 +385,7 @@ "federation": "Federation enabled", "federationDebug": "Federation debug mode", "captcha": { - "enabled": "CAPTCHA Enabled" + "enabled": "CAPTCHA enabled" } }, "applications": { @@ -405,7 +401,7 @@ "deny": "Deny", "approve": "Approve", "reason": "Reason", - "modalTitle": "Deny Application" + "modalTitle": "Deny application" }, "taglines": { "title": "Taglines", @@ -425,10 +421,10 @@ "federation": { "title": "Federation", "csv": "Upload CSV", - "blocked": "Blocked Instances", + "blocked": "Blocked instances", "block": "Block", "blockplaceholder": "Block an instance...", - "allowed": "Whitelisted Instances", + "allowed": "Whitelisted instances", "allow": "Whitelist", "allowplaceholder": "Whitelist an instance", "emptyBlock": { @@ -449,7 +445,7 @@ "error": "Failed to verify your email." }, "passwordChange": { - "title": "Change Password", + "title": "Change password", "description": "Choose your new password.", "instance": "Which instance is your account hosted on?" }, @@ -459,25 +455,22 @@ }, "theme": { "title": "Theme", - "import": "Import", - "export": "Export", - "reset": "Reset", "accent": "Accent", "resetWarning": { - "title": "Reset Theme", + "title": "Reset theme", "description": "This will reset all of your colors to the default. It is recommended to export your theme before this." }, "preset": { "title": "Can't be modified", "description": "This is a default theme, and can't be modified.", "delete": { - "title": "Delete Theme", + "title": "Delete theme", "confirm": "Confirm" }, "default": "Default", "classic": "Classic", - "imported": "Your Theme", - "new": "New Theme", + "imported": "Your theme", + "new": "New theme", "presets": "Presets" } }, @@ -505,8 +498,6 @@ "block": "Block", "unblock": "Unblock", "blockInstance": "Block instance", - "favorite": "Favorite", - "unfavorite": "Remove Favorite", "activeDay": "Active Today" } }, @@ -515,7 +506,7 @@ "instance": "Instance", "label": "Administration", "purgeCommunity": { - "title": "Purging Community", + "title": "Purging community", "warning": "This will delete all posts. Are you sure? (The button will enable in 3 seconds.)" } }, @@ -535,25 +526,19 @@ "save": "Save", "unsave": "Unsave", "more": { - "label": "More Actions", + "label": "More actions", "edit": "Edit", "creator": "Creator", "actions": "Actions", - "markRead": "Mark as Read", - "markUnread": "Mark as Unread", + "markRead": "Mark as read", + "markUnread": "Mark as unread", "hide": "Hide", "unhide": "Unhide", - "translate": "Translate", - "mediaBias": "Media Bias", "share": "Share", "crosspost": "Crosspost", "delete": "Delete", "restore": "Restore" }, - "link": { - "title": "Alternative Links", - "actions": "Link Actions" - }, "vote": { "upvote": "Upvote", "downvote": "Downvote", @@ -570,8 +555,7 @@ }, "image": { "zoomIn": "Zoom in", - "zoomOut": "Zoom out", - "close": "Close" + "zoomOut": "Zoom out" }, "meta": { "lastEdited": "Last edited {{default}}", @@ -738,10 +722,6 @@ "description": "Customize the UI colors.", "link": "Go to themes" }, - "colorscheme": { - "title": "Color Scheme", - "description": "The color scheme to use." - }, "lang": { "title": "Language", "description": "The language used for text in the UI.", diff --git a/src/routes/theme/+page.svelte b/src/routes/theme/+page.svelte index 6526d686..751c062f 100644 --- a/src/routes/theme/+page.svelte +++ b/src/routes/theme/+page.svelte @@ -105,7 +105,7 @@ disabled={themeData.current.id <= 0} > - {$t('routes.theme.import')} + {$t('settings.import')} {#if themeData.current.id <= 0} From 8300e54ca3150f0298995c19229ce2a13cffbb5c Mon Sep 17 00:00:00 2001 From: James Xylight Date: Sun, 31 Aug 2025 10:27:32 -0700 Subject: [PATCH 2/6] fix: improve consistency for user headers --- src/lib/components/lemmy/SiteCard.svelte | 2 +- src/lib/components/ui/ExpandableImage.svelte | 4 +- src/routes/+page.svelte | 2 +- .../c/[name]/settings/team/+page.svelte | 3 +- src/routes/settings/+layout.svelte | 21 +++- src/routes/u/[name]/+page.svelte | 104 +++++++++--------- 6 files changed, 73 insertions(+), 63 deletions(-) diff --git a/src/lib/components/lemmy/SiteCard.svelte b/src/lib/components/lemmy/SiteCard.svelte index a1a4d741..653977d9 100644 --- a/src/lib/components/lemmy/SiteCard.svelte +++ b/src/lib/components/lemmy/SiteCard.svelte @@ -60,7 +60,7 @@
{#if taglines && taglines.length > 0} {/if} diff --git a/src/lib/components/ui/ExpandableImage.svelte b/src/lib/components/ui/ExpandableImage.svelte index 7f4c6b17..0c8b4dab 100644 --- a/src/lib/components/ui/ExpandableImage.svelte +++ b/src/lib/components/ui/ExpandableImage.svelte @@ -65,7 +65,7 @@ color="tertiary" size="square-lg" rounding="pill" - title={$t('post.actions.more.share')} + aria-label={$t('post.actions.more.share')} > {#snippet prefix()} @@ -76,7 +76,7 @@ color="tertiary" size="square-lg" rounding="pill" - title={$t('common.back')} + aria-label={$t('common.back')} > {#snippet prefix()} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 920940ca..08dc3459 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -46,7 +46,7 @@ {#snippet extended()}
-
+
{#if data.filters.value.type_} diff --git a/src/routes/settings/+layout.svelte b/src/routes/settings/+layout.svelte index e15c8622..c40b50fc 100644 --- a/src/routes/settings/+layout.svelte +++ b/src/routes/settings/+layout.svelte @@ -3,7 +3,7 @@ import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte' import { t } from '$lib/i18n/translations' import { defaultSettings, settings } from '$lib/settings.svelte' - import { Button, toast, Modal } from 'mono-svelte' + import { Button, toast, Modal, modal, action } from 'mono-svelte' import TextArea from 'mono-svelte/forms/TextArea.svelte' import { ArrowDownTray, @@ -78,11 +78,20 @@
+ {#snippet extended()} +
+ + + sortForm?.requestSubmit()} + /> + +
+ {/snippet} {/if} -
-
- - sortForm?.requestSubmit()} - /> - - {#if data.items.value.length == 0} - - {:else} - - {#snippet item(item)} - {#if isCommentView(item)} - - {:else if !isCommentView(item)} - - {/if} - {/snippet} - - {/if} - `?page=${page}`} + {#if data.items.value.length == 0} + -
+ {:else} + + {#snippet item(item)} + {#if isCommentView(item)} + + {:else if !isCommentView(item)} + + {/if} + {/snippet} + + {/if} + `?page=${page}`} + />
From b3ea1eb24f8110714719a94a1a38c0533afb82f8 Mon Sep 17 00:00:00 2001 From: James Xylight Date: Sun, 31 Aug 2025 10:30:11 -0700 Subject: [PATCH 3/6] design: improve entityheader consistency --- src/lib/components/lemmy/community/CommunityHeader.svelte | 1 + src/lib/components/ui/EntityHeader.svelte | 7 +++++-- src/routes/c/[name]/+page.svelte | 1 + src/routes/u/[name]/+page.svelte | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/components/lemmy/community/CommunityHeader.svelte b/src/lib/components/lemmy/community/CommunityHeader.svelte index df3caec5..724fb3f4 100644 --- a/src/lib/components/lemmy/community/CommunityHeader.svelte +++ b/src/lib/components/lemmy/community/CommunityHeader.svelte @@ -41,6 +41,7 @@ banner?: boolean class?: string compact?: 'lg' + avatarCircle?: boolean } let { diff --git a/src/lib/components/ui/EntityHeader.svelte b/src/lib/components/ui/EntityHeader.svelte index 36d1ad74..67955195 100644 --- a/src/lib/components/ui/EntityHeader.svelte +++ b/src/lib/components/ui/EntityHeader.svelte @@ -23,6 +23,7 @@ actions?: import('svelte').Snippet children?: import('svelte').Snippet compact?: 'lg' + avatarCircle?: boolean } let { @@ -38,6 +39,7 @@ actions, children, compact, + avatarCircle = true, ...rest }: Props = $props() @@ -71,10 +73,11 @@ width={96} url={avatar} alt={name} - circle={false} + circle={avatarCircle} class={[ - 'ring-slate-25 bg-slate-25 dark:bg-zinc-925 ring-6 relative dark:ring-zinc-950 rounded-3xl!', + 'ring-slate-25 bg-slate-25 dark:bg-zinc-925 ring-6 relative dark:ring-zinc-950', banner && '-mt-12 ml-4', + !avatarCircle && 'rounded-3xl!', ]} />
diff --git a/src/routes/c/[name]/+page.svelte b/src/routes/c/[name]/+page.svelte index c1c5f2ca..6c8e8467 100644 --- a/src/routes/c/[name]/+page.svelte +++ b/src/routes/c/[name]/+page.svelte @@ -72,6 +72,7 @@ counts={data.community.value.community_view.counts} class="w-full relative" compact="lg" + avatarCircle={false} />
{#snippet extended()} diff --git a/src/routes/u/[name]/+page.svelte b/src/routes/u/[name]/+page.svelte index ab34eae8..e04d801c 100644 --- a/src/routes/u/[name]/+page.svelte +++ b/src/routes/u/[name]/+page.svelte @@ -156,6 +156,7 @@
Date: Sun, 31 Aug 2025 10:43:36 -0700 Subject: [PATCH 4/6] fix: attachments for missing buttons --- src/lib/components/lemmy/comment/CommentForm.svelte | 3 ++- src/routes/admin/federation/+page.svelte | 3 ++- src/routes/inbox/messages/[user_id=integer]/Message.svelte | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/components/lemmy/comment/CommentForm.svelte b/src/lib/components/lemmy/comment/CommentForm.svelte index 789394fa..e5be108a 100644 --- a/src/lib/components/lemmy/comment/CommentForm.svelte +++ b/src/lib/components/lemmy/comment/CommentForm.svelte @@ -104,8 +104,9 @@ previewButton={previewAction} > - {#snippet target()} + {#snippet target(attachment)}
{/if} - {#if node.comment_view.comment.deleted || node.comment_view.comment.removed} + {#if node.comment_view.comment.deleted} {/if} + {#if node.comment_view.comment.removed} + + {/if} {#if node.comment_view.saved} Date: Sun, 31 Aug 2025 11:03:16 -0700 Subject: [PATCH 6/6] feat: poll for new messages --- .../messages/[user_id=integer]/+page.svelte | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/routes/inbox/messages/[user_id=integer]/+page.svelte b/src/routes/inbox/messages/[user_id=integer]/+page.svelte index c86fd05e..3ec8b638 100644 --- a/src/routes/inbox/messages/[user_id=integer]/+page.svelte +++ b/src/routes/inbox/messages/[user_id=integer]/+page.svelte @@ -10,7 +10,7 @@ import { settings } from '$lib/settings.svelte' import type { PrivateMessageResponse } from 'lemmy-js-client' import { Button, Material, TextInput, toast } from 'mono-svelte' - import { tick } from 'svelte' + import { onDestroy, onMount, tick } from 'svelte' import { ArrowLeft, Icon, @@ -84,6 +84,25 @@ ), } } + + let interval: number = -1 + + onMount(() => { + interval = setInterval(async () => { + const res = await client().getPrivateMessages({ + creator_id: Number(data.creator.value.person_view.person.id), + limit: 50, + page: 1, + }) + data.message.value = res + }, 5 * 1000) as unknown as number + + return () => clearInterval(interval) + }) + + onDestroy(() => { + clearInterval(interval) + })
@@ -104,12 +123,12 @@ rounding="2xl" padding="none" class="bg-white dark:bg-zinc-950 dark:border-t-zinc-900 - w-full overflow-auto mt-6 relative max-h-128 h-full" + w-full overflow-auto relative h-full" >
    -

    +

    {$t('routes.inbox.messages.conversation', { user: data.creator.value.person_view.person.name +