Comments: hide avatars when the site turns them off

Aperta
#26,413 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
ios, swift
Ambito
frontend, mobile

Direzione di ricerca

Start with CommentAvatarView, CommentListItem, CommentDetail, and the detail header in the WordPressComments screens; the issue describes the draft’s proposed CommentAvatar value and its .hidden and .image(URL?) cases. Check how the avatar view handles a missing author_avatar_urls map versus a map without a 96px address. Done means no avatar is drawn when the map is missing, while the grey circle remains when the map exists without that address.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

[Type] Bug Comments

From Claude:

When a self-hosted site turns off Settings → Discussion → Show Avatars, the new comments screens show an empty grey circle for every commenter, where the site owner asked for no avatars at all.

What happens

WordPress leaves author_avatar_urls out of every comment in the REST API while "Show Avatars" is off. It only adds the field to the comments schema when the show_avatars option is on (class-wp-rest-comments-controller.php, get_item_schema()).

Until wordpress-rs 0.9.1, that made the whole comment response fail to parse, so those sites showed no comments. wordpress-rs trunk makes author_avatar_urls optional (Automattic/wordpress-rs#1664), and #26393 adopts it. Comments now load, but the avatar address is nil, and CommentAvatarView draws its placeholder: a plain grey circle.

Who is affected

Anyone viewing comments in the WordPressComments screens (comment list and comment detail) for a site with "Show Avatars" off.

Suggested fix

Treat a missing author_avatar_urls as "avatars are off" and draw no avatar, while keeping the grey circle when the map is there but has no 96px address (the site shows avatars, this author has none to show).

The missing map is a reliable signal. /wp/v2/settings doesn't expose show_avatars, so there's no other way to read the setting. The one exception is a request that uses _fields and leaves author_avatar_urls out; the app doesn't make one today.

A draft is on jkmassel/hide-comment-avatars-when-off, stacked on #26393: a CommentAvatar value (.hidden or .image(URL?)) replaces avatarURL in CommentListItem, CommentDetail and the detail header.

Not covered

The older UIKit comment screens fall back to a Gravatar looked up from the commenter's email when there's no avatar address, which also ignores the setting. That predates #26393 and isn't changed by the draft.

Lingua principale
Swift
Stelle
3.9k
Fork
1.2k
Merge medio
1g 23h
PR unite (30g)
136

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di wordpress-mobile/WordPress-iOS

Tutte le issue di wordpress-mobile/WordPress-iOS

Issue simili

Altre issue su Swift

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.