Merge remote-tracking branch 'origin/main' into piefed-3

This commit is contained in:
James Xylight committed 2025-09-05 22:28:22 -07:00
commit aa270be722
25 files changed
+164 -110

No files matched your search

+1 -4
View File
@@ -16,10 +16,7 @@ export async function load({ params, fetch }) {
const split = comment.comment_view.comment.path.split('.')
const threadPath =
split.length > 4
? comment.comment_view.comment.id
: split.slice(-5).join('.')
const threadPath = split.slice(-5).join('.')
redirect(
302,
+3 -2
View File
@@ -17,6 +17,7 @@
import { expoOut } from 'svelte/easing'
import { fly } from 'svelte/transition'
import SearchBar from '../search/SearchBar.svelte'
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
let { data } = $props()
@@ -157,10 +158,10 @@
</ul>
{/if}
{#if data.communities.value.length > 0}
<div class="sticky z-30 mx-auto max-w-full bottom-22 lg:bottom-6">
<Fixate placement="bottom">
<Pageination
page={Number(page.url.searchParams.get('page')) || 1}
href={c => `?page=${c}`}
/>
</div>
</Fixate>
{/if}
+16 -13
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { site } from '$lib/lemmy.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
import { t } from '$lib/i18n/translations'
@@ -10,18 +11,20 @@
{$t('nav.create.label')}
</Header>
<Tabs
style="subpage"
routes={[
{
href: '/create/post',
name: $t('nav.create.post'),
},
{
href: '/create/community',
name: $t('nav.create.community'),
},
]}
/>
{#if !site || !site.data?.site_view.local_site.community_creation_admin_only}
<Tabs
style="subpage"
routes={[
{
href: '/create/post',
name: $t('nav.create.post'),
},
{
href: '/create/community',
name: $t('nav.create.community'),
},
]}
/>
{/if}
{@render children?.()}
+1 -8
View File
@@ -1,19 +1,12 @@
<script lang="ts">
import { goto } from '$app/navigation'
import { profile } from '$lib/auth.svelte.js'
import PostForm from '$lib/components/lemmy/post/form/PostForm.svelte'
import { t } from '$lib/i18n/translations.js'
import { getSessionStorage, setSessionStorage } from '$lib/session.js'
import { onDestroy, onMount } from 'svelte'
import { onDestroy } from 'svelte'
let { data } = $props()
onMount(() => {
if (!profile.current?.jwt) {
goto('/login')
}
})
let community = getSessionStorage('lastSeenCommunity') as
| { id: number; name: string }
| undefined
+5
View File
@@ -1,3 +1,8 @@
import { profile } from '$lib/auth.svelte.js'
import { redirect } from '@sveltejs/kit'
export const load = ({ url }) => {
if (!profile.current.jwt) redirect(302, '/login')
return { crosspost: Boolean(url.searchParams.get('crosspost')) }
}
@@ -26,7 +26,7 @@ interface PartialPost {
function buildContext(thread?: string) {
let parentId: number | undefined
let showContext: boolean = false
const max_depth = 3
let max_depth = 3
if (thread) {
const split = thread.split('.')
@@ -35,6 +35,7 @@ function buildContext(thread?: string) {
else {
parentId = Number(thread.split('.')[0])
showContext = true
max_depth = 5
}
}
@@ -35,9 +35,11 @@
<Header pageHeader>
{routes.find(r => page.url.pathname == r.href)?.name ??
$t('routes.profile.credentials')}
{#snippet extended()}
<Tabs style="subpage" margin={false} {routes}></Tabs>
{/snippet}
</Header>
<Tabs style="subpage" {routes}></Tabs>
<div
class={[
page.url.pathname == '/profile/password' && ' p-8',
+1
View File
@@ -67,6 +67,7 @@
icon={Bookmark}
title="No saved items"
description="Save posts or comments, and they'll be here to refer to them later."
class="my-auto"
/>
{:else}
<CommonList items={data.data} size="lg">
+3 -4
View File
@@ -21,7 +21,7 @@
isUser,
} from '$lib/lemmy/item.js'
import { searchParam } from '$lib/util.svelte.js'
import { Button, Select, Spinner } from 'mono-svelte'
import { Button, Select, Spinner, TextLoader } from 'mono-svelte'
import Option from 'mono-svelte/forms/select/Option.svelte'
import {
AdjustmentsHorizontal,
@@ -151,8 +151,7 @@
class="flex gap-2 items-center my-4"
out:slide={{ axis: 'y', easing: expoOut }}
>
<Spinner width={24} />
<span>{$t('routes.search.federating')}</span>
<TextLoader>{$t('routes.search.federating')}</TextLoader>
</div>
{:then object}
{#if object}
@@ -175,7 +174,7 @@
</div>
{/if}
{/await}
<CommonList items={data.results.value} animate size="lg">
<CommonList items={data.results.value}>
{#snippet item(result)}
{#if isPostView(result)}
<PostItem post={result} />
+1 -3
View File
@@ -13,9 +13,7 @@
let searchElement = $state<HTMLInputElement>()
</script>
<div
class="flex gap-2 flex-row items-center w-full text-base h-10 drop-shadow-xl"
>
<div class="flex gap-2 flex-row items-center w-full text-base h-10">
<TextInput
bind:value={query}
bind:element={searchElement}
+1 -1
View File
@@ -67,7 +67,7 @@
</svelte:head>
<div class="mx-auto max-w-xl flex flex-col gap-4 my-auto h-max w-full">
<Button href="/accounts" class="inline-block mb-4 w-max" rounding="pill">
<Button href="/accounts" class="mb-4 w-max" rounding="pill">
<Icon src={ArrowLeft} size="16" micro />
{$t('common.back')}
</Button>
+2 -2
View File
@@ -157,8 +157,7 @@
class="flex flex-col gap-4 h-full w-full flex-2/3"
onsubmit={preventDefault(submit)}
>
<ErrorContainer scope={page.url.pathname} />
<Button href="/accounts" class="inline-block mb-4 w-max" rounding="pill">
<Button href="/accounts" class=" mb-4 w-max" rounding="pill">
<Icon src={ArrowLeft} size="16" micro />
{$t('common.back')}
</Button>
@@ -177,6 +176,7 @@
</span>
{/snippet}
</Header>
<ErrorContainer scope={page.url.pathname} />
{#if data.site_view.local_site.registration_mode != 'Closed'}
<div class="flex flex-col md:flex-row gap-2 *:flex-1">
+2 -2
View File
@@ -1,4 +1,4 @@
import { getClient } from '$lib/client/lemmy.svelte'
import { client } from '$lib/client/lemmy.svelte'
import { getItemPublished } from '$lib/lemmy/item.js'
import { ReactiveState } from '$lib/promise.svelte.js'
import type { SortType } from '$lib/client/types'
@@ -9,7 +9,7 @@ export async function load({ params, url, fetch }) {
(url.searchParams.get('type') as 'comments' | 'posts' | 'all') || 'all'
const sort: SortType = (url.searchParams.get('sort') as SortType) || 'New'
const user = await getClient(undefined, fetch).getPersonDetails({
const user = await client({ func: fetch }).getPersonDetails({
limit: 20,
page: page,
username: params.name,