Skip to content

Guard manual Add Member flow at max member cap#156

Merged
Sendi0011 merged 1 commit into
JointSave-org:mainfrom
Stella112:fix/manual-add-member-cap
Jun 28, 2026
Merged

Guard manual Add Member flow at max member cap#156
Sendi0011 merged 1 commit into
JointSave-org:mainfrom
Stella112:fix/manual-add-member-cap

Conversation

@Stella112

Copy link
Copy Markdown

Closes #144

Description

Adds a shared MAX_POOL_MEMBERS constant and uses it across the CSV bulk importer plus all three manual member entry forms.

Manual Add Member buttons now stop at the same 50-member cap as CSV import, disable when the cap is reached, and show a clear "Maximum of 50 members reached" message.

The CSV path now also caps the accepted members passed into parent form state to the shared limit.

Type of Change

  • feat: new feature
  • fix: bug fix
  • chore: maintenance, tooling, dependencies
  • docs: documentation only
  • refactor: code restructuring (no functional changes)
  • test: adding or updating tests

How Has This Been Tested?

  • git diff --check
  • next build with placeholder env values from frontend/.env.example
  • pnpm lint passes (frontend)

pnpm lint is blocked by the existing Next 16 tooling issue where next lint is treated as a project directory.

Checklist

  • My code follows the coding conventions of this project
  • I have added/updated tests if needed
  • I have updated documentation if needed
  • My changes generate no new warnings or errors

Screenshots (if applicable)

N/A

@Sendi0011 Sendi0011 self-requested a review June 28, 2026 15:29

@Sendi0011 Sendi0011 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Stella112 Really nice work here — especially catching that BulkImport.tsx was showing a "too many members" warning but still letting everything through unfiltered. Actually slicing to the limit is a real bug fix, not just a refactor. The aria-describedby touch on the disabled button is a nice extra too.
One small thing, not blocking: isMemberLimitReached compares against members.length, which excludes the creator (added back separately via allMembers), so the manual-add path caps at 51 total participants while the CSV path caps at exactly 50. Worth a quick look if you want both paths to land on the exact same number, but it's a minor enough gap that I wouldn't hold this up over it.
Also, heads up: you'll likely see a prefill-related tsc error on this branch right now — that's not from anything in this PR, it's because #155 (which wires up prefill in page.tsx) hasn't merged yet. Should clear up on its own once that one's in. Approving this either way — just sequencing things so CI doesn't show noise that's unrelated to your work here.

@Sendi0011 Sendi0011 merged commit 1c98cbf into JointSave-org:main Jun 28, 2026
3 checks passed
JuliobaCR added a commit to JuliobaCR/Joint_Save that referenced this pull request Jun 28, 2026
PR JointSave-org#156 (merged separately) added MAX_POOL_MEMBERS and an
isMemberLimitReached guard to addMember in the same forms this
branch touches. Kept that guard and dropped the now-removed
setMemberErrors plumbing it referenced in target-form.tsx and
flexible-form.tsx.
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.

[Improvement] Add a max member count guard to the manual "Add Member" flow

2 participants