feat(groups): add active group switcher - #273
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ea31a03 to
4ccba62
Compare
4ccba62 to
afe4235
Compare
e842a09 to
44b4567
Compare
Playwright test resultsDetails
|
|
Deploy →
|
|
The This means staging is missing The auto-generated deploy-status comment on this thread suggests Generated by Claude Code |
7accc6c to
a623ddb
Compare
Deriving activeGroupId from the header's transient current scope hid the toggle whenever a user with an Active Group switched away from "group". Also seed the initial perspective from current per ADR 0005 instead of hardcoding "group". Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Replace hand-rolled <button> + manual state classes with the shadcn ToggleGroup pattern already used by VotePerspectiveToggle for the same single-select choice shape. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Decompose FilteredSetsPanel.tsx (154 lines, four mixed concerns) into AuthedFilteredSetsPanel/GroupScopedSetsPanel/SetsPanelContent, matching the earlier ActiveGroupSwitcher/ScopeMenuBody split. This also removes the duplicated "everyone" SetsPanelContent call between the anonymous and authed-non-group branches. Also collapse useSetActiveGroupMutation/useSetActiveScopeMutation into a shared useProfileFieldMutation, and dedupe the ToggleGroupItem className repeated in ActiveGroupSetting/ActiveScopeSetting. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012hH41h18hKSvYxWAw17nhd
ActiveGroupSwitcher.tsx, ScopeMenuBody.tsx, and scopeDisplay.ts are used exclusively by the group switcher, so group them together instead of leaving them loose alongside unrelated AppHeader files. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012hH41h18hKSvYxWAw17nhd
| children: ReactNode; | ||
| }) { | ||
| const { profile } = useAuth(); | ||
| const { data: groups = [], isLoading } = useQuery(userGroupsQuery(userId)); |
There was a problem hiding this comment.
Why don't we use suspense?
| activeGroupId, | ||
| pinned, | ||
| current, | ||
| selectScope, |
There was a problem hiding this comment.
Why don't we use one "selects cope" fn that has pinned boolean? Instead of two?
column/value/errorMessage now travel as mutate() arguments instead of useProfileFieldMutation generics, so ActiveScopeContext only needs one mutation instance for both active_group_id and active_scope instead of two. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012hH41h18hKSvYxWAw17nhd
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012hH41h18hKSvYxWAw17nhd
SignInRequired has two callers (Groups, Settings) with different copy; a groups-specific default was wrong for the other one. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012hH41h18hKSvYxWAw17nhd
ActiveGroupSetting/ActiveScopeSetting used the shared className identically on a ToggleGroupItem; encapsulate that as a SettingsToggleItem component instead of exporting a bare string. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012hH41h18hKSvYxWAw17nhd
20260814140000 added active_group_selected only for the very next migration to drop it — both land in the same unmerged PR, so fold the net-zero column into the active_scope migration directly instead of shipping a column that's never actually used. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012hH41h18hKSvYxWAw17nhd
Adds a persistent header switcher (Everyone + your groups) that sets the Active Group everywhere, and retires the Artists-tab-only group filter in favor of a two-state Vote Perspective toggle built on a shared, tested vote-scope resolver.
Selecting a group in the header re-scores and re-sorts the Artists tab immediately, without a reload.
Closes #124
Verification
pnpm testpasses, including newsrc/lib/voteScope.test.tscovering Everyone/Me/Group scopes, a member vs. non-member group, no votes, and votes only from outside the group.pnpm run typecheckandpnpm run lintpass.Generated by Claude Code