From ec7fd813040f0e08a54be52b1b3cd94ed8b8b6cf Mon Sep 17 00:00:00 2001 From: xylight <80978739+Xyphyn@users.noreply.github.com> Date: Mon, 16 Feb 2026 21:03:13 -0800 Subject: [PATCH] design: make signup page look slightly less awful (#717) * design: make signup page look slightly less awful (allow commonlist in virtualizer) * misc: make buttons and menus unselectable * feat: add recommended instances * fix: broken piefed notifications count --- .github/README.md | 2 + src/lib/app/auth/inbox.svelte.ts | 37 +++--- src/lib/app/i18n/en.json | 8 +- src/lib/app/render/VirtualList.svelte | 7 +- src/lib/ui/generic/EntityHeader.svelte | 2 +- src/lib/ui/layout/CommonList.svelte | 104 ++++++++-------- src/lib/ui/shared/button/Button.svelte | 2 + .../ui/shared/disclosure/Expandable.svelte | 2 +- src/lib/ui/shared/forms/TextInput.svelte | 23 ++-- src/lib/ui/shared/materials/Material.svelte | 10 +- src/lib/ui/shared/popover/Menu.svelte | 2 +- src/routes/signup/+page.svelte | 111 +++++++++++------- src/routes/signup/[instance]/+page.svelte | 75 ++++++------ src/routes/theme/ThemePreset.svelte | 3 - 14 files changed, 222 insertions(+), 166 deletions(-) diff --git a/.github/README.md b/.github/README.md index 1f227cd6..5b754f4a 100644 --- a/.github/README.md +++ b/.github/README.md @@ -101,6 +101,8 @@ If you're hosting Photon for a Lemmy instance, you'll almost definitely want to - `PUBLIC_THEME` `JSON`: If you'd like, you can export a theme from Photon and paste it here, which will become the default theme for users. +- `RECOMMENDED_INSTANCES` `string`: (Only suitable for unlocked Photon instances) a comma separated list of instance domains that will be displayed as "recommended" on the sign-up page. + ##### Default Photon options Photon has extensive user configuration options, and you can set the defaults for them with the environment variables found at `src/lib/settings.ts`, by looking at the `defaultSettings` object. diff --git a/src/lib/app/auth/inbox.svelte.ts b/src/lib/app/auth/inbox.svelte.ts index 9eed0b3c..fe0dfac1 100644 --- a/src/lib/app/auth/inbox.svelte.ts +++ b/src/lib/app/auth/inbox.svelte.ts @@ -1,3 +1,4 @@ +import { PiefedClient } from '$lib/api/piefed/adapter' import type { Profile } from './profile.svelte' interface Notifications { @@ -56,24 +57,26 @@ export class InboxService { .then((res) => res.mentions + res.private_messages + res.replies) .catch(() => 0) - const reportsPromise = this.#profile.isMod() - ? this.#profile.client - .getReportCount({}) - .then( - (res) => - res.comment_reports + - res.post_reports + - (res.private_message_reports ?? 0), - ) - .catch(() => 0) - : Promise.resolve(0) + const reportsPromise = + !(this.#profile.client instanceof PiefedClient) && this.#profile.isMod() + ? this.#profile.client + .getReportCount({}) + .then( + (res) => + res.comment_reports + + res.post_reports + + (res.private_message_reports ?? 0), + ) + .catch(() => 0) + : Promise.resolve(0) - const applicationsPromise = this.#profile.isAdmin - ? this.#profile.client - .getUnreadRegistrationApplicationCount() - .then((res) => res.registration_applications) - .catch(() => 0) - : Promise.resolve(0) + const applicationsPromise = + !(this.#profile.client instanceof PiefedClient) && this.#profile.isAdmin + ? this.#profile.client + .getUnreadRegistrationApplicationCount() + .then((res) => res.registration_applications) + .catch(() => 0) + : Promise.resolve(0) const [unreads, reports, applications] = await Promise.all([ unreadsPromise, diff --git a/src/lib/app/i18n/en.json b/src/lib/app/i18n/en.json index 5ef2c16a..2db68d9d 100644 --- a/src/lib/app/i18n/en.json +++ b/src/lib/app/i18n/en.json @@ -194,9 +194,10 @@ "setup": "Setup", "signup": { "title": "Sign Up", - "description": "Choose a server that interests you, or type the URL manually.", - "info": "The server you choose is where your account will live. However, every server is connected, and you can still access almost all linked content.", + "description": "Choose the server your account's information will be hosted on.", + "info": "You can access all content across the Fediverse regardless of your account's server, it is generally okay to pick any of the following.", "chooseInstance": "Choose a server", + "recommended": "Recommended", "application": { "label": "Application", "info": "To join this server, you must fill out this application, and wait to be accepted. You will receive an email if your application is accepted.", @@ -696,7 +697,8 @@ "remove": "Remove", "download": "Download", "attach": "Attach file", - "info": "Info" + "info": "Info", + "continue": "Continue" }, "message": { "success": "Success", diff --git a/src/lib/app/render/VirtualList.svelte b/src/lib/app/render/VirtualList.svelte index 6dc78533..a4d91841 100644 --- a/src/lib/app/render/VirtualList.svelte +++ b/src/lib/app/render/VirtualList.svelte @@ -19,6 +19,7 @@ debounceResize?: number useWindow?: boolean height?: number + itemContainer?: string } let { @@ -31,6 +32,7 @@ debounceResize = 100, useWindow = true, height = 0, + itemContainer = 'div', ...rest }: Props = $props() @@ -235,13 +237,14 @@ 0}px; border: 0 !important;" > {#each visibleItems as item (item.index)} -