Skip to content

Implement configurable vote limit to exclude screenshots after N votes - #65

Merged
IvoLeist merged 10 commits into
mainfrom
copilot/modify-screenshot-voting-logic
Jan 14, 2026
Merged

Implement configurable vote limit to exclude screenshots after N votes#65
IvoLeist merged 10 commits into
mainfrom
copilot/modify-screenshot-voting-logic

Conversation

Copilot AI commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

Screenshots should be removed from the voting queue once they reach a threshold number of votes across all users.

Changes

  • Voting logic (R/mod_voting.R): Added check in get_mutation() to skip screenshots where vote_count_total >= max_votes_per_screenshot. When all remaining screenshots exceed the limit, returns "done" state.

  • Configuration (config.yaml files): Added max_votes_per_screenshot: 3 parameter with fallback default. Applied to all three config files (default template, runtime, test).

  • Tests (test-voting-module.R): Added two tests covering partial skipping (some screenshots at limit) and complete skipping (all at limit). Tests set vote_count_total directly rather than relying on trigger behavior.

Implementation

# In get_mutation() loop checking unvoted screenshots:
max_votes <- cfg$max_votes_per_screenshot
if (is.null(max_votes)) max_votes <- 3

if (!is.null(df$vote_count_total) && 
    !is.na(df$vote_count_total) && 
    df$vote_count_total >= max_votes) {
  next  # Skip this screenshot
}

URL-based navigation (back button) unchanged—users can still review their previous votes regardless of current vote totals.

Original prompt

This section details on the original issue you should resolve

<issue_title>Modify number of times a screnshot is voted</issue_title>
<issue_description>Modify logic so that once a screenshot has been voted 3 times by any user, it is removed from the list of screenshots to be voted</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 7, 2026 14:42
Co-authored-by: IvoLeist <28399610+IvoLeist@users.noreply.github.com>
Co-authored-by: IvoLeist <28399610+IvoLeist@users.noreply.github.com>
Co-authored-by: IvoLeist <28399610+IvoLeist@users.noreply.github.com>
Copilot AI changed the title [WIP] Modify voting logic for screenshots removal Implement configurable vote limit to exclude screenshots after N votes Jan 7, 2026
Copilot AI requested a review from IvoLeist January 7, 2026 14:49
@IvoLeist
IvoLeist marked this pull request as ready for review January 14, 2026 16:59
@IvoLeist
IvoLeist merged commit 6cc7859 into main Jan 14, 2026
1 check passed
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.

Modify number of times a screnshot is voted

2 participants