From c510c2a138b19f6c9dd16f1ef227b679da3a91fc Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Thu, 19 Mar 2026 20:37:12 -0400 Subject: [PATCH] feat(frontend): add genre display UI and enhance link component - Anime.svelte: Add genre display section with clickable badges that link to AniList search results for each genre. Genres are now displayed above the existing tags section with consistent styling. - WebsiteLink.svelte: Enhance component to support custom URLs via the `url` export parameter. Previously, the component only generated URLs based on service prefixes (a-, m-, s-). Now it accepts a direct URL parameter for flexible linking to AniList searches and other external resources. These changes provide users with an improved browsing experience by making genres interactive and easily searchable. --- frontend/src/helperComponents/Anime.svelte | 28 +++++++++--- .../src/helperComponents/WebsiteLink.svelte | 44 ++++++++++--------- 2 files changed, 47 insertions(+), 25 deletions(-) diff --git a/frontend/src/helperComponents/Anime.svelte b/frontend/src/helperComponents/Anime.svelte index 44523fb..44cb7c8 100644 --- a/frontend/src/helperComponents/Anime.svelte +++ b/frontend/src/helperComponents/Anime.svelte @@ -8,6 +8,7 @@ simklLoggedIn, } from "../helperModules/GlobalVariablesAndHelperFunctions.svelte"; import { push } from "svelte-spa-router"; + import WebsiteLink from "./WebsiteLink.svelte"; import type { AniListGetSingleAnime } from "../anilist/types/AniListCurrentUserWatchListType"; import Rating from "./Rating.svelte"; import { @@ -41,7 +42,7 @@ import { AddAnimeServiceToTable } from "../helperModules/AddAnimeServiceToTable.svelte"; import { CheckIfAniListLoggedInAndLoadWatchList } from "../helperModules/CheckIfAniListLoggedInAndLoadWatchList.svelte"; import Datepicker from "./Datepicker.svelte"; - import {Badge, Tooltip} from "flowbite-svelte"; + import { Badge, Tooltip } from "flowbite-svelte"; const re = /^([0-9]{4})-([0-9]{2})-([0-9]{2})/; let isAniListLoggedIn: boolean; @@ -827,15 +828,32 @@
+

Genres

+ {#each currentAniListAnime.data.MediaList.media.genres as genre} +
+ +
+ +
+
+ {genre} +
+ {/each}

Tags

{#each currentAniListAnime.data.MediaList.media.tags as tag}
-
- {tag.name} - - {tag.rank}% -
+
+ + ({tag.rank}%) +
{tag.description}
diff --git a/frontend/src/helperComponents/WebsiteLink.svelte b/frontend/src/helperComponents/WebsiteLink.svelte index 4d21d50..0ceb3f8 100644 --- a/frontend/src/helperComponents/WebsiteLink.svelte +++ b/frontend/src/helperComponents/WebsiteLink.svelte @@ -1,28 +1,32 @@ {#if url.length > 0} - + {:else} - {id} + {id} {/if}