-
Notifications
You must be signed in to change notification settings - Fork 11.7k
feat(companion): add configurable landing page #27267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
|
One risk I’m thinking about Not blocking i just curious |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
|
@dhairyashiil That makes sense thanks for clarifying The reason I asked is Ive been experimenting with a lightweight CI check that flags when a narrow hook starts accumulating architectural responsibility over time not to block changes but to force this exact conversation and leave a record if its consciously overridden If it’s useful I can run it once on this PR and share what it would flag |
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