Skip to content

Commit 770c02a

Browse files
committed
Add orientation profile field and extend gender options
1 parent 0d2da9d commit 770c02a

29 files changed

Lines changed: 706 additions & 81 deletions

CLAUDE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ response → React state.
9090
### Internationalization
9191

9292
`const t = useT()` (from `web/lib/locale`), then `t('key', 'English fallback')`. Translation JSON lives in
93-
`common/messages/` (`de.json`, `fr.json`; English is the inline fallback). To add a language see `docs/development.md`
94-
and the `LOCALES` dict in `common/src/constants.ts`.
93+
`common/messages/` (`de.json`, `fr.json`; English is the inline fallback).
9594

9695
### Timestamps
9796

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ android {
1111
applicationId "com.compassconnections.app"
1212
minSdkVersion rootProject.ext.minSdkVersion
1313
targetSdkVersion rootProject.ext.targetSdkVersion
14-
versionCode 110
14+
versionCode 111
1515
versionName "1.26.0"
1616
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1717
aaptOptions {

backend/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@compass/api",
3-
"version": "1.40.0",
3+
"version": "1.41.0",
44
"private": true,
55
"description": "Backend API endpoints",
66
"main": "src/serve.ts",

backend/api/src/get-profiles.ts

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
GENDERS,
77
LANGUAGE_CHOICES,
88
MBTI_CHOICES,
9+
ORIENTATION_CHOICES,
910
POLITICAL_CHOICES,
1011
RACE_CHOICES,
1112
RELATIONSHIP_CHOICES,
@@ -79,6 +80,7 @@ export type profileQueryType = {
7980
relationship_status?: string[] | undefined
8081
languages?: string[] | undefined
8182
religion?: string[] | undefined
83+
orientation?: string[] | undefined
8284
wants_kids_strength?: number | undefined
8385
has_kids?: number | undefined
8486
is_smoker?: boolean | undefined
@@ -123,6 +125,8 @@ const textFields = [
123125
'raised_in_country',
124126
'political_details',
125127
'religious_beliefs',
128+
'orientation_details',
129+
'gender_details',
126130
]
127131

128132
// Define choice fields to search
@@ -138,13 +142,28 @@ const arrayChoiceFields = [
138142
{field: 'political_beliefs', choices: POLITICAL_CHOICES},
139143
{field: 'relationship_status', choices: RELATIONSHIP_STATUS_CHOICES},
140144
{field: 'religion', choices: RELIGION_CHOICES},
145+
{field: 'orientation', choices: ORIENTATION_CHOICES},
141146
{field: 'pref_relation_styles', choices: RELATIONSHIP_CHOICES},
142147
{field: 'pref_romantic_styles', choices: ROMANTIC_CHOICES},
143148
{field: 'languages', choices: LANGUAGE_CHOICES},
144149
{field: 'ethnicity', choices: RACE_CHOICES},
145150
]
146151

147-
// const userActivityColumns = ['last_online_time']
152+
const EXCLUDED_PROFILE_COLS = new Set(['search_text', 'search_tsv'])
153+
154+
const profileColsPromise: Promise<string> = (async () => {
155+
const pg = createSupabaseDirectClient()
156+
const rows = await pg.manyOrNone<{column_name: string}>(
157+
`SELECT column_name FROM information_schema.columns WHERE table_name = 'profiles' ORDER BY ordinal_position`,
158+
)
159+
const result = rows
160+
.map((r) => r.column_name)
161+
.filter((c) => !EXCLUDED_PROFILE_COLS.has(c))
162+
.map((c) => `profiles.${c}`)
163+
.join(', ')
164+
console.log('profileCols:', result)
165+
return result
166+
})()
148167

149168
export const loadProfiles = async (props: profileQueryType) => {
150169
const pg = createSupabaseDirectClient()
@@ -180,6 +199,7 @@ export const loadProfiles = async (props: profileQueryType) => {
180199
relationship_status,
181200
languages,
182201
religion,
202+
orientation,
183203
wants_kids_strength,
184204
has_kids,
185205
interests,
@@ -469,6 +489,11 @@ export const loadProfiles = async (props: profileQueryType) => {
469489
religion?.length &&
470490
where(`religion IS NULL OR religion = '{}' OR religion && $(religion)`, {religion}),
471491

492+
orientation?.length &&
493+
where(`orientation IS NULL OR orientation = '{}' OR orientation && $(orientation)`, {
494+
orientation,
495+
}),
496+
472497
interests?.length && where(getManyToManyClause('interests'), {values: interests.map(Number)}),
473498

474499
causes?.length && where(getManyToManyClause('causes'), {values: causes.map(Number)}),
@@ -612,7 +637,8 @@ export const loadProfiles = async (props: profileQueryType) => {
612637
),
613638
]
614639

615-
let selectCols = `profiles.*, users.name, users.username, jsonb_build_object(
640+
const profileCols = (await profileColsPromise) ?? 'profiles.*' // stored at module level
641+
let selectCols = `${profileCols}, users.name, users.username, jsonb_build_object(
616642
'id', users.id,
617643
'name', users.name,
618644
'username', users.username,
@@ -637,7 +663,6 @@ export const loadProfiles = async (props: profileQueryType) => {
637663
after && where(`${_orderBy} < (${afterFilter})`),
638664
limitParam && limit(limitParam),
639665
)
640-
641666
// console.debug('query:', query)
642667

643668
const profiles = await pg.map(query, [], convertRow)

backend/shared/src/supabase/notifications.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ async function getUserIds() {
181181
const pg = createSupabaseDirectClient()
182182

183183
// Fetch all users
184-
const {data: users, error} = await tryCatch(pg.many<Row<'users'>>('select id from users'))
184+
const {data: users, error} = await tryCatch(pg.manyOrNone<Row<'users'>>('select id from users'))
185185

186186
if (error) {
187187
console.error('Error fetching users', error)

backend/supabase/migration.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,5 @@ BEGIN;
5656
\i backend/supabase/migrations/20260319_add_compatibility_prompts_pinned.sql
5757
\i backend/supabase/migrations/20260330_add_substance_fields_to_profiles.sql
5858
\i backend/supabase/email_unsubscribe_tokens.sql
59+
\i backend/supabase/migrations/20260524_add_orientation_to_profiles.sql
5960
COMMIT;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- Add orientation and gender/orientation details fields to profiles table
2+
-- Created: 2026-05-24
3+
4+
ALTER TABLE profiles
5+
ADD COLUMN IF NOT EXISTS orientation TEXT[],
6+
ADD COLUMN IF NOT EXISTS orientation_details TEXT,
7+
ADD COLUMN IF NOT EXISTS gender_details TEXT;
8+
9+
-- Create GIN index for array field
10+
CREATE INDEX IF NOT EXISTS profiles_orientation_gin ON profiles USING GIN (orientation);

common/messages/de.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@
339339
"filter.any_language": "Alle Sprachen",
340340
"filter.any_mbti": "Jeder MBTI",
341341
"filter.any_new_users": "Jegliche neue Nutzer",
342+
"filter.any_orientation": "Jede Orientierung",
342343
"filter.any_politics": "Jede politische Ausrichtung",
343344
"filter.any_psychedelics": "Beliebige Psychedelika",
344345
"filter.any_relationship": "Jede romantische Beziehung",
@@ -355,6 +356,7 @@
355356
"filter.gender.any": "Alle",
356357
"filter.gender.gender": "Geschlecht",
357358
"filter.gender.genders": "Geschlechter",
359+
"filter.gender.show_more": "Mehr Geschlechter anzeigen",
358360
"filter.gender.they_seek": "Geschlecht, das sie suchen",
359361
"filter.group.advanced": "Erweitert",
360362
"filter.group.background": "Hintergrund",
@@ -400,6 +402,7 @@
400402
"filter.mine_toggle": "Meine Filter",
401403
"filter.multiple": "Mehrere",
402404
"filter.near": "in der Nähe von",
405+
"filter.orientation.show_more": "Mehr Orientierungen anzeigen",
403406
"filter.raised_in": "Aufgewachsen",
404407
"filter.relationship.any_connection": "Jede Beziehung",
405408
"filter.relationship_status.any": "Jeder romantische Status",
@@ -790,13 +793,54 @@
790793
"profile.education.masters": "Master",
791794
"profile.education.short_name": "Bildung",
792795
"profile.education.some-college": "Hochschulbildung",
796+
"profile.gender": "Geschlecht",
797+
"profile.gender.agender": "Agender",
798+
"profile.gender.androgynous": "Androgyn",
799+
"profile.gender.bigender": "Bigender",
800+
"profile.gender.cis-man": "Cismann",
801+
"profile.gender.cis-woman": "Cisfrau",
802+
"profile.gender.details_placeholder": "Details zu deiner Geschlechtsidentität…",
793803
"profile.gender.female": "Frau",
804+
"profile.gender.gender-nonconforming": "Geschlechtsnichtkonform",
805+
"profile.gender.genderfluid": "Genderfluid",
806+
"profile.gender.genderqueer": "Genderqueer",
807+
"profile.gender.hijra": "Hijra",
808+
"profile.gender.intersex": "Intergeschlechtlich",
794809
"profile.gender.male": "Mann",
810+
"profile.gender.non-binary": "Nichtbinär",
795811
"profile.gender.other": "Andere",
812+
"profile.gender.pangender": "Pangender",
813+
"profile.gender.plural.agender": "Agender",
814+
"profile.gender.plural.androgynous": "Androgyne",
815+
"profile.gender.plural.bigender": "Bigender",
816+
"profile.gender.plural.cis-man": "Cismänner",
817+
"profile.gender.plural.cis-woman": "Cisfrauen",
796818
"profile.gender.plural.female": "Frauen",
819+
"profile.gender.plural.gender-nonconforming": "Geschlechtsnichtkonforme",
820+
"profile.gender.plural.genderfluid": "Genderfluide",
821+
"profile.gender.plural.genderqueer": "Genderqueers",
822+
"profile.gender.plural.hijra": "Hijras",
823+
"profile.gender.plural.intersex": "Intergeschlechtliche",
797824
"profile.gender.plural.male": "Männer",
825+
"profile.gender.plural.non-binary": "Nichtbinäre",
798826
"profile.gender.plural.other": "Andere",
827+
"profile.gender.plural.pangender": "Pangender",
799828
"profile.gender.plural.people": "Leute",
829+
"profile.gender.plural.trans-man": "Transmänner",
830+
"profile.gender.plural.trans-woman": "Transfrauen",
831+
"profile.gender.plural.transfeminine": "Transfeminine",
832+
"profile.gender.plural.transgender": "Transgender",
833+
"profile.gender.plural.transmasculine": "Transmaskuline",
834+
"profile.gender.plural.transsexual": "Transsexuelle",
835+
"profile.gender.plural.two-spirit": "Zwei-Geist",
836+
"profile.gender.show_more": "Mehr Optionen anzeigen",
837+
"profile.gender.trans-man": "Transmann",
838+
"profile.gender.trans-woman": "Transfrau",
839+
"profile.gender.transfeminine": "Transfeminin",
840+
"profile.gender.transgender": "Transgender",
841+
"profile.gender.transmasculine": "Transmaskulin",
842+
"profile.gender.transsexual": "Transsexuell",
843+
"profile.gender.two-spirit": "Zwei-Geist",
800844
"profile.has_kids": "Hat Kinder",
801845
"profile.has_kids.-1": "Egal",
802846
"profile.has_kids.0": "Nein",
@@ -977,6 +1021,7 @@
9771021
"profile.optional.mbti": "MBTI-Persönlichkeitstyp",
9781022
"profile.optional.num_kids": "Aktuelle Anzahl von Kindern",
9791023
"profile.optional.og_card": "Profilkarte",
1024+
"profile.optional.orientation": "Sexuelle Orientierung",
9801025
"profile.optional.photos": "Fotos",
9811026
"profile.optional.political_beliefs": "Politische Ansichten",
9821027
"profile.optional.raised_in": "Ort, an dem ich aufgewachsen bin",
@@ -994,6 +1039,29 @@
9941039
"profile.optional.username_or_url": "Benutzername oder URL",
9951040
"profile.optional.want_kids": "Ich möchte Kinder haben",
9961041
"profile.optional.work": "Arbeit",
1042+
"profile.orientation": "Orientierung",
1043+
"profile.orientation.aceflux": "Aceflux",
1044+
"profile.orientation.akioromantic": "Akioromantisch",
1045+
"profile.orientation.akiosexual": "Akiosexuell",
1046+
"profile.orientation.aroflux": "Aroflux",
1047+
"profile.orientation.asexual": "Asexuell",
1048+
"profile.orientation.bisexual": "Bisexuell",
1049+
"profile.orientation.demiromantic": "Demiromantisch",
1050+
"profile.orientation.demisexual": "Demisexuell",
1051+
"profile.orientation.details_placeholder": "Details zu deiner sexuellen Orientierung…",
1052+
"profile.orientation.gay": "Schwul",
1053+
"profile.orientation.gray-asexual": "Grauasexuell",
1054+
"profile.orientation.grayromantic": "Grauromantisch",
1055+
"profile.orientation.heteroflexible": "Heteroflexibel",
1056+
"profile.orientation.homoflexible": "Homoflexibel",
1057+
"profile.orientation.lesbian": "Lesbisch",
1058+
"profile.orientation.pansexual": "Pansexuell",
1059+
"profile.orientation.queer": "Queer",
1060+
"profile.orientation.questioning": "Fragend",
1061+
"profile.orientation.recipromantic": "Reziproromantisch",
1062+
"profile.orientation.reciprosexual": "Reziprosexuell",
1063+
"profile.orientation.show_more": "Mehr Optionen anzeigen",
1064+
"profile.orientation.straight": "Heterosexuell",
9971065
"profile.political.conservative": "Konservativ",
9981066
"profile.political.e/acc": "Effektiver Akzelerationismus",
9991067
"profile.political.green": "Grün / Ökosozialismus",

common/messages/fr.json

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@
339339
"filter.any_language": "Toutes les langues",
340340
"filter.any_mbti": "Tout MBTI",
341341
"filter.any_new_users": "Tout nouvel utilisateur",
342+
"filter.any_orientation": "Toute orientation",
342343
"filter.any_politics": "Toute orientation politique",
343344
"filter.any_psychedelics": "Tout psychédélique",
344345
"filter.any_relationship": "Toute relation amoureuse",
@@ -355,6 +356,7 @@
355356
"filter.gender.any": "Tout",
356357
"filter.gender.gender": "genre",
357358
"filter.gender.genders": "genres",
359+
"filter.gender.show_more": "Afficher plus de genres",
358360
"filter.gender.they_seek": "Genre qu'ils recherchent",
359361
"filter.group.advanced": "Avancé",
360362
"filter.group.background": "Milieu",
@@ -400,6 +402,7 @@
400402
"filter.mine_toggle": "Mes filtres",
401403
"filter.multiple": "Multiple",
402404
"filter.near": "près de",
405+
"filter.orientation.show_more": "Afficher plus d'orientations",
403406
"filter.raised_in": "A grandi",
404407
"filter.relationship.any_connection": "Toute relation",
405408
"filter.relationship_status.any": "Tout statut romantique",
@@ -789,13 +792,54 @@
789792
"profile.education.masters": "Master",
790793
"profile.education.short_name": "Education",
791794
"profile.education.some-college": "Supérieur",
795+
"profile.gender": "Genre",
796+
"profile.gender.agender": "Agenre",
797+
"profile.gender.androgynous": "Androgyne",
798+
"profile.gender.bigender": "Bigenre",
799+
"profile.gender.cis-man": "Homme cisgenre",
800+
"profile.gender.cis-woman": "Femme cisgenre",
801+
"profile.gender.details_placeholder": "Détails sur votre identité de genre…",
792802
"profile.gender.female": "Femme",
803+
"profile.gender.gender-nonconforming": "Non-conforme au genre",
804+
"profile.gender.genderfluid": "Genderfluid",
805+
"profile.gender.genderqueer": "Genderqueer",
806+
"profile.gender.hijra": "Hijra",
807+
"profile.gender.intersex": "Intersexe",
793808
"profile.gender.male": "Homme",
809+
"profile.gender.non-binary": "Non-binaire",
794810
"profile.gender.other": "Autre",
795-
"profile.gender.plural.female": "des femmes",
796-
"profile.gender.plural.male": "des hommes",
797-
"profile.gender.plural.other": "des autres",
798-
"profile.gender.plural.people": "des personnes",
811+
"profile.gender.pangender": "Pangenre",
812+
"profile.gender.plural.agender": "agenres",
813+
"profile.gender.plural.androgynous": "androgynes",
814+
"profile.gender.plural.bigender": "bigenres",
815+
"profile.gender.plural.cis-man": "hommes cisgenres",
816+
"profile.gender.plural.cis-woman": "femmes cisgenres",
817+
"profile.gender.plural.female": "femmes",
818+
"profile.gender.plural.gender-nonconforming": "non-conformes au genre",
819+
"profile.gender.plural.genderfluid": "genderfluids",
820+
"profile.gender.plural.genderqueer": "genderqueers",
821+
"profile.gender.plural.hijra": "hijras",
822+
"profile.gender.plural.intersex": "intersexes",
823+
"profile.gender.plural.male": "hommes",
824+
"profile.gender.plural.non-binary": "non-binaires",
825+
"profile.gender.plural.other": "autres",
826+
"profile.gender.plural.pangender": "pangenres",
827+
"profile.gender.plural.people": "personnes",
828+
"profile.gender.plural.trans-man": "hommes trans",
829+
"profile.gender.plural.trans-woman": "femmes trans",
830+
"profile.gender.plural.transfeminine": "transféminins",
831+
"profile.gender.plural.transgender": "transgenres",
832+
"profile.gender.plural.transmasculine": "transmasculins",
833+
"profile.gender.plural.transsexual": "transsexuel·les",
834+
"profile.gender.plural.two-spirit": "bispirituels",
835+
"profile.gender.show_more": "Afficher plus d'options",
836+
"profile.gender.trans-man": "Homme trans",
837+
"profile.gender.trans-woman": "Femme trans",
838+
"profile.gender.transfeminine": "Transféminins",
839+
"profile.gender.transgender": "Transgenre",
840+
"profile.gender.transmasculine": "Transmasculins",
841+
"profile.gender.transsexual": "Transsexuel·le",
842+
"profile.gender.two-spirit": "Bispirituel",
799843
"profile.has_kids": "A des enfants",
800844
"profile.has_kids.-1": "N'importe",
801845
"profile.has_kids.0": "N'a pas d'enfants",
@@ -976,6 +1020,7 @@
9761020
"profile.optional.mbti": "Type de personnalité MBTI",
9771021
"profile.optional.num_kids": "Nombre actuel d'enfants",
9781022
"profile.optional.og_card": "Carte de profil",
1023+
"profile.optional.orientation": "Orientation sexuelle",
9791024
"profile.optional.photos": "Photos",
9801025
"profile.optional.political_beliefs": "Opinions politiques",
9811026
"profile.optional.raised_in": "Lieu où j'ai grandi",
@@ -993,6 +1038,29 @@
9931038
"profile.optional.username_or_url": "Nom d'utilisateur ou URL",
9941039
"profile.optional.want_kids": "Je souhaite avoir des enfants",
9951040
"profile.optional.work": "Domaine de travail",
1041+
"profile.orientation": "Orientation",
1042+
"profile.orientation.aceflux": "Aceflux",
1043+
"profile.orientation.akioromantic": "Akioromantique",
1044+
"profile.orientation.akiosexual": "Akiosexuel·le",
1045+
"profile.orientation.aroflux": "Aroflux",
1046+
"profile.orientation.asexual": "Asexuel·le",
1047+
"profile.orientation.bisexual": "Bisexuel·le",
1048+
"profile.orientation.demiromantic": "Demiromantique",
1049+
"profile.orientation.demisexual": "Demisexuel·le",
1050+
"profile.orientation.details_placeholder": "Détails sur votre orientation sexuelle…",
1051+
"profile.orientation.gay": "Gay",
1052+
"profile.orientation.gray-asexual": "Gris-asexuel·le",
1053+
"profile.orientation.grayromantic": "Grisromantique",
1054+
"profile.orientation.heteroflexible": "Hétéroflexible",
1055+
"profile.orientation.homoflexible": "Homoflexible",
1056+
"profile.orientation.lesbian": "Lesbienne",
1057+
"profile.orientation.pansexual": "Pansexuel·le",
1058+
"profile.orientation.queer": "Queer",
1059+
"profile.orientation.questioning": "En questionnement",
1060+
"profile.orientation.recipromantic": "Réciproromantique",
1061+
"profile.orientation.reciprosexual": "Réciprosexuel·le",
1062+
"profile.orientation.show_more": "Afficher plus d'options",
1063+
"profile.orientation.straight": "Hétérosexuel·le",
9961064
"profile.political.conservative": "Conservateur·trice",
9971065
"profile.political.e/acc": "Accélérationnisme efficace",
9981066
"profile.political.green": "Vert·e / Éco-socialiste",

common/src/api/schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,7 @@ export const API = (_apiTypeCheck = {
743743
big5_neuroticism_min: z.coerce.number().optional(),
744744
big5_neuroticism_max: z.coerce.number().optional(),
745745
religion: arraybeSchema.optional(),
746+
orientation: arraybeSchema.optional(),
746747
pref_relation_styles: arraybeSchema.optional(),
747748
pref_romantic_styles: arraybeSchema.optional(),
748749
diet: arraybeSchema.optional(),

0 commit comments

Comments
 (0)