From 7d84990f6dcb5b8556e050d7b20449d8578f2857 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 26 May 2026 16:01:14 -0400 Subject: [PATCH] =?UTF-8?q?feat(artist-view):=20ArtistView=20rewrite=20?= =?UTF-8?q?=E2=80=94=20sticky=20frosted=20ArtistHeader=20(name=20+=20stats?= =?UTF-8?q?=20+=20tabs)=20replaces=20the=20in-body=20h1;=20three=20lazy=20?= =?UTF-8?q?tabs=20(Posts=20default,=20Gallery=20fallback,=20Management);?= =?UTF-8?q?=20=3Ftab=3D=20URL=20state;=20cross-artist=20store=20reset;=20d?= =?UTF-8?q?ocument.title=20set=20on=20slug=20change?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.7 (1M context) --- frontend/src/stores/artist.js | 16 +- frontend/src/views/ArtistView.vue | 254 ++++++++---------------------- 2 files changed, 78 insertions(+), 192 deletions(-) diff --git a/frontend/src/stores/artist.js b/frontend/src/stores/artist.js index a8e250e..18dee7e 100644 --- a/frontend/src/stores/artist.js +++ b/frontend/src/stores/artist.js @@ -1,6 +1,7 @@ import { defineStore } from 'pinia' import { ref, computed } from 'vue' import { useApi } from '../composables/useApi.js' +import { usePostsStore } from './posts.js' const PAGE = 60 @@ -15,7 +16,11 @@ export const useArtistStore = defineStore('artist', () => { const notFound = ref(false) let started = false - async function load(slug) { + async function load (slug) { + // Cross-artist reset: clear this store AND the posts store so the new + // artist doesn't briefly render with the previous artist's content + // when the user is on the Posts tab. (Gallery tab uses this artist + // store's own images list — cleared above.) overview.value = null images.value = [] nextCursor.value = null @@ -23,6 +28,7 @@ export const useArtistStore = defineStore('artist', () => { started = false error.value = null loading.value = true + usePostsStore().$reset?.() try { overview.value = await api.get(`/api/artist/${encodeURIComponent(slug)}`) await loadMoreImages(slug) @@ -34,7 +40,7 @@ export const useArtistStore = defineStore('artist', () => { } } - async function loadMoreImages(slug) { + async function loadMoreImages (slug) { if (imagesLoading.value) return if (started && nextCursor.value === null) return imagesLoading.value = true @@ -55,9 +61,13 @@ export const useArtistStore = defineStore('artist', () => { } const hasMoreImages = computed(() => !started || nextCursor.value !== null) + const postCount = computed(() => overview.value?.post_count ?? null) + const imageCount = computed(() => overview.value?.image_count ?? null) + const lastAdded = computed(() => overview.value?.date_range?.max ?? null) return { overview, images, loading, imagesLoading, error, notFound, - hasMoreImages, load, loadMoreImages + hasMoreImages, postCount, imageCount, lastAdded, + load, loadMoreImages, } }) diff --git a/frontend/src/views/ArtistView.vue b/frontend/src/views/ArtistView.vue index 8750e70..76eca6b 100644 --- a/frontend/src/views/ArtistView.vue +++ b/frontend/src/views/ArtistView.vue @@ -1,220 +1,96 @@