feat(companion): add configurable first page setting#27267
feat(companion): add configurable first page setting#27267dhairyashiil merged 19 commits intomainfrom
Conversation
- Add useUserPreferences hook for persistent storage of landing page preference - Add LandingPagePicker component for both iOS and Android/web platforms - Update tabs index to redirect based on user preference - Update bookings index to accept initial filter from URL params - Add App Settings section in More screen with landing page selector - Clear user preferences on logout for fresh state
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Replace Redirect component with router.replace() to fix TypeScript strict typing issue with expo-router's Href type for dynamic routes.
Use switch statement with literal route strings instead of dynamic string variable to satisfy expo-router's strict Href type checking.
This comment was marked as spam.
This comment was marked as spam.
This hook is intended to stay narrow - it only handles user preferences like landing page selection. Routing logic in layout file only uses the landing page preference. If we add more routing-related logic in the future, we should evaluate whether it belongs here or in a dedicated routing hook |
There was a problem hiding this comment.
10 issues found across 11 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="companion/app/(tabs)/(bookings)/index.tsx">
<violation number="1" location="companion/app/(tabs)/(bookings)/index.tsx:19">
P2: Validate the `filter` URL param before casting; an invalid value can produce an unsupported `activeFilter` and a `-1` `activeIndex`, which may break the filter UI or selection logic.</violation>
</file>
<file name="companion/components/LandingPagePicker.ios.tsx">
<violation number="1" location="companion/components/LandingPagePicker.ios.tsx:29">
P2: Localize the ActionSheetIOS title/message with t() and add the corresponding translation keys instead of hardcoded strings.</violation>
</file>
<file name="companion/app/(tabs)/(more)/index.ios.tsx">
<violation number="1" location="companion/app/(tabs)/(more)/index.ios.tsx:38">
P3: Localize newly added UI/alert text with `t()` instead of hardcoded strings so the labels and error message are translated consistently.</violation>
</file>
<file name="companion/hooks/useUserPreferences.ts">
<violation number="1" location="companion/hooks/useUserPreferences.ts:22">
P2: User-facing labels are hardcoded instead of using `t()` for localization. Please move these labels to translation keys and call `t()` here (and in the fallback).</violation>
<violation number="2" location="companion/hooks/useUserPreferences.ts:24">
P2: `LANDING_PAGE_OPTIONS` omits the `bookings:upcoming` option even though the type and routing support it, so users can’t select it and labels will fall back incorrectly. Add the missing option.</violation>
</file>
<file name="companion/app/(tabs)/(more)/index.tsx">
<violation number="1" location="companion/app/(tabs)/(more)/index.tsx:134">
P3: Localize the new App Settings and Default Landing Page labels with `t()` and add translation keys, instead of hardcoding text.</violation>
</file>
<file name="companion/components/LandingPagePicker.tsx">
<violation number="1" location="companion/components/LandingPagePicker.tsx:33">
P2: Hardcoded UI text should be localized via `t()`; add a translation key for this heading instead of embedding the English string directly.</violation>
<violation number="2" location="companion/components/LandingPagePicker.tsx:35">
P2: Localize this explanatory text using `t()` and a translation key instead of a hardcoded English sentence.</violation>
<violation number="3" location="companion/components/LandingPagePicker.tsx:68">
P3: Use the existing localized "cancel" string via `t("cancel")` rather than hardcoding the button label.</violation>
</file>
<file name="companion/app/(tabs)/_layout.tsx">
<violation number="1" location="companion/app/(tabs)/_layout.tsx:79">
P2: Localize this tab label via the i18n system (use `t()` with the appropriate translation key) instead of hardcoding the English string.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Devin AI is addressing Cubic AI's review feedbackA Devin session has been created to address the issues identified by Cubic AI. |
There was a problem hiding this comment.
2 issues found across 2 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="companion/app/(tabs)/(more)/index.ios.tsx">
<violation number="1" location="companion/app/(tabs)/(more)/index.ios.tsx:37">
P2: Localize the new success alert text with `t()` instead of hardcoded strings to follow the project’s localization requirement.</violation>
</file>
<file name="companion/app/(tabs)/(more)/index.tsx">
<violation number="1" location="companion/app/(tabs)/(more)/index.tsx:31">
P3: Localize the new success alert text via `t()` instead of hardcoded English strings so the message is translatable.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Devin AI is addressing Cubic AI's review feedbackNew feedback has been sent to the existing Devin session. |
This comment was marked as spam.
This comment was marked as spam.
There was a problem hiding this comment.
6 issues found across 4 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="companion/components/LandingPagePicker.ios.tsx">
<violation number="1" location="companion/components/LandingPagePicker.ios.tsx:29">
P2: Localize this UI string with `t()` instead of hardcoding text so it follows the app’s i18n requirements.</violation>
</file>
<file name="companion/components/LandingPagePicker.tsx">
<violation number="1" location="companion/components/LandingPagePicker.tsx:33">
P3: Localize this new UI string with `t()` and a translation key instead of hard-coding text.</violation>
</file>
<file name="companion/app/(tabs)/(more)/index.ios.tsx">
<violation number="1" location="companion/app/(tabs)/(more)/index.ios.tsx:37">
P2: Localize the new success message with the i18n helper instead of a hardcoded string so it participates in translations.</violation>
<violation number="2" location="companion/app/(tabs)/(more)/index.ios.tsx:171">
P2: Localize this label with the i18n helper instead of hardcoding the text so it can be translated.</violation>
</file>
<file name="companion/app/(tabs)/(more)/index.tsx">
<violation number="1" location="companion/app/(tabs)/(more)/index.tsx:31">
P2: Localize this new success message with `t()` instead of a hardcoded string; add a translation key to the source locale so it can be managed by the i18n workflow.</violation>
<violation number="2" location="companion/app/(tabs)/(more)/index.tsx:143">
P2: Localize this new label with `t()` and add a translation key in the source locale instead of hardcoding the string.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
* remove bg color from empty screen * fix crash v1 * fix done for ios and android * fix lint
There was a problem hiding this comment.
1 issue found across 4 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="companion/app/(tabs)/(bookings)/index.tsx">
<violation number="1" location="companion/app/(tabs)/(bookings)/index.tsx:70">
P2: `lastUrlFilter` is never reset, so subsequent deep links to the same filter value are ignored even when the current filter differs. That prevents URL params from re-syncing the filter after a user changes it.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Devin AI is addressing Cubic AI's review feedbackA Devin session has been created to address the issues identified by Cubic AI. |
…github.com/calcom/cal.com into devin/1769481332-configurable-landing-page
Cubic AI Review - Confidence Score AssessmentI reviewed all Cubic AI comments on this PR to check their confidence scores ( Summary of all Cubic AI confidence scores found:
Result: No Cubic AI comment on this PR has a confidence score of 9/10 or higher. The highest confidence score across all 19 Cubic comments is 8/10. The specific issue flagged for this session ( No code changes were made as none of the issues met the required confidence threshold. |
|
android widget (pushed changes into this pr, i should have created a new pr, sorrry, from next time i will create new ones) Screen.Recording.2026-02-08.at.12.00.16.AM.mov |
apps
Screen.Recording.2026-01-27.at.9.57.44.AM.mov
extension
Screen.Recording.2026-01-27.at.10.02.26.AM.mov
added success alert
Screen.Recording.2026-01-27.at.10.21.31.AM.mov
What does this PR do?
Adds a configurable landing page feature to the companion app, allowing users to choose which page the app opens to on launch. Users can select from Event Types, Bookings, or Bookings with a specific filter (Upcoming, Unconfirmed, Recurring, Past, Cancelled).
Changes:
useUserPreferenceshook for persistent storage of landing page preference usinggeneralStorageLandingPagePickercomponents (Modal for Android/web, native ActionSheetIOS for iOS)Updates since last revision:
try-finallypattern inuseUserPreferenceshook (React Compiler doesn't support TryStatement with finalizer clause)Link to Devin run: https://app.devin.ai/sessions/0d7cf7af9228410ba158026afd3e842d
Requested by: Dhairyashil Shinde (@dhairyashiil)
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Test on both iOS and Android to verify platform-specific picker implementations work correctly.
Checklist
Items for Human Review
(filter as BookingFilter)in bookings index files is safe - an invalid URL param could cause issuesuseUserPreferenceshook