Comments: hide avatars when the site turns them off

オープン
#26,413 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
ios, swift
領域
frontend, mobile

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

[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.

主要言語
Swift
スター
3.9k
フォーク
1.2k
平均マージ
1日 23時間
マージ済み PR(30日)
136

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

wordpress-mobile/WordPress-iOS のほかの issue

wordpress-mobile/WordPress-iOS の issue をすべて見る

似ている issue

Swift の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。