Skip to content

Feature: add the ability to filter members in the SOG nametrainer#1071

Merged
lodewiges merged 4 commits intostagingfrom
feature/filter-sog
Feb 8, 2026
Merged

Feature: add the ability to filter members in the SOG nametrainer#1071
lodewiges merged 4 commits intostagingfrom
feature/filter-sog

Conversation

@lodewiges
Copy link
Contributor

@lodewiges lodewiges commented Feb 8, 2026

This PR introduces the ability to filter for former members when using the nametrainer.
This fixes #872

image

Summary by CodeRabbit

  • New Features
    • Added a toggle in the Namen leren (Name Trainer) UI allowing users to include or exclude former members from the training list. Checking the box expands the pool of names used during training; unchecking limits it to current members.

Copilot AI review requested due to automatic review settings February 8, 2026 16:46
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

📝 Walkthrough

Walkthrough

Adds a checkbox UI toggle and a tracked showFormerMembers property; when disabled the controller filters fetched memberships to only include currently active members before mapping to users.

Changes

Cohort / File(s) Summary
Controller & Template
app/controllers/sog/name-trainer.js, app/templates/sog/name-trainer.hbs
Added a tracked showFormerMembers property. Controller's getUsers() fetches memberships into a mutable variable and, when showFormerMembers is false, filters memberships by userIsCurrentlyMember === true before mapping to users. Template adds a checkbox (id="show-former-members-check", class form-check-input) bound to this.showFormerMembers labeled "Ook oudleden trainen".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A checklist twitch, a whisker twitch more,
I hop through names upon the floor.
Toggle shows the old or only the new,
Rabbity rhythm, quick and true —
Training hops with clarity and cheer. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a filter feature to include/exclude former members in the SOG nametrainer application.
Description check ✅ Passed The description provides a clear summary of changes, references the fixed issue (#872), and includes a screenshot showing the new UI element (checkbox for showing former members).
Linked Issues check ✅ Passed The code changes directly address issue #872 by adding a showFormerMembers filter that prevents former members from appearing unless explicitly included via the new checkbox.
Out of Scope Changes check ✅ Passed All changes are directly related to the stated objective: adding a filter control for former members in the nametrainer, with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/filter-sog

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a UI toggle to include/exclude former members in the SOG name trainer, so the trainer can focus on current members by default while still allowing training on old members when desired.

Changes:

  • Add a “Toon oudleden” checkbox to the name trainer settings screen.
  • Add controller state (showFormerMembers) and apply membership filtering logic when loading users for the trainer.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
app/templates/sog/name-trainer.hbs Adds checkbox UI to control whether former members are included.
app/controllers/sog/name-trainer.js Tracks the new flag and filters memberships before building the trainer user list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 13.01%. Comparing base (e5dc0bd) to head (1cc6c8d).
⚠️ Report is 1 commits behind head on staging.

Files with missing lines Patch % Lines
app/controllers/sog/name-trainer.js 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #1071      +/-   ##
===========================================
- Coverage    13.02%   13.01%   -0.02%     
===========================================
  Files          450      450              
  Lines         3124     3127       +3     
===========================================
  Hits           407      407              
- Misses        2717     2720       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

lodewiges and others added 2 commits February 8, 2026 17:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 83 to 95
async getUsers() {
const group = await this.group;
if (!group) {
return [];
}
const memberships = await group.get('memberships');
let memberships = await group.get('memberships');

if (!this.showFormerMembers) {
memberships = memberships.filterBy('userIsCurrentlyMember', true);
}

return await Promise.all(memberships.mapBy('user'));
}
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new former-member filtering behavior in getUsers() isn’t covered by tests. Given there are existing unit tests for controllers/routes in this repo, please add a test that verifies getUsers() returns only current members by default and includes former members when showFormerMembers is enabled (and that the returned list contains the associated user records).

Copilot uses AI. Check for mistakes.
@lodewiges lodewiges added this pull request to the merge queue Feb 8, 2026
Merged via the queue into staging with commit bd515d5 Feb 8, 2026
10 of 12 checks passed
@lodewiges lodewiges deleted the feature/filter-sog branch February 8, 2026 20:22
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.

during SOG oudleden show up

2 participants