Skip to content

FIX: Use SolvedTopics to list posts in /activity/solved instead of user actions #376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nattsw
Copy link
Contributor

@nattsw nattsw commented Jun 26, 2025

In #342 we moved solutions away from topic_custom_fields into proper tables, with the tables as the proper source of truth to a topic's solution.

The user's /my/activity/solved route uses user_actions which is not accurate, and a user has reported a bug where their solution is not reflected there (user actions are not a good representation of what a topic's solution is).

This PR introduces

  • a new route to get solutions, and is mindful hide_user_profiles_from_public and such settings
  • also mindful of PMs and private categories
  • a new template that makes use of the <UserStream> to load posts safely and avoid reimplementation

After fix:

desc 📸
Regular post list in /activity Screenshot 2025-06-26 at 5 34 18 PM
no solved (viewing another user) Screenshot 2025-06-26 at 5 34 23 PM
no solved (viewing self) Screenshot 2025-06-27 at 12 18 55 PM
one solved Screenshot 2025-06-26 at 5 41 07 PM
solved with private categories Screenshot 2025-06-27 at 12 19 55 PM
solved with hidden private categories Screenshot 2025-06-27 at 12 20 29 PM
solved with expanded post
Screen.Recording.2025-06-27.at.12.21.23.PM.mov
solved with pagination
Screen.Recording.2025-06-26.at.5.34.33.PM.mov

@nattsw nattsw marked this pull request as draft June 26, 2025 09:55
@nattsw nattsw marked this pull request as ready for review June 27, 2025 04:31
@body={{@controller.model.emptyState.body}}
/>
{{else}}
<UserStream @stream={{@controller.model.stream}} />
Copy link
Contributor

@tyb-talks tyb-talks Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SolvedPostsStream is being passed into UserStream, and I can see a couple of places (for e.g. https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/components/user-stream.gjs#L50) there which expect the stream to have a remove method. For this context, would those methods be called?

(from the vids, doesn't seem like there's available interactions that will result in removal of bookmarks/drafts, but thought it's worth clarifying).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah there isn't a need to remove a solution.

export default class UserActivitySolved extends UserActivityStreamRoute {
userActionType = 15;
noContentHelpKey = "solved.no_solutions";
class SolvedPostsStream extends EmberObject {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be an EmberObject? I think this could work as a lighter weight native class since we are already making use of @tracked to make this reactive and I didn't see anything in UserStream that relies onthe stream being an EmberObject.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants