mirror of
https://github.com/discourse/discourse.git
synced 2026-08-07 13:19:19 +08:00
### What & why The solved status checkmark next to a topic **title** renders inconsistently: it shows when you reach a solved topic from a topic list, but is **missing on a direct load / hard refresh** of the same topic (the accepted-answer accordion is unaffected). The `after-topic-status` connector gates the title tick on `topic.has_accepted_answer || topic.accepted_answer`. `has_accepted_answer` is added (via `TopicAnswerMixin`) only to the topic **list** serializers, **not** `TopicViewSerializer`, which serializes only `accepted_answers` (plural, for the accordion). So on a direct topic load neither flag is present and the connector renders nothing — the tick only appears when the topic was reached from a list (whose serializer carries the flag on the cached record). ### Fix Expose `has_accepted_answer` on `TopicViewSerializer` too (mirroring the mixin), so the title indicator is consistent regardless of navigation path. No front-end change. ### Tests Adds `#has_accepted_answer` specs to `topic_view_serializer_spec.rb` (true when solved, false when not, omitted when `solved_enabled` is off). |
||
|---|---|---|
| .. | ||
| discourse_solved | ||
| topic_answer_mixin_spec.rb | ||
| topic_view_serializer_spec.rb | ||
| user_card_serializer_spec.rb | ||
| user_summary_serializer_spec.rb | ||