From f9becd1bd0cb0bdcb6d29e3b5262ddbddaedf106 Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Thu, 10 Aug 2023 17:00:54 -0700 Subject: [PATCH] feat: add default comment sorts, close #93 --- package.json | 2 +- src/lib/settings.ts | 6 ++++-- src/routes/inbox/InboxItem.svelte | 2 +- .../post/[instance]/[id=integer]/+page.svelte | 3 +-- .../post/[instance]/[id=integer]/+page.ts | 6 +++++- src/routes/settings/+page.svelte | 19 ++++++++++++++----- src/routes/settings/Setting.svelte | 2 +- 7 files changed, 27 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index eb9b3f6f..c4ae0a23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "photon-lemmy", - "version": "0.6.2", + "version": "0.6.3", "private": true, "scripts": { "dev": "vite dev", diff --git a/src/lib/settings.ts b/src/lib/settings.ts index a34ae58f..594553b3 100644 --- a/src/lib/settings.ts +++ b/src/lib/settings.ts @@ -1,4 +1,4 @@ -import type { SortType } from 'lemmy-js-client' +import type { CommentSortType, SortType } from 'lemmy-js-client' import { writable } from 'svelte/store' interface Settings { @@ -16,6 +16,7 @@ interface Settings { defaultSort: { sort: SortType feed: 'All' | 'Subscribed' | 'Local' + comments: CommentSortType } hidePosts: { deleted: boolean @@ -40,13 +41,14 @@ const defaultSettings: Settings = { revertColors: false, showInstances: { user: false, - community: false, + community: true, comments: false, }, showCompactPosts: false, defaultSort: { sort: 'Active', feed: 'Local', + comments: 'Hot', }, hidePosts: { deleted: true, diff --git a/src/routes/inbox/InboxItem.svelte b/src/routes/inbox/InboxItem.svelte index 29878b95..9ed7c319 100644 --- a/src/routes/inbox/InboxItem.svelte +++ b/src/routes/inbox/InboxItem.svelte @@ -89,7 +89,7 @@ } - + {#if !isPrivateMessage(item)}

Settings

-

General

+ General Default sort The default sort to use for feeds.
-
+
Feed
-
+
Sort
+
+ Comments + +
@@ -59,7 +67,8 @@ Show a user's display name instead of their account username. -

UI

+ UI + Mark read posts @@ -82,7 +91,7 @@ bind:selected={$userSettings.showCompactPosts} /> -

Instances

+ Instances Show instances Show items' instances. diff --git a/src/routes/settings/Setting.svelte b/src/routes/settings/Setting.svelte index 4dfd8a43..273aeaa8 100644 --- a/src/routes/settings/Setting.svelte +++ b/src/routes/settings/Setting.svelte @@ -2,7 +2,7 @@ import Card from '$lib/components/ui/Card.svelte' - +

{#if $$slots.description}