FreeTube icon indicating copy to clipboard operation
FreeTube copied to clipboard

Highlights comments. #783

Open ab-shrek opened this issue 2 years ago • 9 comments

Title

Highlights comments.

Pull Request Type

  • [ ] Bugfix
  • [x] Feature Implementation
  • [ ] Documentation
  • [ ] Other

Related issue

Fixes #783

Description

Adds functionality to highlight or unhighlight a comment or a comment reply. If the comment or reply timestamp is clicked, the highlight gets toggled to on or off. The highlighted comments move to the top and on unhighlight, they move back to the original position The highlighted replies move to the top and on unhighlight, they stay at the same position. The associated comment moves to the top if reply gets highlighted and back to original position once none of the replies are highlighted anymore.

Screenshots

Testing

Tested manually. Tested with different combinations of highlighted replies and comments and reloading the page at different instances and noticed how the UI and the db entries change- highlight c1 → highlight c1.r1 → highlight c1.r2 → unhighlight c1.r1 → unhighlights c1.r2 → unhighlight c1 highlight c1.r1 → highlight c1.r2 → highlights c1 → unhighlight c1.r1 → unhighlight c1.r2 → unhighlight c1 highlight c1.r1 → highlights c1 → highligh c1.r2 → unhighlight c1 → unhighlight c1.r1 → unhighlight c1.r2 highlight c1 -> highlight c2.r1 -> highlight c3 -> highlight c3.r1 c -> comment r -> reply

Desktop

  • OS:
  • OS Version:
  • FreeTube version:

Additional context

ab-shrek avatar Nov 02 '23 19:11 ab-shrek

Please provide some testcases in the testing section of the PR body

Think of testcases u used while testing this PR

Comment level

1st page

A1. Click unhighlighted to highlight + move to top = OK A2. Reload page & highlighted stay on top = OK A3. Click highlighted to unhighlight + move back = OK

2nd (or later) pages

A4. Click unhighlighted to highlight + move position = OK (present on top even 2nd+ page not loaded) A5. Reload page & highlighted stay on top = OK A6. Click highlighted to unhighlight + move back = OK (I guess it can only fall into bottom of 1st page when 2nd+ page not loaded)

Reply level

1st page

B1. Click unhighlighted to highlight + move position = OK B2. Reload page & highlighted stay on top = NOT OK (stay in original position) B3. Click highlighted to unhighlight + stay position = OK

2nd (or later) pages

B4. Click unhighlighted to highlight + move position = OK B5. Reload page & highlighted stay on top = NOT OK (or is this intended? Anyway it's different from comments) B6. Click highlighted to unhighlight + stay position = OK

B2. image

PikachuEXE avatar Nov 13 '23 01:11 PikachuEXE

@PikachuEXE the latest changes take care of the highlighted replies not showing up on top on a reload. I did a commit --amend on the earlier commit. Can you review the changes now; please? Thanks

ab-shrek avatar Nov 13 '23 16:11 ab-shrek

Please try to avoid commit --amend next time since it makes checkout later diff slightly more difficult Coz I (and maybe others) use gh pr checkout 4272 from the code button and it won't checkout if remote commits are amended image

(You are still free to do that before submitting PR to make commit history look better which I also do, but avoid it after PR opened)

PikachuEXE avatar Nov 14 '23 00:11 PikachuEXE

Re-tested B2 & B5 and they are now OK

PikachuEXE avatar Nov 14 '23 00:11 PikachuEXE

@PikachuEXE thanks for the effort. I did a git commit for the requested change this time :)

ab-shrek avatar Nov 14 '23 03:11 ab-shrek

The code still needs a lot of changes before this can be approved, also the UX issues with having to click the timestamp instead of a dedicated button and having to reload the page.

Yes I know this pull request is based off a YouTube feature that has horrible UX, but just because YouTube thinks horrible UX is a good idea, doesn't mean that said horrible UX has to be copied over to FreeTube.

absidue avatar Nov 14 '23 08:11 absidue

This PR is stale because it has been open 28 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Dec 21 '23 01:12 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Jan 03 '24 18:01 github-actions[bot]

This PR is stale because it has been open 28 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Feb 02 '24 01:02 github-actions[bot]

This PR was closed because it has been stalled for 14 days with no activity.

github-actions[bot] avatar Feb 20 '24 01:02 github-actions[bot]