AO3-1173 We need a comment preview#5835
Conversation
|
thoughts (as a fellow contributor):
is there a reason it couldn't be sent as POST request params, like when you're previewing it? also i just checked how dreamwidth does it, and it actually has both the comment preview and the edit form on the preview page. that's maybe an even better alternative to jumping between different pages?
that would make total sense to do, you could call it
i don't see any any |
…in the git compare so im pushing
i also just noticed that the dreamwidth comment preview page also has a copy of whatever post or comment you're replying to... not sure if livejournal's previews that sarken mentioned are the same but i suppose you could also just use javascript by default to fetch the preview and insert it somewhere in or near the comment form, and only fall back to a separate page without it |
|
@slavalamp Hi! Thanks for the feedback. I'll definitely look into a preview that includes the comment one is replying to if one exists. I am also willing to workshop the actual design of the preview page. One thing to note, though, is that the request (and, from what I understand, AO3 in general) asked for JavaScript-based features to be avoided. If it didn't, I would have approached all of this completely differently. So, with that in mind, we are certainly more limited on what can be done. That being said, I think having the preview and the edit form on the same page makes sense. I was trying to imitate the work preview flow, but I think since comments are generally shorter, having them on the same page is more reasonable. I'll also start working on showing the parent comment alongside the preview comment; that's a great idea, and I think it should be possible to implement. I also mentioned creating a comment template for this and other features, but I think I decided to do that in a different PR, so this doesn't become too bloated a change. I'll also probably revert my |
|
@slavalamp |
|
ao3 avoids completely depending on javascript for features, but it does use it to make the experience nicer, e.g. js is used to load comments. there is also the limit on how often you can refresh pages... i'm not sure if it would apply to comment preview ones, but still i feel like it's worth adding js here - people commenting on fanfic often cross-reference stuff from the chapter content, so previews sending the user to a completely different page would mess with that unexpectedly frontend docs also say
(defer to sarken for a final judgement though) |
slavalamp
left a comment
There was a problem hiding this comment.
(not a full review, just design thoughts)
i've also noticed that attempting to preview a comment edit just posts it instead
otherwise the preview page looks cool!
| @@ -0,0 +1,114 @@ | |||
| <h2 class="heading"><%= t(".page_heading") %></h2> | |||
| <p><%= t(".commenting_on_html", commentable_link: link_to_comment_ultimate_parent(@comment)) %></p> | |||
There was a problem hiding this comment.
this link could be part of the h2 header, like on the /comments page
| edit_comment_heading: Edit Comment | ||
| hidden_comment: "(This comment is under review by an admin and is currently unavailable.)" | ||
| page_heading: Preview Comment | ||
| post_comment: Post Comment |
There was a problem hiding this comment.
inconsistent with the buttons on the comment form on other pages, this one is usually just "comment"
| } | ||
|
|
||
| p.submit, input.submit, dd.submit { | ||
| p.submit, input.submit, dd.submit, ul.actions.right { |
There was a problem hiding this comment.
still not sure what this is for?
| put :unhide | ||
| end | ||
| collection do | ||
| post :preview |
There was a problem hiding this comment.
also the preview page url isn't actually /preview right now, and it would be cool if it was, but i'm not sure what's a good way to achieve that
|
|
||
| <!--inline edit form--> | ||
| <div id="edit_comment_on_preview"> | ||
| <h3 class="heading"><%= t(".edit_comment_heading") %></h3> |
There was a problem hiding this comment.
this heading is potentially confusing because technically you're not editing a comment if it wasn't created yet, and probably unnecessary because it should be obvious it's a comment drafting form, though i'm saying that as someone very used to ao3's interface and therefore very biased
| #edit_comment_on_preview { | ||
| margin-top: 2.5em; | ||
| } |
There was a problem hiding this comment.
i also don't think this margin is needed since there aren't usually margins near the comment form, and the new ids don't seem to be necessary in general either?
Pull Request Checklist
as the first thing in your pull request title (e.g.
AO3-1234 Fix thing)until they are reviewed and merged before creating new pull requests.
Issue
https://otwarchive.atlassian.net/browse/AO3-1173
Purpose
EDIT: this description is out of date and will be rewritten once features and design are locked in
This change adds a JavaScript-free "comment preview" (similar to work previews) for the commenting system. It should display the parsed HTML in a similar template to how the comment would actually be displayed. It preserves the body/info of the comment, as well as the user info between pages, allowing a user to edit the details until it looks right.
I would like some feedback on a few things:
sessionStorageand its ilk are out of the question, and I'm not sure we want to implement any comment draft system on the backend.text-align: right. I hate how this rule looks, but I'm not sure if we have any better practices for the naming/style rule conventions I can take advantage of here.Testing Instructions
I will update the Jira ticket once this code looks close to being ready to merge; until then I want to wait until the flow is solidified and approved.
Credit
calm (they/them)