[Domain Control] [Release 4] [FE] Move single user between domain groups#88462
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@codex review |
|
@MelvinBot review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09dbb22c54
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/de.ts b/src/languages/de.ts
index 3e4fed08..c16f2a55 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -9103,6 +9103,8 @@ Hier ist ein *Testbeleg*, um dir zu zeigen, wie es funktioniert:`,
emptyMembers: {title: 'Keine Mitglieder in dieser Gruppe', subtitle: 'Fügen Sie ein Mitglied hinzu oder versuchen Sie, den Filter oben zu ändern.'},
moveToGroup: 'In Gruppe verschieben',
chooseWhereToMove: ({count}: {count: number}) => `Wählen Sie aus, wohin Sie ${count} ${count === 1 ? 'Mitglied' : 'Mitglieder'} verschieben möchten.`,
+ domainGroup: 'Domain-Gruppe',
+ chooseWhereToMoveName: ({name}: {name: string}) => `Wähle aus, wohin ${name} verschoben werden soll.`,
},
common: {
settings: 'Einstellungen',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index ccfce7ca..6084acd9 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -9126,6 +9126,8 @@ Voici un *reçu test* pour vous montrer comment ça fonctionne :`,
emptyMembers: {title: 'Aucun membre dans ce groupe', subtitle: 'Ajoutez un membre ou essayez de modifier le filtre ci-dessus.'},
moveToGroup: 'Déplacer vers le groupe',
chooseWhereToMove: ({count}: {count: number}) => `Choisissez où déplacer ${count} ${count === 1 ? 'membre' : 'membres'}.`,
+ domainGroup: 'Groupe de domaines',
+ chooseWhereToMoveName: ({name}: {name: string}) => `Choisissez où déplacer ${name}.`,
},
common: {
settings: 'Paramètres',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 6903a219..c1aa89e5 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -9093,6 +9093,8 @@ Ecco una *ricevuta di prova* per mostrarti come funziona:`,
emptyMembers: {title: 'Nessun membro in questo gruppo', subtitle: 'Aggiungi un membro o prova a cambiare il filtro qui sopra.'},
moveToGroup: 'Sposta nel gruppo',
chooseWhereToMove: ({count}: {count: number}) => `Scegli dove spostare ${count} ${count === 1 ? 'membro' : 'membri'}.`,
+ domainGroup: 'Gruppo di domini',
+ chooseWhereToMoveName: ({name}: {name: string}) => `Scegli dove spostare ${name}.`,
},
common: {
settings: 'Impostazioni',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 02ed4423..459230d3 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -8979,6 +8979,8 @@ ${reportName}
emptyMembers: {title: 'このグループにはメンバーがいません', subtitle: 'メンバーを追加するか、上のフィルターを変更してみてください。'},
moveToGroup: 'グループへ移動',
chooseWhereToMove: ({count}: {count: number}) => `${count} ${count === 1 ? 'メンバー' : 'メンバー'} を移動する先を選択してください。`,
+ domainGroup: 'ドメイングループ',
+ chooseWhereToMoveName: ({name}: {name: string}) => `${name} をどこに移動するか選択してください。`,
},
common: {
settings: '設定',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index a5c8c89a..ff9be702 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -9066,6 +9066,8 @@ Hier is een *proefbon* om je te laten zien hoe het werkt:`,
emptyMembers: {title: 'Geen leden in deze groep', subtitle: 'Voeg een lid toe of probeer het filter hierboven te wijzigen.'},
moveToGroup: 'Verplaatsen naar groep',
chooseWhereToMove: ({count}: {count: number}) => `Kies waar je ${count} ${count === 1 ? 'lid' : 'leden'} naartoe wilt verplaatsen.`,
+ domainGroup: 'Domeingroep',
+ chooseWhereToMoveName: ({name}: {name: string}) => `Kies waar je ${name} naartoe wilt verplaatsen.`,
},
common: {
settings: 'Instellingen',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 1e3d9a11..087991eb 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -9047,6 +9047,8 @@ Oto *paragon testowy*, żeby pokazać Ci, jak to działa:`,
emptyMembers: {title: 'Brak członków w tej grupie', subtitle: 'Dodaj członka lub spróbuj zmienić filtr powyżej.'},
moveToGroup: 'Przenieś do grupy',
chooseWhereToMove: ({count}: {count: number}) => `Wybierz, dokąd przenieść ${count} ${count === 1 ? 'członka' : 'członków'}.`,
+ domainGroup: 'Grupa domen',
+ chooseWhereToMoveName: ({name}: {name: string}) => `Wybierz, dokąd przenieść ${name}.`,
},
common: {
settings: 'Ustawienia',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 30f83244..20116f9a 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -9055,6 +9055,8 @@ Aqui está um *comprovante de teste* para mostrar como funciona:`,
emptyMembers: {title: 'Nenhum membro neste grupo', subtitle: 'Adicione um membro ou tente mudar o filtro acima.'},
moveToGroup: 'Mover para grupo',
chooseWhereToMove: ({count}: {count: number}) => `Escolha para onde mover ${count} ${count === 1 ? 'membro' : 'membros'}.`,
+ domainGroup: 'Grupo de domínio',
+ chooseWhereToMoveName: ({name}: {name: string}) => `Escolha para onde mover ${name}.`,
},
common: {
settings: 'Configurações',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 1ecfc9a6..c16fba9a 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -8828,6 +8828,8 @@ ${reportName}
emptyMembers: {title: '此群组中没有成员', subtitle: '添加成员或尝试更改上方的筛选条件。'},
moveToGroup: '移至群组',
chooseWhereToMove: ({count}: {count: number}) => `选择将 ${count} 个 ${count === 1 ? '成员' : '成员'} 移动到哪里。`,
+ domainGroup: '域名组',
+ chooseWhereToMoveName: ({name}: {name: string}) => `选择将 ${name} 移动到哪里。`,
},
common: {
settings: '设置',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
|
Test fail unrelated |
| const [userSecurityGroup] = useOnyx(`${ONYXKEYS.COLLECTION.DOMAIN}${domainAccountID}`, { | ||
| selector: securityGroupSelector, | ||
| }); | ||
| const memberLogin = getLoginByAccountID(accountID); |
There was a problem hiding this comment.
❌ PERF-11 (docs)
The securityGroupSelector is defined as an inline arrow function in the component body and passed as the selector option to useOnyx. This creates a new function reference on every render, which defeats Onyx's selector stability check and forces unnecessary re-evaluation and deep equality comparisons on every render cycle.
The existing DomainMemberDetailsPage.tsx correctly handles the same pattern by wrapping the selector in useCallback:
// Current (unstable - new reference every render):
const securityGroupSelector = (domain: OnyxEntry<Domain>) => selectSecurityGroupForAccount(accountID)(domain);
// Fix (stable reference, consistent with DomainMemberDetailsPage.tsx line 47):
const securityGroupSelector = useCallback((domain: OnyxEntry<Domain>) => selectSecurityGroupForAccount(accountID)(domain), [accountID]);Reviewed at: 21925c4 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
react compiler should take care of this
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21925c438b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@situchan kind bump here |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-04-27.at.11.07.17.PM.moviOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-04-27.at.11.04.14.PM.mov |
|
Overall this PR looks clean — well-structured, good test coverage for the selector fix, all CI checks pass, and it follows existing patterns closely. One issue to flag: Selector not memoized in In const securityGroupSelector = (domain: OnyxEntry<Domain>) => selectSecurityGroupForAccount(accountID)(domain);This recreates the selector function on every render, which can cause unnecessary Onyx re-subscriptions. const securityGroupSelector = useCallback((domain: OnyxEntry<Domain>) => selectSecurityGroupForAccount(accountID)(domain), [accountID]);The same pattern should be used here for consistency and to avoid potential performance issues. |
|
|
||
| type MoveUserBetweenGroupsPageProps = PlatformStackScreenProps<SettingsNavigatorParamList, typeof SCREENS.DOMAIN.MEMBER_MOVE_TO_GROUP>; | ||
|
|
||
| function MoveUserBetweenGroupsPage({route}: MoveUserBetweenGroupsPageProps) { |
There was a problem hiding this comment.
This component is pretty much overlapped with MoveUsersBetweenGroupsPage.
@MelvinBot is it possible to share common logic to avoid code duplication?
There was a problem hiding this comment.
Yes, there's meaningful overlap. The shared parts are: the SecurityGroupItem type, the securityGroups to list items mapping, handleSelectRow, and the entire JSX skeleton (wrapper, header, subtitle, selection list, footer button).
The differences are in data sourcing and save behavior:
Single-user page: gets accountID from route params, pre-selects current group, single changeDomainSecurityGroup call, navigates back to member details, checks selectedGroupId === currentGroupId and memberLogin for disabled state.
Bulk page: gets selectedMemberAccountIDs from Onyx, no pre-selection, loops changeDomainSecurityGroup for each member, navigates back to members list, only checks selectedGroupId for disabled state.
One approach: extract a shared SelectSecurityGroupPage component that accepts props for the subtitle, onSave callback, isDisabled, onBack, and initiallySelectedGroupId, and renders the common shell. Each page becomes a thin wrapper that supplies its specific data and save logic. This keeps the UI DRY without forcing a premature abstraction over the behavioral differences.
There was a problem hiding this comment.
Can we try this? Btw not blocker.
There was a problem hiding this comment.
@jakubstec Yeah maybe something for a follow up but I agree this is not a blocker
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
I'll be OOO until 10 May. @jakubstec will be looking after this PR until then. |
mountiny
left a comment
There was a problem hiding this comment.
NAB comments to be addressed in some future follow up
|
|
||
| type MoveUserBetweenGroupsPageProps = PlatformStackScreenProps<SettingsNavigatorParamList, typeof SCREENS.DOMAIN.MEMBER_MOVE_TO_GROUP>; | ||
|
|
||
| function MoveUserBetweenGroupsPage({route}: MoveUserBetweenGroupsPageProps) { |
There was a problem hiding this comment.
@jakubstec Yeah maybe something for a follow up but I agree this is not a blocker
| import type {Domain} from '@src/types/onyx'; | ||
|
|
||
| type SecurityGroupItem = ListItem & { | ||
| value: string; |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.3.67-0 🚀
Bundle Size Analysis (Sentry): |
|
Yes, help site changes are needed. The PR adds a new user-facing flow for Domain Admins to move a single member between domain groups from the member details page, which isn't documented in the current Manage Domain Members article. I've created a draft PR with the update: #89644 Changes made:
|
Explanation of Change
This PR implements a page that allows admins to move a single domain member between security groups.
Fixed Issues
$ #88123
PROPOSAL:
Tests
Domain groupmenu itemOffline tests
Same as tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2026-04-22.at.14.38.20.mov
Android: mWeb Chrome
Screen.Recording.2026-04-22.at.14.49.06.mov
iOS: Native
Screen.Recording.2026-04-22.at.13.03.18.mov
iOS: mWeb Safari
Screen.Recording.2026-04-22.at.13.07.55.mov
MacOS: Chrome / Safari
Screen.Recording.2026-04-22.at.14.51.31.mov