Skip to content

chore(types): enable exactOptionalPropertyTypes - #311

Open
chiptus wants to merge 3 commits into
mainfrom
claude/issue-37-exact-optional-property-types
Open

chore(types): enable exactOptionalPropertyTypes#311
chiptus wants to merge 3 commits into
mainfrom
claude/issue-37-exact-optional-property-types

Conversation

@chiptus

@chiptus chiptus commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Enables exactOptionalPropertyTypes in tsconfig.app.json and fixes the resulting type errors, per #37. Most fixes widen prop/param types to explicitly accept undefined; mutation payload builders (useUpdateSet, useUpdateProfile, useCreateGroup, useGenerateInviteMutation, parseCsv) now build their objects with conditional spreads instead of assigning undefined directly.

Closes #37.

Verification

  • npx tsc --noEmit -p tsconfig.app.json — 0 errors
  • pnpm run lint — 0 errors (2 pre-existing unrelated warnings)
  • pnpm test -- --run — 494/494 passing
  • Manually check the Active Group toggle in Settings and the Stage selector in admin still show "nothing selected" correctly when no value is set (fixed to omit the value prop rather than coerce to "")

Generated by Claude Code

claude added 3 commits August 19, 2026 10:39
Fixes for resulting type errors are in progress on this branch.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QvzpJZujRJYbrrUg17nT78
Widens prop/param types to accept undefined where "not yet loaded"
and "absent" are equivalent, and switches mutation payload builders
(useUpdateSet, useUpdateProfile, useCreateGroup, useGenerateInviteMutation,
parseCsv) to spread optional fields conditionally instead of assigning
undefined directly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QvzpJZujRJYbrrUg17nT78
…StageSelector

Omit the value prop conditionally instead of coercing undefined to "",
so Radix ToggleGroup/Select behave the same as before the type fix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QvzpJZujRJYbrrUg17nT78
Copilot AI lite review requested due to automatic review settings August 19, 2026 14:56
@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
upline Ready Ready Preview Aug 19, 2026 2:56pm

@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 →

Copilot AI 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

Enables TypeScript’s exactOptionalPropertyTypes strictness flag for the app build and updates call sites/types to comply—primarily by (a) explicitly accepting undefined in prop/param types where callers pass T | undefined, and (b) omitting optional keys in mutation payloads/parsed objects instead of assigning undefined.

Changes:

  • Enable exactOptionalPropertyTypes in tsconfig.app.json.
  • Fix resulting type errors across UI props, hook inputs, and data types by widening to T | undefined where needed.
  • Update several payload/object builders to conditionally spread optional fields so keys are absent rather than explicitly undefined.

Reviewed changes

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

Show a summary per file
File Description
tsconfig.app.json Enables exactOptionalPropertyTypes for stricter optional-property semantics.
src/services/scheduleImport/parseCsv.ts Omits optional CSV fields via conditional spreads instead of assigning undefined.
src/routes/festivals/$festivalSlug/editions/$editionSlug/schedule/list.tsx Updates optional stageColor typing to accept explicit undefined.
src/pages/Settings/ActiveGroupSetting.tsx Omits value prop when activeGroupId is undefined to satisfy exact-optional rules.
src/pages/ExploreSetPage/useExplorableSets.tsx Widens editionId parameter type to `string
src/pages/ExploreSetPage/SetExploreCard/SoundCloudBadge.tsx Widens optional callback type to accept explicit undefined.
src/pages/ExploreSetPage/SetExploreCard/SetCardHeader.tsx Widens optional stageId prop type to accept explicit undefined.
src/pages/ExploreSetPage/SetExploreCard/SetAudioPlayer.tsx Widens optional soundcloudUrl prop type to accept explicit undefined.
src/pages/EditionView/tabs/VoteTab/filters/FilterSortControls.tsx Widens optional votePerspective prop type to accept explicit undefined.
src/pages/EditionView/tabs/ScheduleTab/list/TimeSlotGroup.tsx Widens optional types (stageColor, timezone) to accept explicit undefined.
src/pages/EditionView/tabs/ScheduleTab/list/MobileSetCard.tsx Widens optional stageColor/timezone types to accept explicit undefined.
src/pages/EditionView/tabs/ScheduleTab/list/ListDayGroup.tsx Widens optional stageColor typing to accept explicit undefined.
src/pages/EditionView/tabs/ScheduleTab/horizontal/StageRow.tsx Widens optional stage color type to accept explicit undefined.
src/pages/EditionView/tabs/ScheduleTab/horizontal/StageLabels.tsx Widens optional stage color type to accept explicit undefined.
src/pages/EditionView/tabs/InfoTab/EditionTitle.tsx Widens optional name type to accept explicit undefined.
src/pages/EditionView/EditionHero.tsx Widens optional logoUrl type to accept explicit undefined.
src/pages/admin/festivals/StageSelector.tsx Omits Select value prop when undefined to satisfy exact-optional rules.
src/pages/admin/festivals/info/FestivalFields/FestivalSocialField.tsx Widens optional social URL prop types to accept explicit undefined.
src/pages/admin/festivals/info/FestivalFields/FestivalMapField.tsx Widens optional map URL prop types to accept explicit undefined.
src/pages/admin/festivals/info/FestivalFields/FestivalInfoField.tsx Widens optional info text prop types to accept explicit undefined.
src/lib/timelineMountMoment.ts Widens optional scrollTo type to accept explicit undefined.
src/lib/timelineCalculator.ts Widens optional stage color type to accept explicit undefined.
src/lib/scheduleFilter.ts Widens optional userVotes type to accept explicit undefined.
src/hooks/useScheduleData.ts Widens optional startTime/endTime to accept explicit undefined.
src/hooks/use-toast.ts Widens optional toastId types to accept explicit undefined.
src/contexts/FestivalEditionContext.tsx Widens optional editionSlug type to accept explicit undefined.
src/components/ui/sonner.tsx Adjusts theme prop typing/cast to satisfy stricter optional-property handling.
src/components/ui/multi-select.tsx Widens optional className type to accept explicit undefined.
src/components/ui/menubar.tsx Adjusts checkbox item props handling to avoid exact-optional type issues.
src/components/ui/dropdown-menu.tsx Adjusts checkbox item props handling to avoid exact-optional type issues.
src/components/ui/context-menu.tsx Adjusts checkbox item props handling to avoid exact-optional type issues.
src/components/StageBadge.tsx Widens optional props (stageColor, size, showIcon) to accept explicit undefined.
src/components/layout/AppHeader/UserMenu.tsx Widens optional profile prop type to accept explicit undefined.
src/components/layout/AppHeader/UserAvatar.tsx Widens optional username/email types to accept explicit undefined.
src/components/layout/AppHeader/TitleSection.tsx Widens optional logoUrl type to accept explicit undefined.
src/components/layout/AppHeader/FestivalIndicator.tsx Widens optional props (logoUrl, festivalName) to accept explicit undefined.
src/components/filters/FilterToggle.tsx Widens optional callback type to accept explicit undefined.
src/components/ErrorBoundary.tsx Widens optional error/fallback prop types to accept explicit undefined.
src/components/AuthDialog/OtpStep.tsx Widens optional inviteToken type to accept explicit undefined.
src/components/AuthDialog/EmailStep.tsx Widens optional inviteToken type to accept explicit undefined.
src/components/AuthDialog/AuthDialog.tsx Widens optional inviteToken/groupName types to accept explicit undefined.
src/components/ArtistImageLoader.tsx Widens optional src type to accept explicit undefined.
src/components/Admin/ScheduleImport/CsvUploadStep.tsx Widens optional defaultTimezone type to accept explicit undefined.
src/api/voting/useVoteMutation.ts Widens optional existingVote type to accept explicit undefined.
src/api/sets/useUpdateSet.ts Builds update payload via conditional spreads to omit absent keys (no undefined assignments).
src/api/ratings/useRateSet.ts Widens optional existingRating type to accept explicit undefined.
src/api/invites/useGenerateInviteMutation.ts Builds invite payload via conditional spreads to omit absent keys (no undefined assignments).
src/api/groups/useCreateGroup.ts Omits optional description key when absent to satisfy exact-optional rules.
src/api/groups/types.ts Widens optional profile fields (username, email) to accept explicit undefined.
src/api/festivals/useFestivals.ts Widens optional all parameter typing to accept explicit undefined.
src/api/festivals/types.ts Widens optional all query-key typing to accept explicit undefined.
src/api/editions/useFestivalEditionsForFestival.ts Widens optional all parameter typing to accept explicit undefined.
src/api/editions/types.ts Widens optional all query-key typing to accept explicit undefined.
src/api/auth/useUpdateProfile.ts Omits new_username RPC arg when absent rather than explicitly providing undefined.
src/api/auth/useSignInWithOtpMutation.ts Widens optional inviteToken type to accept explicit undefined.
src/api/artist-notes/types.ts Widens optional author fields to accept explicit undefined.

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

@github-actions

Copy link
Copy Markdown

Playwright test results

passed  50 passed

Details

stats  50 tests across 14 suites
duration  1 minute, 6 seconds
commit  8ba1a5f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider enabling exactOptionalPropertyTypes in tsconfig

3 participants