codidact / qpixel

Q&A-based community knowledge-sharing software
https://codidact.com
GNU Affero General Public License v3.0
393 stars 68 forks source link

Link associated with a deleted username, in a comment thread, redirects to the top of the current page. #1089

Open zetyty opened 1 year ago

zetyty commented 1 year ago

Describe the bug See Meta post: https://meta.codidact.com/posts/288749 The name of a deleted user in a comment thread appears with a clickable link. This link redirect to the top of the current page (tested in "main" view and in comment thread view). Also occurs in search results.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://meta.codidact.com/posts/282342/282380#answer-282380
  2. Open the first comment thread entitled "Feature for creator of thread"
  3. Click on the first author name, i.e. "deleted user".
  4. See error, i.e. redirection to the top of the page

Expected behavior I don't know, the link could just be removed because the user was deleted or it could redirect to a dedicated page about general information regarding user account management or something...

trichoplax commented 1 year ago

When someone works on this, it's worth also checking the behaviour of the deleted user name below one of the deleted user's posts (for example, a question or answer).

cellio commented 1 year ago

Ideally (in my opinion), deleted users in both comments and posts would be links for people who can see deleted profile pages (i.e. moderators and admins) and, for people who can't see those profiles, would either not be links at all or would link to a relevant help topic.

ws909 commented 1 year ago

This issue is also present on search result pages; for example: https://meta.codidact.com/posts/search?search=5+tag+limit#

by deleted user

cellio commented 8 months ago

Also post lists: https://meta.codidact.com/posts/290947

ws909 commented 8 months ago

I haven't looked at the source code, but it would really surprise me if this wasn't an intentional decision. It seems to be that anywhere a link to a deleted user is presented in the UI, it's replaced with a link to the current page itself. Something is responsible for that, and it's probably the same piece of code generating all of these.

cellio commented 8 months ago

I don't think we want the mostly-no-op link, though; if there's no user page to link to, we should show the text without making it a link. (Small tweak: moderators can see deleted profiles, so this should be behind a check for mod status.)

ws909 commented 8 months ago

I don't think we want the mostly-no-op link, though; if there's no user page to link to, we should show the text without making it a link. (Small tweak: moderators can see deleted profiles, so this should be behind a check for mod status.)

There are other options: