feat: add a setting to change default home view #25419
Draft
+170
−0
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.
What does this PR do?
Adds a user preference setting to choose their default home view (landing page). When users visit the root URL (
/), they are automatically redirected to either Event Types or Bookings based on their saved preference.Key Changes:
Added
defaultHomeViewfield to user metadata schema with values"event-types"|"bookings"Modified root redirect logic to respect user preference (defaults to "event-types" for backward compatibility)
Added dropdown control in Settings → My Account → General for users to set their preference
Preference is stored in existing
metadataJSONB column (no migration required)Fixes 13778 (GitHub issue number)
Fixes CAL-3176 (Linear issue number - should be visible at the bottom of the GitHub issue description)
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Environment Setup:
Test Scenarios:
New User (No Preference Set)
/→ should redirect to/event-typesSet Preference to Bookings
/→ should redirect to/bookings/upcomingSet Preference to Event Types
/→ should redirect to/event-typesPersistence Test
/→ should still redirect to/bookings/upcomingOnboarding Flow (Should Not Be Affected)
Expected Behavior:
Checklist
Files Changed:
packages/prisma/zod-utils.ts- Added schema fieldpackages/trpc/server/routers/viewer/me/updateProfile.schema.ts- Whitelisted field for updatesapps/web/app/page.tsx- Added redirect logicapps/web/modules/settings/my-account/general-view.tsx- Added UI controlapps/web/public/static/locales/en/common.json- Added translation keysTechnical Notes:
metadataJSONB column (no database migration needed)Summary by cubic
Adds a user setting to choose the default home view. Users are redirected to Bookings or Event Types on sign-in based on this preference.
Written for commit 477e8e4. Summary will update automatically on new commits.