diff --git a/src/lib/components/lemmy/comment/Comment.svelte b/src/lib/components/lemmy/comment/Comment.svelte index 01225339..096ddb15 100644 --- a/src/lib/components/lemmy/comment/Comment.svelte +++ b/src/lib/components/lemmy/comment/Comment.svelte @@ -116,8 +116,7 @@ {#if meta} + + diff --git a/src/lib/components/lemmy/post/PostVote.svelte b/src/lib/components/lemmy/post/PostVote.svelte index 632b34e8..3552f54a 100644 --- a/src/lib/components/lemmy/post/PostVote.svelte +++ b/src/lib/components/lemmy/post/PostVote.svelte @@ -22,6 +22,7 @@ import { site } from '$lib/lemmy.svelte.js' import { vote as voteItem } from '$lib/lemmy/contentview.js' import { errorMessage } from '$lib/lemmy/error' + import { settings } from '$lib/settings.svelte' import type { Post } from 'lemmy-js-client' import { buttonColor, toast } from 'mono-svelte' import { ChevronDown, ChevronUp, Icon } from 'svelte-hero-icons' @@ -67,16 +68,21 @@ {#if children}{@render children({ vote, score })}{:else} + {@const voteRatio = Math.floor( + ((upvotes ?? 0) / ((upvotes ?? 0) + (downvotes ?? 0))) * 100, + )}
{/if} + + diff --git a/src/lib/components/render/VirtualList.svelte b/src/lib/components/render/VirtualList.svelte index 09fadb7a..160e1918 100644 --- a/src/lib/components/render/VirtualList.svelte +++ b/src/lib/components/render/VirtualList.svelte @@ -230,7 +230,7 @@ {#each visibleItems as item (item.index)}
{@render itemSnippet(item.index)} diff --git a/src/lib/components/ui/layout/CommonList.svelte b/src/lib/components/ui/layout/CommonList.svelte index dbd7c409..80f5a734 100644 --- a/src/lib/components/ui/layout/CommonList.svelte +++ b/src/lib/components/ui/layout/CommonList.svelte @@ -46,20 +46,15 @@ background-color: var(--color-white); container-type: inline-size; - border-left: 1px solid var(--color-slate-100); - border-right: 1px solid var(--color-slate-100); + border-radius: var(--radius-md) var(--radius-md); &:first-child { border-top-left-radius: var(--radius-2xl); border-top-right-radius: var(--radius-2xl); - - border-top: 1px solid var(--color-slate-100); } &:last-child { border-bottom-left-radius: var(--radius-2xl); border-bottom-right-radius: var(--radius-2xl); - - border-bottom: 1px solid var(--color-slate-100); } &:hover { @@ -77,16 +72,6 @@ :global(.dark) ul > :global(li) { background-color: var(--color-zinc-950); - border-left: 1px solid var(--color-zinc-900); - border-right: 1px solid var(--color-zinc-900); - - &:first-child { - border-top: 1px solid var(--color-zinc-900); - } - &:last-child { - border-bottom: 1px solid var(--color-zinc-900); - } - &:hover { background-color: var(--color-zinc-900); } diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json index c1d3558d..dea0246f 100644 --- a/src/lib/i18n/en.json +++ b/src/lib/i18n/en.json @@ -850,6 +850,10 @@ "titleOpensUrl": { "title": "Title opens URL", "description": "Makes clicking the title open the post's attached URL, rather than the comments." + }, + "voteRatioBar": { + "title": "Vote ratio bar", + "description": "When the controversiality of a post reaches greater than 15%, a bar will be displayed in the vote buttons to help visualize sentiment." } }, "embeds": { diff --git a/src/lib/mono/materials/Material.svelte b/src/lib/mono/materials/Material.svelte index 1933102e..35d666ac 100644 --- a/src/lib/mono/materials/Material.svelte +++ b/src/lib/mono/materials/Material.svelte @@ -41,7 +41,7 @@ transparent: 'border border-slate-200 dark:border-zinc-900 border-b-slate-300 dark:border-t-zinc-800', uniform: - 'bg-white dark:bg-zinc-950 border border-slate-100 dark:border-zinc-900', + 'bg-white dark:bg-zinc-950 border border-slate-200 dark:border-zinc-900', none: '', } diff --git a/src/lib/settings.svelte.ts b/src/lib/settings.svelte.ts index 1a109e77..98df5f40 100644 --- a/src/lib/settings.svelte.ts +++ b/src/lib/settings.svelte.ts @@ -104,6 +104,7 @@ interface Settings { messages: { fullMarkdown: boolean } + voteRatioBar: boolean } export const defaultSettings: Settings = { @@ -184,6 +185,7 @@ export const defaultSettings: Settings = { messages: { fullMarkdown: toBool(env.PUBLIC_FULL_MARKDOWN) ?? false, }, + voteRatioBar: true, } function createSettingsState(initial: Settings): Settings { diff --git a/src/routes/post/[instance]/[id=integer]/CommentProvider.svelte b/src/routes/post/[instance]/[id=integer]/CommentProvider.svelte index 0dec7af4..416dc047 100644 --- a/src/routes/post/[instance]/[id=integer]/CommentProvider.svelte +++ b/src/routes/post/[instance]/[id=integer]/CommentProvider.svelte @@ -4,7 +4,7 @@ import { profile } from '$lib/auth.svelte' import CommentForm from '$lib/components/lemmy/comment/CommentForm.svelte' import CommentListVirtualizer from '$lib/components/lemmy/comment/CommentListVirtualizer.svelte' - import Comments from '$lib/components/lemmy/comment/Comments.svelte' + import Comments from '$lib/components/lemmy/comment/CommentTree.svelte' import { buildCommentsTree } from '$lib/components/lemmy/comment/comments.svelte' import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte' import { t } from '$lib/i18n/translations' diff --git a/src/routes/settings/+page.svelte b/src/routes/settings/+page.svelte index 7579c224..39201000 100644 --- a/src/routes/settings/+page.svelte +++ b/src/routes/settings/+page.svelte @@ -29,6 +29,7 @@ ArrowRight, ArrowsPointingOut, ArrowsRightLeft, + ArrowsUpDown, ArrowTopRightOnSquare, ArrowTrendingDown, ArrowUpTray, @@ -402,6 +403,12 @@ title={$t('settings.app.absoluteDates.title')} description={$t('settings.app.absoluteDates.description')} /> +