Skip to content

more navi deeplinking changes#238

Open
AbigailLabanok wants to merge 3 commits intocuappdev:mainfrom
AbigailLabanok:abby/navi-intents-pt2
Open

more navi deeplinking changes#238
AbigailLabanok wants to merge 3 commits intocuappdev:mainfrom
AbigailLabanok:abby/navi-intents-pt2

Conversation

@AbigailLabanok
Copy link
Copy Markdown

@AbigailLabanok AbigailLabanok commented Apr 23, 2026

Overview

Added deeplinking changes for navhost

Changes Made

added

  • overriden onNewIntent() function into MainActivty to handle intents
  • deepLinks parameter into composable for eatery_detail screens

Summary by CodeRabbit

Release Notes

  • New Features

    • Added deep link support for eatery details, enabling direct navigation to specific eateries through shared links and external intents
  • Improvements

    • Enhanced intent handling to ensure proper app state management when receiving navigation requests

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

Warning

Rate limit exceeded

@AbigailLabanok has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 49 minutes and 5 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 49 minutes and 5 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 15f3c6d2-dbaf-4c44-b2a4-a61348c54909

📥 Commits

Reviewing files that changed from the base of the PR and between 3c81ac2 and ba02d32.

📒 Files selected for processing (2)
  • app/src/main/java/com/cornellappdev/android/eatery/MainActivity.kt
  • app/src/main/java/com/cornellappdev/android/eatery/ui/navigation/MainTabbedNavigation.kt
📝 Walkthrough

Walkthrough

Adds deep link support to the Eatery app by implementing an onNewIntent override in MainActivity to update the activity's intent when new intents arrive, and configuring the EATERY_DETAIL navigation route to accept deep link URIs with the format eatery://eatery_detail/{eateryId}.

Changes

Cohort / File(s) Summary
Deep Link Intent Handling
app/src/main/java/com/cornellappdev/android/eatery/MainActivity.kt
Adds onNewIntent override to update the stored intent via setIntent(intent) when the activity receives new intents, enabling proper deep link routing.
Navigation Deep Link Configuration
app/src/main/java/com/cornellappdev/android/eatery/ui/navigation/MainTabbedNavigation.kt
Associates the EATERY_DETAIL route with a navDeepLink URI scheme pattern (eatery://eatery_detail/{eateryId}) to enable deep link navigation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Poem

🐰 A link so deep, through eateries we hop,
With intents renewed, our journey won't stop,
Deep URIs guide us to detail so bright,
eatery://eatery_detail shining light! 🥕✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive Title mentions 'navi deeplinking changes' which aligns with the PR objectives, but uses abbreviation and vague phrasing like 'more changes' that doesn't precisely convey the specific modifications. Improve clarity by using complete terms and being more specific about what was added, e.g., 'Add deep link handling for eatery detail navigation' or 'Implement onNewIntent override for deep link support'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description includes Overview and Changes Made sections from the template, covering the main objectives, but lacks Test Coverage and other sections from the template structure.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/src/main/java/com/cornellappdev/android/eatery/MainActivity.kt`:
- Around line 159-162: The onNewIntent override currently only calls
setIntent(intent) and doesn't forward deep-link intents to the NavHost; update
the flow so new intents are passed to NavController.handleDeepLink(intent).
Expose the NavHostController created in NavigationSetup (e.g., return or hoist a
remember { NavHostController(...) } or store it in a mutableState/holder that
MainActivity can access) or alternatively have NavigationSetup observe a shared
state/channel for incoming intents; then, in MainActivity.onNewIntent(intent)
call that shared holder or directly call navController.handleDeepLink(intent) to
ensure deep-link navigation is processed on subsequent intents.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9f4164db-a589-49d4-a655-ce58cf957368

📥 Commits

Reviewing files that changed from the base of the PR and between ee1dfc0 and 3c81ac2.

📒 Files selected for processing (2)
  • app/src/main/java/com/cornellappdev/android/eatery/MainActivity.kt
  • app/src/main/java/com/cornellappdev/android/eatery/ui/navigation/MainTabbedNavigation.kt

Comment thread app/src/main/java/com/cornellappdev/android/eatery/MainActivity.kt
@caleb-bit caleb-bit self-requested a review April 23, 2026 17:34
Copy link
Copy Markdown
Contributor

@caleb-bit caleb-bit left a comment

Choose a reason for hiding this comment

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

Looks good! I left a minor nit about concurrency stuff, but I don't think it's a huge bug.

override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
setIntent(intent)
navController?.handleDeepLink(intent)
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.

Nit: I think setContent schedules the composition of the content that it's passed, so there's no guarantee of sequential execution, meaning the navController assignment might actually happen after this line is called. You could consider storing the pending intent and handling it if/when navController is initialized. Nonetheless, this is likely a really rare race condition, so it's probably not too consequential. @AndrewCheung360 can weigh in.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agreed. Ideally, we would want to make sure that the navcontroller has been initialized first since there isn't a guarantee, so pending intents would make sense

authTokenRepository.getTokens()
}

override fun onNewIntent(intent: Intent) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since handleDeepLink is only called in onNewIntent and not in onCreate, would there be any issues with it not being handled if Navi tries to open the app but it is closed and not running the background? Not sure if this is the case, but you can ignore if it has been tested and works.

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.

Yes in that case only onCreate is called, so I think we might need to do something like this.

Copy link
Copy Markdown
Member

@AndrewCheung360 AndrewCheung360 left a comment

Choose a reason for hiding this comment

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

Approved, but left some comments. I would probably do some testing by having both the dev builds of eatery and navi installed on your emulator and seeing if you can open eatery from navi if you haven't already. Would recommend adding screen recordings to the PRs for better verification.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants