Skip to content

Add pronoun personalization to Recommendation Letter Generator#14

Merged
aspiece merged 2 commits intomainfrom
copilot/update-recommendation-letter-generator-again
Apr 29, 2026
Merged

Add pronoun personalization to Recommendation Letter Generator#14
aspiece merged 2 commits intomainfrom
copilot/update-recommendation-letter-generator-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 29, 2026

Adds a required Pronouns field to the letter generator form and threads the selected pronouns through every generated paragraph so letters read as personally written for the specific student.

Form Changes

  • New pronounSelect dropdown (required, positioned after name fields): He/Him, She/Her, They/Them, Prefer not to answer
  • Pronoun selection validated before generation; clearBtn resets it

Pronoun Engine

  • getPronouns(selection, firstName) → returns { subj, obj, poss, subjCap, is, has, … }. For Prefer not to answer, all pronoun slots resolve to firstName / firstName + "'s" — no pronouns ever surface in the output.
  • fillTemplate(text, firstName, p) — replaces {P_SUBJ}, {P_OBJ}, {P_POSS}, {P_SUBJ_CAP}, {P_IS}, {P_HAS} tokens in any string.
// they/them example
{ subj: 'they', obj: 'them', poss: 'their', subjCap: 'They', is: 'are', has: 'have' }

// prefer not to answer — "Jordan Rivera" student
{ subj: 'Jordan', obj: 'Jordan', poss: "Jordan's", subjCap: 'Jordan', is: 'is', has: 'has' }

Template Updates

All student-referencing they/them/their replaced with {P_*} tokens across:

  • TRANSITIONS, all 15 TRAIT_PHRASES entries, OPENINGS (×7), CLOSINGS (×6), PURPOSE_DATA closingStatements (all 7 purposes)
  • buildTraitParagraph() now accepts and applies p
  • generateLetter() reads/validates pronouns, constructs p, passes it to every template

One existing phrase — "a consistent effort to lift teammates up rather than stand apart from them" — was rewritten to remove the ambiguous them (referred to teammates, not the student) to prevent incorrect substitution.

Copilot AI and others added 2 commits April 29, 2026 16:49
- Add Student Name + Pronouns fields (He/Him, She/Her, They/Them, Prefer not to answer)
- Add getPronouns() helper returning subj/obj/poss/subjCap/is/has pronoun set
- Add fillTemplate() helper to replace {P_*} tokens throughout letter text
- Update TRANSITIONS, TRAIT_PHRASES, OPENINGS, CLOSINGS with {P_*} tokens
- Update PURPOSE_DATA closingStatements with {P_*} tokens
- Update buildTraitParagraph() to accept and apply pronoun object
- Update generateLetter() to read/validate pronouns and pass p to all templates
- Update clearBtn to reset pronouns dropdown
- Fix 'stand apart from them' (teammates ref) to avoid ambiguous pronoun replacement
- All four pronoun options verified: he/him, she/her, they/them, prefer (name-based)

Agent-Logs-Url: https://github.com/aspiece/GCI/sessions/d969be66-bc32-4504-8bb2-ff7499661c4f

Co-authored-by: aspiece <1187774+aspiece@users.noreply.github.com>
@aspiece aspiece marked this pull request as ready for review April 29, 2026 17:01
@aspiece aspiece merged commit 2281260 into main Apr 29, 2026
0 of 2 checks 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.

2 participants