Repository navigation
feat(web): let admins switch to any group - #1590
Merged
joshunrau merged 1 commit intoOct 1, 2026
Merged
Conversation
An admin already holds `manage all` on the API, but the group switcher only offered the groups on their token. Admins are now offered every group on the platform. An admin who belongs to no group still starts with none selected and sees a placeholder until they pick one. Admin specs that opened the first combobox on the page now target their own field by testid, since the switcher is now a combobox for the seeded admin too. Closes DouglasNeuroInformatics#1545 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1545
What changed
Admins already hold
manage allon the API, but the group switcher only offered the groups on their token. For admins it now lists every group on the platform, fromGET /v1/groups. Everyone else still sees only their own groups. The API is unchanged.useSwitchableGroups(apps/web/src/hooks/): returns every group for an admin (ability.can('manage', 'all'), the same checkuseNavItemsuses) and the token's groups for everyone else. Until the admin's full list loads, the switcher shows the admin's own groups, so it never goes blank.group-switcher-position-select.Verification
apps/web/src/hooks/__tests__/useSwitchableGroups.test.tsandapps/web/src/__tests__/group-switcher.test.tsxtesting/src/specs/group-switcher.spec.ts. It checks three cases:pnpm lint,pnpm test(1525 tests) andpnpm test:e2e(243 tests) all pass locally.Known limitations
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com