Refactor user read page into categorized split-table layout#376
Refactor user read page into categorized split-table layout#376somethingnew2-0 wants to merge 3 commits intomainfrom
Conversation
Reorganize the user read page from two flat tables (Owner/Member) into three sections by group type (Access Roles, App Groups, Standard Groups), each with side-by-side Ownerships and Memberships tables. App Groups are further sub-grouped by app with clickable app name headers. Sections are hidden when both sides are empty for that type. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
barborico
left a comment
There was a problem hiding this comment.
Aesthetics look good to me. I hade Claude take a pass, and it found a but that seems legit.
There was a problem hiding this comment.
The useCallback dep array is missing owner and user.id, both of which are captured from
props and drive the mutation body.
The old OwnerTable/MemberTable each hard-coded their API body, so the only closed-over
variable was user.id (already a pre-existing gap). The refactor adds owner as a new
closed-over prop value, making the stale-closure risk concrete: if React Query's
putGroupUsers object happens to be stable across a re-render where owner has changed,
the callback fires the wrong mutation — silently calling owners_to_remove when
members_to_remove was intended, or vice versa.
| + [putGroupUsers, owner, user.id], |
There was a problem hiding this comment.
Good catch, fixed in 0d9f38a. Agreed the deps were incomplete, worth noting the stale-closure isn't reachable, today since each , is rendered with a literal owner and a stable user.id from the route, but the fix is still correct and guards future refactors.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
/apps/{appName}OwnerTable/MemberTablecomponents with a single unifiedGroupTablecomponent parameterized by anownerboolean