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 page to view specific entry comments #648

Merged
merged 27 commits into from
Apr 27, 2024
Merged

Add page to view specific entry comments #648

merged 27 commits into from
Apr 27, 2024

Conversation

e-five256
Copy link
Member

@e-five256 e-five256 commented Mar 31, 2024

This creates a new view that is specifically for viewing an entry comment.

Problems attempting to be solved:

  • Viewing an entry comment right now requires a login
    • This is because the page that it loads (EntryCreateController) requires #[IsGranted('ROLE_USER')]
  • Go to entry comment does not work with pagination
    • For notifications / modlog / reports, the url generated is just the entry url with a url fragment of the entry comment. If the entry comment is not on the first page, it does not work
    • This doesn't technically fix that problem so much as the aforementioned areas now link specifically to a view of that specific comment

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)


  • viewing specific comments no longer requires login
  • notification / modlog / report link the specific comment rather than overall thread
  • show parent / replies in view
  • ensure AP for entry / entry comment views is unaffected

❌ only clear notifications related to comment, not entire entry (out of scope imo)


image

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)

theme
dark image
light image
solarized light image
solarized dark image
notifications clicking link loads...
image image
report panel clicking link loads...
image image
mod log clicking link loads...
image image

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

@e-five256 e-five256 added the enhancement New feature or request label Mar 31, 2024
highlight comment the url is for
handle private content
rename parent to comment to be more accurate
@e-five256 e-five256 self-assigned this Apr 6, 2024
@e-five256 e-five256 marked this pull request as ready for review April 7, 2024 22:59
Comment on lines +16 to +22
<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>
Copy link
Member Author

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

@e-five256 e-five256 added this to the v1.6.0 milestone Apr 8, 2024
Copy link
Member

@nobodyatroot nobodyatroot left a 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

@e-five256 e-five256 merged commit 602d4b1 into main Apr 27, 2024
7 checks passed
@e-five256 e-five256 deleted the e5/comment-view branch April 27, 2024 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

go to comment doesn't work / Notification link is unaware of pagination
2 participants