Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Codidact Meta!

Codidact Meta is the meta-discussion site for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.

Answers order is changed when we access a specific answer by its direct link

+4
−0

Not sure if this is a bug, or status-by-design (for now, tagged as bug just in case)


When accessing an answer by its direct link, its order (relative to all other answers) is changed.

Example: if I go to this question, the answers are displayed by Score (I guess this is the default?), with highest scores first. If I click on the sort options ("Score" or "Active"), it all works well.

But if I access that post using a direct link to a specific answer, that answer is displayed before all the others, even though it has the lowest score. That happens even if I explicitly choose to sort the answers by Score: clicking on "Score", the link changes to this, and it still shows that specific answer (which has a lower score) before the others with higher scores.

That happens only if the link contains an answer ID. Summary:

  • Links to question: OK (answers displayed in correct order)
    • https://meta.codidact.com/posts/276161
    • https://meta.codidact.com/posts/276161?sort=score
  • Links to specific answer: Not OK (the specific answer is displayed before the other answers, although it has a lower score)
    • https://meta.codidact.com/posts/276161/276162#answer-276162
    • https://meta.codidact.com/posts/276161/276162?sort=score

Is it intentional that the display order of answers is changed like that when we access it by an answer's direct link?

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

2 answers

+3
−0

This is by design. Sometimes, for example for the Code Golf scoreboard, we need to have a direct link to the answers. Since on questions with many answers the answers are paginated and the order is calculated "on the fly", it's not possible to say beforehand, on which page an answer would be.

Therefore we added that helper URL which forces the answer to be shown without regards to the pagination; especially as that's easier to do than doing complex (and inefficient) calculations about the page the answer is likely to be on.

To reduce confusion, we have now added a notice above the answer when it is shown out of order, like this:

You are accessing this answer with a direct link, so it's being shown above all other answers regardless of its score. You can (return to the normal view (that's a link)).

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

2 comment threads

Does the notice make sense when there's only one answer? (1 comment)
Another benefit (1 comment)
+2
−0

I'm not sure how intentional it is, but it's a known change to fix a related bug. Until recently, if you followed a direct link to an answer that wasn't on the first page of the post, that action failed and you got redirected to the question instead. I'm not sure of all the details, but apparently doing the right thing -- jumping to that answer on page N of the question -- is hard. To make direct links useful, the solution was to move the target answer to the top and then jump to it. If there is a better way to solve this problem and link to the answer where it normally falls (without breaking existing URL routes), we're interested in learning about it. The discussion on the issue that led to this change might be useful context.

I hadn't noticed, though it makes sense now that you point it out, that this relocation happens in all cases, not just cases where there are multiple pages. I wonder if we can do this only where answer count is higher than the page limit. Determining what page an answer is on is hard, but detecting whether there are going to be multiple pages might be easier. (I should clarify that I have only a theoretical understanding of the code involved.)

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

0 comment threads

Sign up to answer this question »