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

Story voting #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Story voting #5

wants to merge 1 commit into from

Conversation

mattddean
Copy link

@mattddean mattddean commented Jan 24, 2024

  • Votes table to track who voted for what and to prevent double-votes
  • Authentication required to vote
  • Cannot downvote own story
  • Karma incremented/decremented on vote creation/deletion

Decisions:

  • Story points could be inferred/generated from votes, but leaving the points column in place for now since stories begin with one point and ai-generated stories do not have a user. An alternative is to remove the points column, create a view on stories and votes to keep a votes tally, start every story at 0, and add 1 to the value in application code on retrieval to account for the implicit self-upvote on each story. But for now, this seems overly-complex compared to just maintaining the points separately. And transactions will help once supported.
  • We could do something similar with user karma, but again, it's overly complex and doesn't leave much room for abuse adjustments.
  • A vote is created on story creation to leave room for the above ideas in the future, and to allow a single check to prevent both upvoting your own story and upvoting a story twice.
  • Balanced immediate click feedback with avoiding larger client component scope by removing the vote/downvote buttons on click, but allowing revalidatePath to update the rest of the story entry:
Screen.Recording.2024-01-24.at.5.12.02.AM.mov

Copy link

vercel bot commented Jan 24, 2024

@mattddean is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@mattddean mattddean mentioned this pull request Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant