Skip to content

Conversation

qiarie
Copy link
Contributor

@qiarie qiarie commented Jun 20, 2025

IMPORTANT: Where possible all PRs must be linked to a Github issue

Fixes [link to issue]

Engineer Checklist

  • I have written Unit tests for any new feature(s) and edge cases for bug fixes
  • I have added any strings visible on UI components to the strings.xml file
  • I have updated the CHANGELOG.md file for any notable changes to the codebase
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the project's style guide
  • I have built and run the FHIRCore app to verify my change fixes the issue and/or does not break the app
  • I have checked that this PR does NOT introduce breaking changes that require an update to Content and/or Configs? If it does add a sample here or a link to exactly what changes need to be made to the content.

Code Reviewer Checklist

  • I have verified Unit tests have been written for any new feature(s) and edge cases
  • I have verified any strings visible on UI components are in the strings.xml file
  • I have verifed the CHANGELOG.md file has any notable changes to the codebase
  • I have verified the solution has been implemented in a configurable and generic way for reuseable components
  • I have built and run the FHIRCore app to verify the change fixes the issue and/or does not break the app

@qiarie qiarie requested a review from ellykits June 20, 2025 08:19
Copy link

codecov bot commented Jun 20, 2025

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.0%. Comparing base (aaebbb6) to head (1920a9f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...fhircore/quest/util/extensions/ConfigExtensions.kt 0.0% 10 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main   #3755     +/-   ##
=========================================
- Coverage     25.0%   25.0%   -0.1%     
  Complexity     844     844             
=========================================
  Files          297     297             
  Lines        16102   16107      +5     
  Branches      2689    2690      +1     
=========================================
  Hits          4038    4038             
- Misses       11580   11585      +5     
  Partials       484     484             
Flag Coverage Δ
engine 60.9% <ø> (ø)
geowidget 18.5% <ø> (ø)
quest 4.6% <0.0%> (-0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...fhircore/quest/util/extensions/ConfigExtensions.kt 0.0% <0.0%> (ø)

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dubdabasoduba dubdabasoduba requested a review from Copilot June 20, 2025 08:59
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue with back navigation when launching the same fragment by adjusting the navigation options configuration.

  • Removed the unnecessary else clause and replaced it with a clear early return for same register navigation.
  • Introduced a NavOptions.Builder() with setLaunchSingleTop(true) and conditional pop-up behavior based on the current back stack state.

Comment on lines 163 to 177
val navOptionsBuilder = NavOptions.Builder().setLaunchSingleTop(true)

if (
actionConfig.popNavigationBackStack == true &&
navController.currentBackStackEntry?.destination?.id != MainNavigationScreen.Home.route
) {
navController.currentBackStackEntry?.destination?.id?.let {
navOptionsBuilder.setPopUpTo(it, inclusive = true)
}
}

navController.navigate(
resId = MainNavigationScreen.Home.route,
args = args,
navOptions = navOptionsBuilder.build(),
Copy link

Copilot AI Jun 20, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider extracting the navigation options configuration into a helper method to improve readability and ease future modifications.

Copilot uses AI. Check for mistakes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This nitpick is a valid review. Refactor this by extracting the functionality into its own method.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@FikriMilano Did you get a chance to test this functionality?

@Rkareko
Copy link
Contributor

Rkareko commented Jun 25, 2025

@qiarie could you fix the CI failures.

@qiarie qiarie marked this pull request as draft June 25, 2025 09:06
@qiarie qiarie marked this pull request as ready for review June 30, 2025 20:41
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.

4 participants