Skip to content
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

Add multi-reply feature #2378

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

Add multi-reply feature #2378

wants to merge 43 commits into from

Conversation

redmvc
Copy link
Collaborator

@redmvc redmvc commented Jan 3, 2025

This feature allows the user to post multiple replies all at once, or to edit an existing reply and turn it into multiple replies in-place (to, effectively, "split" it).

image
image
image
image
image
image
image
image
image
image

@redmvc redmvc added type: enhancement design/ui type: new feature u. ready to review For PRs to allow filtering of WIP ruby Pull requests that update Ruby code labels Jan 3, 2025
Base automatically changed from fix/preview-select-characters to main January 3, 2025 04:40
app/controllers/replies_controller.rb Outdated Show resolved Hide resolved
app/controllers/replies_controller.rb Show resolved Hide resolved
app/controllers/replies_controller.rb Outdated Show resolved Hide resolved
app/controllers/replies_controller.rb Outdated Show resolved Hide resolved
app/controllers/replies_controller.rb Outdated Show resolved Hide resolved
# Posting a new multi reply, go back to unread
redirect_to post_path(params[:reply][:post_id], page: :unread, anchor: :unread)
end
return
Copy link

Choose a reason for hiding this comment

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

Avoid too many return statements within this method.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried reducing them as much as I could but I don't think I can do better than what I currently have.

@redmvc

This comment was marked as resolved.

app/controllers/replies_controller.rb Outdated Show resolved Hide resolved
app/controllers/replies_controller.rb Outdated Show resolved Hide resolved
app/controllers/replies_controller.rb Outdated Show resolved Hide resolved
app/controllers/replies_controller.rb Outdated Show resolved Hide resolved
return
elsif params[:button_discard_multi_reply]
flash[:success] = "Replies discarded."
if editing_multi_reply?
Copy link

Choose a reason for hiding this comment

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

Avoid deeply nested control flow statements.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My brother in Christ if you have a better suggestion I am all ears

app/controllers/replies_controller.rb Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design/ui ruby Pull requests that update Ruby code type: enhancement type: new feature u. ready to review For PRs to allow filtering of WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants