Skip to content

feat(schedule): scope vote-chip filters to Everyone/Me/Group - #310

Open
chiptus wants to merge 8 commits into
mainfrom
claude/oldest-issue-niqcby
Open

feat(schedule): scope vote-chip filters to Everyone/Me/Group#310
chiptus wants to merge 8 commits into
mainfrom
claude/oldest-issue-niqcby

Conversation

@chiptus

@chiptuschiptus commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Schedule tab's vote-type filter chips now respect the navbar's Active Scope switcher (Everyone / Me / Active Group) instead of a separate, Schedule-only Me/Group toggle. This removed the earlier voteScope URL param and the extra selector — the chips just read whatever scope is already active globally.

Verification

  • Log in, open Schedule (list or timeline), set the navbar switcher to Me, select a vote-type chip; only your own matching votes filter sets.
  • Set the navbar switcher to Active Group; a chip now matches sets where any group member (including you) voted that way, immediately, no reload.
  • Set the navbar switcher to Everyone; a chip matches sets where anyone at all voted that way.
  • Select multiple chips; OR semantics hold under all three scopes.
  • Switching the navbar scope re-filters Schedule's visible sets immediately.

Generated by Claude Code

Adds a Me ↔ Active Group toggle alongside the Schedule tab's vote-type
filter chips, independent of the Artists tab's Vote Perspective. Reuses
resolveVotesForScope on each set's full vote list (already fetched with
sets) instead of the prior current-user-only votes query, and adds a
voteScope URL param so shared filter links preserve the choice.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012xAfdayZzwNNJ8EGap3Rix
CopilotAI lite review requested due to automatic review settings August 19, 2026 07:44
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@vercel

vercelBot commented Aug 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
uplineReadyReadyPreviewAug 19, 2026 4:59pm

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Me ↔ Active Group Vote Scope toggle for the Schedule tab’s vote filter chips, persisting the selection via a voteScope URL param and updating schedule filtering to respect the chosen scope.

Changes:

  • Introduces Schedule-specific vote scope state (voteScope=me|group) and UI toggles for both timeline and list toolbars / filter sheet.
  • Updates schedule filtering to evaluate votes from set.votes based on scope (me vs group members).
  • Extends URL search schema + url-state hook and updates unit tests for the new vote-scope behavior.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
src/routes/festivals/$festivalSlug/editions/$editionSlug/schedule/timeline.tsxUses schedule vote scope (me/group) when filtering timeline schedule days.
src/routes/festivals/$festivalSlug/editions/$editionSlug/schedule/list.tsxUses schedule vote scope (me/group) when filtering list schedule day groups.
src/pages/EditionView/tabs/ScheduleTab/VoteScopeToggle.tsxAdds the underlying “Me / Group” toggle UI component.
src/pages/EditionView/tabs/ScheduleTab/ScheduleVoteScopeToggle.tsxWires auth + schedule vote scope hook into the toggle, hiding it when unavailable.
src/pages/EditionView/tabs/ScheduleTab/ScheduleFilterSheet.tsxAdds the vote scope toggle next to vote filter chips in the mobile filter sheet.
src/pages/EditionView/tabs/ScheduleTab/list/ListDayGroup.tsxAdds the vote scope toggle next to vote chips in the list header toolbar (md+).
src/pages/EditionView/tabs/ScheduleTab/horizontal/TimelineToolbar.tsxAdds the vote scope toggle next to vote chips in the timeline toolbar (md+).
src/lib/voteScope.tsAdds MeGroupVoteScope type (me/group subset).
src/lib/searchSchemas.tsAdds optional voteScope search param to timeline/list schedule routes.
src/lib/scheduleFilter.tsUpdates vote filtering to use scoped votes derived from set.votes + scope rules.
src/lib/scheduleFilter.test.tsUpdates tests to use set.votes and adds coverage for group-scope filtering behavior.
src/hooks/useTimelineUrlState.tsAdds url-state read/write helpers for voteScope.
src/hooks/useScheduleVoteScope.tsNew hook resolving effective schedule vote scope + group member ids for filtering.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment threadsrc/pages/EditionView/tabs/ScheduleTab/ScheduleFilterSheet.tsx Outdated
Comment threadsrc/lib/scheduleFilter.ts
Comment threadsrc/hooks/useScheduleVoteScope.ts
Rename mobile "My vote" label to scope-neutral "Vote", reuse a shared
empty Set instead of allocating one per filtered set, and skip the
group-members query when the resolved scope isn't "group".
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012xAfdayZzwNNJ8EGap3Rix
@github-actions

github-actionsBot commented Aug 19, 2026

Copy link
Copy Markdown

Playwright test results

passed50 passed

Details

stats 50 tests across 14 suites
duration 1 minute, 5 seconds
commitbd0e8d9

@chiptuschiptus left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed all three review comments in f2d754a: renamed the mobile "My vote" label to scope-neutral "Vote", reused a shared empty Set instead of allocating one per filtered set, and gated the group-members query on the resolved scope being "group".


Generated by Claude Code

Comment threadsrc/hooks/useScheduleVoteScope.ts Outdated
Removes the Schedule-tab-local Vote Scope toggle and voteScope URL
param. The navbar's Active Scope switcher already offers Everyone /
Me / Active Group globally, so the vote-type filter chips now read
that scope directly instead of duplicating it with a narrower,
Schedule-only Me/Group control that didn't respond to the navbar.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012xAfdayZzwNNJ8EGap3Rix
@chiptuschiptus changed the title feat(schedule): add Vote Scope toggle (Me/Group)feat(schedule): scope vote-chip filters to Everyone/Me/GroupAug 19, 2026
@chiptus
chiptus requested a lite review from CopilotAugust 19, 2026 10:43

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/hooks/useScheduleVoteScope.ts:26

  • groupMemberIds becomes an empty Set when members is an empty array (which can happen on errors or if RLS returns no rows). Under voteScope: "group" this makes vote filtering exclusionary (no member IDs match), so selecting a vote chip can hide all sets instead of staying inert while members are unavailable.
 const groupMemberIds = useMemo(
() =>
members ? new Set(members.map((member) => member.user_id)) : undefined,
[members],
);

Two signed-in users join one group; the voter casts a Must Go vote,
then the viewer confirms the Must Go chip surfaces that set under
Group scope, hides it under Me scope, and shows it again under
Everyone scope, all via the navbar Active Scope switcher.
Adds a data-testid to the switcher trigger and an addMemberToGroup
test helper for multi-member group setup.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012xAfdayZzwNNJ8EGap3Rix
The desktop/mobile branch in selectMustGoChip used a one-shot
isVisible() check right after a dropdown-menu interaction, which lost
the race against the closing dropdown's transition and picked the
mobile filter-sheet path on desktop, where the chips group doesn't
exist. Swap it for a retrying waitFor(). Also drop the fixed
"voter"/"viewer" email suffixes, which collided with themselves on
Playwright's automatic retry and masked the real failure behind a
422 from the admin user-creation API.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012xAfdayZzwNNJ8EGap3Rix
@github-actions

github-actionsBot commented Aug 19, 2026

Copy link
Copy Markdown

Playwright test results

passed278 passed

Details

stats 278 tests across 18 suites
duration 57 minutes, 39 seconds
commitbd0e8d9

Three scope switches plus a chip selection and several assertions in
one test exceeded Playwright's 30s CI default under firefox, which
tore the page down mid-click and surfaced a misleading "context has
been closed" error instead of a plain timeout.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012xAfdayZzwNNJ8EGap3Rix
selectScope clicked the trigger and menuitem back-to-back across three
consecutive scope switches. Reopening the dropdown before the previous
instance finished closing could detach the target menuitem mid-click,
exhausting Playwright's action retries. Wait for the menu to actually
open before clicking and close before moving on.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012xAfdayZzwNNJ8EGap3Rix
Comment threadsrc/components/layout/AppHeader/GroupSwitcher/ActiveGroupSwitcher.tsx Outdated
Per review feedback, drop data-testid="active-scope-switcher" and
locate the button by its accessible name instead. Makes the aria-label
unconditional (previously mobile-only) so the name is stable and
available on desktop too.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012xAfdayZzwNNJ8EGap3Rix
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@chiptus@claude