0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-11 02:59:07 +08:00
discourse/plugins/discourse-solved/lib/discourse_solved
overgrow 8cb3e97e47
FIX: Show solved status on topic titles loaded directly (#41186)
### 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).
2026-06-25 15:28:24 +02:00
..
accepted_answer_cache.rb
accepted_answers_helper.rb FIX: Ensure 'accepted answers' can never include whispers (#40797) 2026-06-12 09:18:00 +01:00
category_extension.rb FEATURE: make shared issues optional per-category (#40501) 2026-06-04 11:58:28 -04:00
engine.rb
first_accepted_post_solution_validator.rb DEV: Allow multiple solutions in solved plugin (#39806) 2026-05-28 07:12:28 -05:00
guardian_extensions.rb FEATURE: make shared issues optional per-category (#40501) 2026-06-04 11:58:28 -04:00
post_mover_extension.rb DEV: Allow multiple solutions in solved plugin (#39806) 2026-05-28 07:12:28 -05:00
post_serializer_extension.rb
queries.rb DEV: Allow multiple solutions in solved plugin (#39806) 2026-05-28 07:12:28 -05:00
register_filters.rb DEV: Hand-pick Rails/WhereNot autofixes (#35117) 2025-10-03 13:29:22 +02:00
schema_utils.rb FIX: prevent empty QA Page schema in Solved (#40471) 2026-06-02 22:43:49 +08:00
seed_admin_dashboard_reports.rb DEV: Scaffold backend for the new admin dashboard Reports section (#40017) 2026-05-20 09:53:26 +03:00
topic_extension.rb DEV: Allow multiple solutions in solved plugin (#39806) 2026-05-28 07:12:28 -05:00
topic_posters_summary_extension.rb DEV: Allow multiple solutions in solved plugin (#39806) 2026-05-28 07:12:28 -05:00
topic_view_serializer_extension.rb FIX: Show solved status on topic titles loaded directly (#41186) 2026-06-25 15:28:24 +02:00
user_extension.rb FEATURE: add solved me too button (#39652) 2026-05-13 17:03:25 +04:00
user_summary_extension.rb DEV: refactor user card/summary accepted answer's query (#35500) 2025-10-31 08:49:36 +01:00
web_hook_extension.rb