Skip to content

feat(navigation): Navigate back to list view on tab reselection#3948

Merged
jamesarich merged 1 commit into
mainfrom
fix/nav-toplevel
Dec 10, 2025
Merged

feat(navigation): Navigate back to list view on tab reselection#3948
jamesarich merged 1 commit into
mainfrom
fix/nav-toplevel

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

This commit enhances the user experience in list-detail views by allowing users to navigate back to the list pane when re-selecting the currently active tab.

If the user is viewing a detail screen (e.g., a specific conversation or node details) and taps the corresponding tab in the bottom navigation bar again, the app will now navigate back to the list view for that section. This provides an intuitive way to return to the list without using the back button.

  • Implemented a LaunchedEffect in AdaptiveContactsScreen and AdaptiveNodeListScreen to listen for tab reselection events.
  • When a ScrollToTopEvent for the current tab is received while on a detail pane, it triggers a back navigation to the list pane.
  • Updated UIStateViewModel to use MutableSharedFlow instead of Channel for emitting scroll-to-top events, ensuring better event handling.

resolves #3926

This commit enhances the user experience in list-detail views by allowing users to navigate back to the list pane when re-selecting the currently active tab.

If the user is viewing a detail screen (e.g., a specific conversation or node details) and taps the corresponding tab in the bottom navigation bar again, the app will now navigate back to the list view for that section. This provides an intuitive way to return to the list without using the back button.

- Implemented a `LaunchedEffect` in `AdaptiveContactsScreen` and `AdaptiveNodeListScreen` to listen for tab reselection events.
- When a `ScrollToTopEvent` for the current tab is received while on a detail pane, it triggers a back navigation to the list pane.
- Updated `UIStateViewModel` to use `MutableSharedFlow` instead of `Channel` for emitting scroll-to-top events, ensuring better event handling.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@github-actions github-actions Bot added the bugfix PR tag label Dec 10, 2025
@codecov

codecov Bot commented Dec 10, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.52%. Comparing base (05dae2e) to head (742b2aa).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...eksville/mesh/ui/contact/AdaptiveContactsScreen.kt 0.00% 8 Missing ⚠️
.../geeksville/mesh/ui/node/AdaptiveNodeListScreen.kt 0.00% 8 Missing ⚠️
...src/main/java/com/geeksville/mesh/model/UIState.kt 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #3948      +/-   ##
========================================
- Coverage   0.52%   0.52%   -0.01%     
========================================
  Files        394     394              
  Lines      23145   23161      +16     
  Branches    2933    2939       +6     
========================================
  Hits         122     122              
- Misses     23002   23018      +16     
  Partials      21      21              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jamesarich jamesarich added this pull request to the merge queue Dec 10, 2025
Merged via the queue into main with commit 03ed85d Dec 10, 2025
8 checks passed
@jamesarich jamesarich deleted the fix/nav-toplevel branch December 10, 2025 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: navbar chat icon, should return to top level when in conversation

1 participant