From 500ad59458ba097c192749a3c907354cf4f81c1c Mon Sep 17 00:00:00 2001 From: Florian Sylvain Date: Mon, 19 Oct 2026 00:46:16 +0200 Subject: [PATCH] fix: authors profile pictute all accross the SPA --- features/sites_authors_screens.feature | 1 + features/sites_authors_screens.qa.md | 1 + web/src/components/AuthorAvatar.vue | 6 +- web/src/components/AuthorFormPanel.vue | 6 +- web/src/components/AuthorList.vue | 6 +- web/src/components/AuthorSelect.vue | 8 +- web/src/components/AuthorStack.vue | 1 + web/src/components/AuthorViewPanel.vue | 2 +- web/src/components/MediaField.vue | 25 ++++-- web/src/components/MetaSection.vue | 2 +- web/src/components/ReassignDialog.vue | 8 +- .../components/__tests__/MediaField.spec.ts | 32 ++++++++ .../__tests__/useAvatarImage.spec.ts | 78 +++++++++++++++++++ web/src/composables/useAvatarImage.ts | 38 +++++++++ web/src/lib/articleMeta.ts | 2 +- web/src/lib/articleTypes.ts | 1 + web/src/views/AuthorsView.vue | 5 +- web/src/views/__tests__/AuthorsView.spec.ts | 34 ++++++++ .../views/__tests__/EditorAuthorList.spec.ts | 25 ++++++ 19 files changed, 265 insertions(+), 16 deletions(-) create mode 100644 web/src/composables/__tests__/useAvatarImage.spec.ts create mode 100644 web/src/composables/useAvatarImage.ts diff --git a/features/sites_authors_screens.feature b/features/sites_authors_screens.feature index 874eaf5..3fe26e1 100644 --- a/features/sites_authors_screens.feature +++ b/features/sites_authors_screens.feature @@ -514,6 +514,7 @@ Feature: Sites and Authors screens and "Shown as a square. Choose an image with the face or logo near the middle." and "Use image" When the user picks an image and activates "Use image" Then the avatar shows as a square and avatar_id is sent on save + And once saved, the avatar is the picked image in the list row, the read-only detail, the edit form and its byline preview, resolved with GET /v1/media/{avatar_id} and shared between all of them, with the initials only while it loads, when it fails or when avatar_id is null And the Sites default social image uses this same picker and sends default_social_image_id Scenario Outline: Authors form: save failed diff --git a/features/sites_authors_screens.qa.md b/features/sites_authors_screens.qa.md index 0642ce2..284ae17 100644 --- a/features/sites_authors_screens.qa.md +++ b/features/sites_authors_screens.qa.md @@ -87,6 +87,7 @@ Authors: form (11): - [ ] Linked user: choose - [ ] Edit: linked author - [ ] Avatar: picker +- [ ] Avatar: saved image shows in the list, the detail, the reopened form and the preview (not only the initials) - [ ] Save failed - [ ] Unlink: confirm - [ ] Re-link diff --git a/web/src/components/AuthorAvatar.vue b/web/src/components/AuthorAvatar.vue index 23fdd9a..939849a 100644 --- a/web/src/components/AuthorAvatar.vue +++ b/web/src/components/AuthorAvatar.vue @@ -1,5 +1,6 @@