-
Notifications
You must be signed in to change notification settings - Fork 17
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 page to view specific entry comments #648
Conversation
change show nested to use current view setting
change cache lookup to be by comment id and not the root comment id
update template based on improvements made to others
add event listener to mark notifications as read when viewed
highlight comment the url is for
handle private content rename parent to comment to be more accurate
<style> | ||
#entry-comment-{{comment.id}} { | ||
border-top: var(--kbin-alert-danger-border); | ||
border-bottom: var(--kbin-alert-danger-border); | ||
border-right: var(--kbin-alert-danger-border); | ||
} | ||
</style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a bit hacky where; I can't modify the css in the nested comments (like adding highlighted
to the comment class list) as it's cached html, so instead this sets the css for the comment that is being viewed to style it differently. It could also be done via js but this doesn't seem that bad, but I could be wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a good reason to hold this up, speak now or forever hold your peace @asdfzdfj @BentiGorlich @melroy89
This creates a new view that is specifically for viewing an entry comment.
Problems attempting to be solved:
EntryCreateController
) requires#[IsGranted('ROLE_USER')]
The page loaded here shows an entire comment chain from root, including all its replies. It proved difficult to trim off comments from either direction as everything under a root is cached html so any changes would reflect how it's cached (there's more details of my issues collapsed at the bottom of the PR)
❌ only clear notifications related to comment, not entire entry (out of scope imo)
other theme examples
outline is less noticeable in light themes but the browser view still does jump down to the comment using url fragment so that helps (I'm manually scrolling up for screenshots)
challenges faced
Open issues:I've been stuck on one problem for a very long time:
I imagine people would prefer this to show replies in at least one direction if not both. Specifically, show comments that replied to this or the parent that it was replying to.
I was having a lot of trouble with that, and doing the always show timestamp PR helped me understand why, the replies to a top level entry are all pulled in via
entry_comments_nested
component which is heavily cached by the root parent id. If I tried to show the nested replies, instead it would duplicate the entire thread from top to bottom including the entry comment you were looking at...And if you tried to trim comments, if you loaded the comment view first and went to the full thread, those comments would be missing since it was cached together.
If you tried to change the cache key so everything was cached differently, there would still be oddities (level of comment chain for instance)
As commented, viewing an entry comment marks all notifications for that entry as viewed. This isn't different than how it's always been, but is more noticeable now that you might see less of the comments.
Fixes #406