Commit graph

28 commits

Author SHA1 Message Date
zeppi e7572312a8 comment react selectors 2021-12-03 15:22:32 -05:00
zeppi ee9f63a161 integrate all the things
bugfix

wip

flow

fix

cleaning

clean
2021-10-15 23:49:41 -04:00
infinite-persistence de6c6f9bfd
List own comments (#7171)
* Add option to pass in url-search params.

Impetus: allow linked comment ID and setting the discussion tab when clicking on the `ClaimPreview`.

* comment.list: fix typos and renamed variables

- Switch from 'author' to 'creator' to disambiguate between comment author and content author. For comment author, we'll use 'commenter' from now on.
- Corrected 'commenterClaimId' to 'creatorClaimId' (just a typo, no functional change).

* doCommentReset: change param from uri to claimId

This reduces one lookup as clients will always have the claimID ready, but might not have the full URI.

It was using URI previously just to match the other APIs.

* Add doCommentListOwn -- command to fetch own comments

Since the redux slice is set up based on content or channel ID (for Channel Discussion page), re-use the channel ID for the case of "own comments". We always clear each ID when fetching page-0, so no worries of conflict when actually browsing the Channel Discussion page.

* Comment: add option to hide the actions section

* Implement own-comments page

* Use new param to remove sort-pins-first.

comment.List currently always pushes pins to the top to support pagination. This new param removes this behavior.
2021-10-01 08:10:27 -04:00
infinite-persistence c71b90cecf
Fix linked-comment scrolling
I think this the best solution so far, at the expense of a slight delay in scrolling if the network call stalls.

- Added "fetching by ID" state so that we don't need to use the ugly N-retries method.
- `scrollIntoView` doesn't work if the element is already in the viewport, and the `scrollBy` adjustment doesn't take into account the y-position restoration that we perform on certain type of pages. Use `window.scrollTo` instead and taking into account current scroll position.
2021-10-01 15:51:05 +08:00
infinite-persistence 0c1554e453
Blocklist Page: show the timeout ban duration
- 'humanize-duration' is used because 'moment''s humanizer sucks.
2021-09-03 07:17:57 +08:00
infinite-persistence 663376e970
Block timeout was changed from "hours" to "seconds" in Commentron 2021-09-03 07:17:57 +08:00
infinite-persistence a05ccdd44f
Comment Moderation - time based bans
## Issue
6712 Comment Moderation - time based bans

## Approach
- Consolidated the 3 types of blocking buttons in the comment content menu (i.e. Block, Moderator Block, Admin Block) into 1 regular Block button.
- Show a modal when Block is clicked.
    - Let user choose the blocklist.
    - Let user choose the timeout duration (this PR's impetus).
2021-09-03 07:17:56 +08:00
infinite-persistence 74986a8b3a
Comments: simplify blocked replies display
Previously, we decide when to display "Show More" based on the current fetched reply count vs. total replies in Commentron. It was already troublesome as `comment.List` and `comment.replies` give different values (one includes blocked content, while another does not).

Now, we are further filtering the list with Commentron blocklists (personal, admin, moderator), so it is not feasible to run the logic based on reply count.

## Solution
- Keep track of number of remaining pages instead and use that to determine when to display "Show More".
  - While it doesn't solve the "Show N replies" mismatch (YT has this problem too), it prevents the button from lingering.
- In the event that all replies are blocked, just show an empty space (same as YT). I didn't like the previous version that cluttered the space with "comment(s) blocked".
2021-08-24 16:55:36 +08:00
infinite-persistence 1421a39518
Comment badge to reflect mod and admin status.
## Issue
6467 Add status indicators for messages from creator, delegated moderator, global moderator

## Changes
- Added the required icons.
- Added tooltip.

## Notes
- Left out "creator" since we are already highlighting the creator's name.
- Note that currently the status is only available via websocket deltas. `comment.List` does not provide the data.
- When `comment.List` includes the info, regular comments will automatically include these badges.
2021-08-16 10:08:56 +08:00
infinite-persistence e9a2f44899
Commentron: incorporate 'setting.Get' into 'doFetchCreatorSettings'
## General
- `setting.List`: returns full creator settings. Requires signature (i.e. you own the channel)
- `setting.Get`: returns a public subset of the creator settings. No signature required, and it is mainly used by the GUI to determine the constraints of a channel (e.g. comments enabled? min tip requirements? etc.). Does not include private settings like "blocked words list".

`doFetchCreatorSettings` will handle both of these. Clients that uses the stashed results (`settingsByChannelId`) just needs to be aware the result might not contain everything, depending on whether you own the channel or not.

## Misc Related Changes
- Finally fix the reducer for COMMENT_FETCH_SETTINGS_COMPLETED to not purge the data on each call.
- Change `doFetchCreatorSettings` to operate on a single channel instead of multiple. We ended up not using the multple mode anyway, so it was wasteful code trying to batch the promises.
- `commentsDisabledChannelIds` is no longer needed. Previously, this was created just to differentiate between Creator (full) and Channel (subset) settings. It's cleaner to just use one object, so eliminated this.
- Remove unused 'commentingEnabled'.

## Aside
- There are now 2 ways to know if a channel has disabled comments: (1) from `comment.list` and `setting.Get|List`. Both of them updates `settingsByChannelId`, so it'll still be a single place for the GUI to check against.
2021-08-12 14:51:41 +08:00
infinite-persistence 4731786a3f
Livestream: implement Pinned Comments 2021-08-12 10:39:21 +08:00
zeppi 27aa4e4a22 lint 2021-07-17 13:19:33 -04:00
infinite-persistence cb0222981c Reactions: switch from SDK to Commentron
## Issue
- Closes 6481 "Use Commentron for react.List, react.React calls".
- 5459 "Interact directly with commenting servers".
2021-07-16 13:41:41 -04:00
infinite-persistence 08c701ba19 Restore comment pagination
This reverts commit e6addb8c2a, reversing
changes made to 47b594107a.
2021-07-16 10:54:12 -04:00
infinite-persistence a2a1ddb403
Revert "Comments Pagination #6390"
This reverts commit 16ef013025, reversing
changes made to fba8b89b3b.
2021-07-15 22:23:26 +08:00
infinite-persistence f8bdd0704f
Handle temporary Commentron bugs
Can be removed when bugs are fixed, but would still work if left there.
2021-07-14 12:58:27 +08:00
infinite-persistence 0cf6fe3df5
Comments Pagination
## Issue
6158 - Support Comment Pagination
2021-07-14 12:58:25 +08:00
infinite-persistence b4b45ffbdc Commentron Moderation Delegation API 2021-06-18 15:46:51 -04:00
infinite-persistence d6ac2c7954 Comments: enable 'enable_comments' flag
## Issue
Closes 6159 "Support Comments Enabled/Disabled for comment.List API"

## New behavior
- `disable-comments` tag will block the comments component entirely.
- `settings.commentsEnabled`:
  - When false, will pause comment fetching, posting and replying.
  - Any already-fetched comments will stay on screen (unless user reloads/F5).
2021-06-18 15:46:51 -04:00
infinite-persistence 54b17ee739 Commentron Settings API 2021-05-26 15:38:29 -04:00
Sean Yesmunt 6d89f0df7e hyperchats 2021-04-23 16:20:17 -04:00
Sean Yesmunt ea74a66dbd
New moderation tools: block & mute (#5572)
* initial support for block/mute

* hide blocked + muted content everywhere

* add info message for blocked/muted characteristics

* sort blocked list by most recent block first

* add 'blocked' message on channel page for channels that you have blocked

* cleanup

* delete unused files

* always pass mute/block list to claim_search on homepage

* PR cleanup
2021-03-03 13:50:16 -05:00
Sean Yesmunt 761b93d811 add style for comments with is_pinned=true 2020-10-08 11:48:32 -04:00
Sean Yesmunt 5d2d6d2a94 always show your own comments at the top 2020-10-07 17:11:22 -04:00
jessop e954bce821 allow reaction list without channel
uncomment

reacts requireauth, commentReact handles missing channels

enable config, better track pending reacts
2020-10-01 15:23:15 -04:00
jessop ad88f7de7f disable while reacting, dont call api twice 2020-09-29 17:12:32 -04:00
jessop 63ce107cc1 comment reactions 2020-09-29 17:12:32 -04:00
Sean Yesmunt 248e578422 new comments 2020-09-29 17:12:32 -04:00