AO3-4583 Fix redirect when creating top-level comment on work with multiple pages of comments#5653
Open
marcus8448 wants to merge 3 commits into
Open
AO3-4583 Fix redirect when creating top-level comment on work with multiple pages of comments#5653marcus8448 wants to merge 3 commits into
marcus8448 wants to merge 3 commits into
Conversation
brianjaustin
reviewed
Apr 9, 2026
Comment on lines
+428
to
+429
| view_full_work = params[:view_full_work] == "true" | ||
| parent = view_full_work || current_user&.preference&.view_full_works? ? @comment.ultimate_parent : @comment.parent |
Member
There was a problem hiding this comment.
Nitpick: since the second condition is also a case of view_full_work, I think it would make more sense to lift the current user check up into that variable.
Suggested change
| view_full_work = params[:view_full_work] == "true" | |
| parent = view_full_work || current_user&.preference&.view_full_works? ? @comment.ultimate_parent : @comment.parent | |
| view_full_work = params[:view_full_work] == "true" || current_user&.preference&.view_full_works? | |
| parent = view_full_work ? @comment.ultimate_parent : @comment.parent |
| And I should see "heyo" | ||
| And I should not see "hi!" | ||
|
|
||
| Scenario: Posting a top level comment on the middle chapter of a work, when there is more than one page of comments, |
Member
There was a problem hiding this comment.
There are 3 cases for top level comments. Shouldn't we also have at least a few cases for non-top-level ones too?
Contributor
|
This code overlaps with #5524 in a non-desirable way: The user should stay in chapter by chapter if they were in chapter by chapter, regardless of preference. That PR has other issues that I'll try to dig up from my memory to properly review (I gave up because it turned out more complicated than I had patience for at the time) but generally I think these PRs will need to work around each other |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
https://otwarchive.atlassian.net/browse/AO3-4583
Purpose
Fixes the comment creation redirect to point at the page of the comment you just created instead of the page of comments you were on.
Credit
marcus8448 (he/him)