This commit is contained in:
Xylight committed 2024-04-18 17:52:00 -07:00
1 parent 53bd1dda8b
commit ec57a8a73d
4 files changed
+70 -37

No files matched your search

+9 -2
View File
@@ -29,6 +29,13 @@
export let view = $userSettings.view export let view = $userSettings.view
$: type = mediaType(post.post.url, view) $: type = mediaType(post.post.url, view)
$: hideTitle =
$userSettings.posts.deduplicateEmbed &&
post.post.embed_title == post.post.name
$: hideBody =
$userSettings.posts.deduplicateEmbed &&
post.post.embed_description == post.post.body
</script> </script>
<Material <Material
@@ -62,7 +69,7 @@
? 'Subscribed' ? 'Subscribed'
: 'NotSubscribed'} : 'NotSubscribed'}
id={post.post.id} id={post.post.id}
title={post.post.name} title={hideTitle ? undefined : post.post.name}
read={post.read} read={post.read}
style="grid-area: meta;" style="grid-area: meta;"
> >
@@ -77,7 +84,7 @@
{#if view == 'list' || view == 'compact'} {#if view == 'list' || view == 'compact'}
<PostMediaCompact {view} bind:post={post.post} style="grid-area: media;" /> <PostMediaCompact {view} bind:post={post.post} style="grid-area: media;" />
{/if} {/if}
{#if post.post.body && !post.post.nsfw && view != 'compact'} {#if post.post.body && !post.post.nsfw && view != 'compact' && !hideBody}
<PostBody body={post.post.body} {view} style="grid-area: body" /> <PostBody body={post.post.body} {view} style="grid-area: body" />
{/if} {/if}
{#if actions} {#if actions}
@@ -43,7 +43,9 @@
</script> </script>
<div <div
class="grid w-full meta {community ? 'grid-rows-2' : 'grid-rows-1'} text-xs" class="grid w-full meta {community
? 'grid-rows-2'
: 'grid-rows-1'} text-xs min-w-0 max-w-full"
style={$$props.style ?? ''} style={$$props.style ?? ''}
> >
{#if community} {#if community}
@@ -148,7 +150,7 @@
{#if title && id} {#if title && id}
<a <a
href="/post/{getInstance()}/{id}" href="/post/{getInstance()}/{id}"
class="font-medium text-base w-max max-w-full" class="font-medium text-base w-full"
class:text-slate-600={$userSettings.markReadPosts && read} class:text-slate-600={$userSettings.markReadPosts && read}
class:dark:text-zinc-400={$userSettings.markReadPosts && read} class:dark:text-zinc-400={$userSettings.markReadPosts && read}
style="grid-area: title;" style="grid-area: title;"
+6
View File
@@ -85,6 +85,9 @@ interface Settings {
noGap: boolean noGap: boolean
top: boolean top: boolean
} }
posts: {
deduplicateEmbed: boolean
}
} }
export const defaultSettings: Settings = { export const defaultSettings: Settings = {
@@ -143,6 +146,9 @@ export const defaultSettings: Settings = {
dock: { dock: {
noGap: false, noGap: false,
top: false top: false
},
posts: {
deduplicateEmbed: true
} }
} }
+51 -33
View File
@@ -47,9 +47,39 @@
</h1> </h1>
<div class="flex flex-col gap-4" style="scroll-behavior: smooth;"> <div class="flex flex-col gap-4" style="scroll-behavior: smooth;">
<Section title="Navigation">
<div>
<Button
color="ghost"
on:click={() => {
$userSettings.dock.noGap = true
$userSettings.dock.top = true
}}
disabled={$userSettings.dock.noGap && $userSettings.dock.top}
>
Legacy Navigation Style
</Button>
</div>
<Setting>
<span slot="title">Dock alignment</span>
<span slot="description">Where the dock should be put</span>
<MultiSelect
options={[true, false]}
optionNames={['Top', 'Bottom']}
bind:selected={$userSettings.dock.top}
/>
</Setting>
<ToggleSetting
bind:checked={$userSettings.dock.noGap}
title="Panel mode"
description="Extend the dock to screen edges, similar to a panel."
/>
</Section>
<Section title="Photon"> <Section title="Photon">
<Setting> <Setting>
<span slot="title">Theming</span> <span slot="title">Theming</span>
<span slot="description">Customize Photon's colors.</span>
<Button href="/theme"> <Button href="/theme">
Go to themes <Icon src={ArrowRight} size="16" mini slot="suffix" /> Go to themes <Icon src={ArrowRight} size="16" mini slot="suffix" />
</Button> </Button>
@@ -126,12 +156,17 @@
/> />
<ToggleSetting <ToggleSetting
bind:checked={$userSettings.expandImages} bind:checked={$userSettings.expandImages}
title="Expand Images" title="Expand images"
description="Clicking on a post's image brings you to an expanded view rather than description="Clicking on a post's image brings you to an expanded view rather than
sending you to the post page." sending you to the post page."
/> />
<ToggleSetting
bind:checked={$userSettings.posts.deduplicateEmbed}
title="Hide duplicate titles/bodies"
description="Hides the post title and body if they're the same as the embed."
/>
<Setting> <Setting>
<span slot="title">Thumbnail Alignment</span> <span slot="title">Thumbnail alignment</span>
<span slot="description"> <span slot="description">
Where thumbnails should be on the post in list/compact view. Where thumbnails should be on the post in list/compact view.
</span> </span>
@@ -143,23 +178,6 @@
</Setting> </Setting>
</Section> </Section>
<Section title="Navigation">
<Setting>
<span slot="title">Dock Alignment</span>
<span slot="description">Where the dock should be put</span>
<MultiSelect
options={[true, false]}
optionNames={['Top', 'Bottom']}
bind:selected={$userSettings.dock.top}
/>
</Setting>
<ToggleSetting
bind:checked={$userSettings.dock.noGap}
title="Panel mode"
description="Extend the dock to screen edges, similar to a panel."
/>
</Section>
<Section title="Embeds"> <Section title="Embeds">
<ToggleSetting <ToggleSetting
title="Click to view" title="Click to view"
@@ -177,6 +195,15 @@
<option value="piped">Piped</option> <option value="piped">Piped</option>
</Select> </Select>
</Setting> </Setting>
<Setting>
<span slot="title">Font</span>
<span slot="description">What font Photon should use.</span>
<MultiSelect
options={['inter', 'system', 'browser']}
optionNames={['Inter', 'System UI', 'Browser Font']}
bind:selected={$userSettings.font}
/>
</Setting>
</Section> </Section>
<Section title="Lemmy"> <Section title="Lemmy">
@@ -195,11 +222,6 @@
title="'Crossposted from' when crossposting" title="'Crossposted from' when crossposting"
description="If enabled, crossposts will include a link to the original post." description="If enabled, crossposts will include a link to the original post."
/> />
<ToggleSetting
bind:checked={$userSettings.nsfwBlur}
title="NSFW blur"
description="Blur images and remove post bodies of NSFW content."
/>
<Setting> <Setting>
<span slot="title">Hide Submissions</span> <span slot="title">Hide Submissions</span>
<span slot="description"> <span slot="description">
@@ -222,15 +244,11 @@
</Checkbox> </Checkbox>
</div> </div>
</Setting> </Setting>
<Setting> <ToggleSetting
<span slot="title">Font</span> bind:checked={$userSettings.nsfwBlur}
<span slot="description">What font Photon should use.</span> title="NSFW blur"
<MultiSelect description="Blur images and remove post bodies of content tagged NSFW."
options={['inter', 'system', 'browser']} />
optionNames={['Inter', 'System UI', 'Browser Font']}
bind:selected={$userSettings.font}
/>
</Setting>
<Setting> <Setting>
<span slot="title">Show instances</span> <span slot="title">Show instances</span>
<span slot="description">Show items' instances.</span> <span slot="description">Show items' instances.</span>