feat(artist): editable display name + rename surface; drop name-uniqueness (#130 step 1)
First step of decoupling artist identity/storage/display. migration 0077 drops uq_artist_name so the display name is free text (two genuinely different creators can share a name); the slug stays the immutable, unique storage/identity key (the on-disk path component — untouched, so nothing moves). ArtistService.rename + PATCH /api/artists/<id> change the name ONLY. Frontend: inline pencil-edit on the artist header (mirrors TagCard), slug/route unaffected so no navigation. Fixes the operator's 'no surface to rename an artist' + the name-collision fragility. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CDgx8bQS5YrGRK76v8HUnM
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
:image-count="store.imageCount"
|
||||
:post-count="store.postCount"
|
||||
:last-added="store.lastAdded"
|
||||
@rename="onRename"
|
||||
/>
|
||||
<v-container fluid class="pt-2 pb-4">
|
||||
<!-- "N new since last visit" banner. Visible only on the initial
|
||||
@@ -59,6 +60,7 @@ import { computed, ref, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
|
||||
import { useArtistStore } from '../stores/artist.js'
|
||||
import { toast } from '../utils/toast.js'
|
||||
import ArtistHeader from '../components/artist/ArtistHeader.vue'
|
||||
import ArtistPostsTab from '../components/artist/ArtistPostsTab.vue'
|
||||
import ArtistGalleryTab from '../components/artist/ArtistGalleryTab.vue'
|
||||
@@ -76,6 +78,17 @@ const { tab, resolve } = useTabQuery(
|
||||
() => ((store.postCount ?? 0) > 0 ? 'posts' : 'gallery'),
|
||||
)
|
||||
|
||||
// Rename the artist's display name (#130). Slug/route unchanged, so no
|
||||
// navigation — the header just reflects the new name; also refresh the tab title.
|
||||
async function onRename (name) {
|
||||
try {
|
||||
await store.rename(name)
|
||||
document.title = `${store.overview.name} — FabledCurator`
|
||||
} catch (e) {
|
||||
toast({ text: `Rename failed: ${e.message}`, type: 'error' })
|
||||
}
|
||||
}
|
||||
|
||||
// One-shot banner — reset on each new artist-slug load so it re-appears
|
||||
// when navigating between artists that each have unseen content.
|
||||
const unseenBanner = ref(false)
|
||||
|
||||
Reference in New Issue
Block a user