Skip to content

fix: score yes/no answers, translate options, scope forms list#191

Merged
Musiker15 merged 1 commit into
mainfrom
fix/yesno-scoring-and-form-scope
Jul 9, 2026
Merged

fix: score yes/no answers, translate options, scope forms list#191
Musiker15 merged 1 commit into
mainfrom
fix/yesno-scoring-and-form-scope

Conversation

@Musiker15

Copy link
Copy Markdown
Member

Three customer-reported bugs.

1. Required yes/no not submittable when "No" is selected

yes_no is a boolean field, so picking "No" produces false. isBlankAnswer(false) returned true, so a required yes/no with "No" read as missing and blocked submission with "This field is required." The false-is-blank rule is only correct for consent/age_check checkboxes.

Fix: a field-aware isAnswerMissing(field, value) helper in shared. For yes_no, both true and false are valid answers; consent/age_check keep their "unchecked box = no agreement" semantics. Both the server schema (buildAnswerSchema) and the client renderer now use it.

2. Yes/No options not translated

The radio labels "Yes"/"No" were hardcoded. Added yes/no to the form dictionary section in all 7 locales and plumbed them through FormLabels into FieldInput.

3. Per-form viewer sees and exports every form

The export route was already per-form gated, but the dashboard forms list ran unscoped (getGuildForms(guildId)), so a viewer granted a single form still saw all forms, their submission counts, slugs and export buttons.

Fix: getGuildForms(guildId, scope) filters by review scope. Managers and guild-wide reviewers still see everything; a per-form reviewer sees only their granted forms, consistent with the existing submissions/board scoping.

Tests: added shared cases for yes_no ("No" accepted) and consent (unchecked rejected). Typecheck, lint, tests (85) and build all green.

- yes_no with an explicit "No" (false) is now a valid answer for required
  fields via a field-aware isAnswerMissing helper, instead of false being
  treated as blank (which only holds for consent/age_check checkboxes)
- translate the Yes/No radio labels via the form dictionary in all 7 locales
  instead of hardcoded English
- scope the dashboard forms list to the viewer's review scope so a per-form
  reviewer no longer sees or exports every form in the guild

Also bump packageManager to pnpm@11.10.0 and update author contact.
@Musiker15 Musiker15 merged commit 7487669 into main Jul 9, 2026
3 checks passed
@Musiker15 Musiker15 deleted the fix/yesno-scoring-and-form-scope branch July 9, 2026 14:27
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