mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 02:59:07 +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). |
||
|---|---|---|
| .. | ||
| accepted_answer_cache.rb | ||
| accepted_answers_helper.rb | ||
| category_extension.rb | ||
| engine.rb | ||
| first_accepted_post_solution_validator.rb | ||
| guardian_extensions.rb | ||
| post_mover_extension.rb | ||
| post_serializer_extension.rb | ||
| queries.rb | ||
| register_filters.rb | ||
| schema_utils.rb | ||
| seed_admin_dashboard_reports.rb | ||
| topic_extension.rb | ||
| topic_posters_summary_extension.rb | ||
| topic_view_serializer_extension.rb | ||
| user_extension.rb | ||
| user_summary_extension.rb | ||
| web_hook_extension.rb | ||