plebbit-js icon indicating copy to clipboard operation
plebbit-js copied to clipboard

implement comment.number

Open estebanabaroa opened this issue 1 year ago • 2 comments

it should be a value added by the sub owner, it should be the index of the comment + 1 (so it starts at 1). it should be optional but recommended.

this number should never be used an as comment id for the following reasons:

  • this number cant be validate by the client, the sub owner can put any value in comment.number, like it could put all duplicate numbers, and then the UI seems buggy and more difficult to use
  • the sub owner could put a wrong number to trick the user into think someone replied to the wrong person
  • it might not be compatible with some other uses cases, like an ownerless sub moderated by some token holders, has nobody with authority to decide comment.number
  • it wont match the URL of the comment like c/
  • it wont be compatible with in content links, like comment.content: "this is great c/"
  • users can say "checked" using cids, they form patterns and have duplicate charaters
  • the parentComment.number might load slowly, or never load, so the parent id would never be known, or display a janky loading indicator
  • we want comment cids to be a standard of the plebbit protocol. like bittorrent has standard infohash, everyone knows what it is in all clients
  • lottery based on comment.number should be done using flairs, as most UIs display flairs, but most don't display comment cids or numbers
  • cids shouldnt be converted to digits encoding because it causes too many digits, and if you shorten the digits, it becomes easy to bruteforce any id

we might want to call it comment.sequenceNumber as well.

we should probably wait until instant replies and p2p voting is implemented so that we dont use colliding props.

another option could be also to have comment.postNumber and comment.number to also count posts.

usecases:

  • when scrolling all posts pages sorted by new, or comment.previousCid, can know how many posts are left by looking at the number
  • can display the comment number in the UI, like imageboards do.

estebanabaroa avatar Feb 21 '25 19:02 estebanabaroa

after thinking about it I think the design should probably be comment.number?: number and comment?.postNumber: number. it should be enabled by default, but it should also be optional for subs that dont want to add it to posts.

it should start at 1. but also subs could decide to put some custom number there if they want. and UIs can experiment with displaying this arbitrary number or not.

estebanabaroa avatar Feb 26 '25 17:02 estebanabaroa

actually it should probably be part of the commentUpdate, otherwise pendingApproval comments will get counted even if they are unapproved. pendingApproval comments probably should not get a number until they are approved.

estebanabaroa avatar Nov 17 '25 22:11 estebanabaroa