Skip to content

fix(nav): remote admin nodenum + Nav3 consolidation and improvements#5478

Merged
jamesarich merged 4 commits into
mainfrom
jamesarich/fix-remote-admin-nodenum
May 18, 2026
Merged

fix(nav): remote admin nodenum + Nav3 consolidation and improvements#5478
jamesarich merged 4 commits into
mainfrom
jamesarich/fix-remote-admin-nodenum

Conversation

@jamesarich

@jamesarich jamesarich commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Remote admin settings was always showing the locally connected node's config because destNum was not reliably extracted from the navigation backstack. This PR fixes that root cause, then consolidates redundant navigation route types and implements several Nav3 best-practice improvements identified in a thorough audit against official patterns.

Changes

Remote admin fix:

  • Added destNumOverride parameter to getRadioConfigViewModel(), passing args.destNum directly from route args instead of searching the backstack for a parent entry

Navigation graph consolidation:

  • Removed 5 redundant *Graph route types (SettingsGraph, ConnectionsGraph, ChannelsGraph, NodesGraph, ContactsGraph, NodeDetailGraph)
  • Primary routes now implement Graph directly; back button visibility derived from stack position (isTabRoot check)
  • Deep links produce cleaner stacks: [Nodes, NodeDetail(destNum)] instead of [Nodes, NodeDetailGraph(destNum), NodeDetail(destNum)]

Nav3 audit improvements:

  • Added predictivePopTransitionSpec for gesture-driven back animation support
  • Wrapped backStack mutation lambdas in dropUnlessResumed to prevent double-navigation during exit transitions
  • Persisted currentTabRoute across process death using rememberSaveable with a custom CurrentTabSaver
  • Added SharedTransitionLayout wrapper to enable future shared element transitions

Testing

  • Full local verification passes: spotlessApply detekt assembleDebug test allTests
  • Unit tests updated for all route type renames and new MultiBackstack constructor
  • Deep link router tests updated to verify simplified stacks

The getRadioConfigViewModel function relied solely on searching the
NavBackStack for SettingsRoute.Settings to extract destNum. In a
multi-backstack setup, the captured backStack reference passed to
settingsGraph() may not reflect the correct backstack when the entry
composable renders (e.g., navigating to settings from the nodes tab
via remote admin). This caused destNum to resolve to null, falling
back to local node config.

Fix: accept an explicit destNumOverride parameter in
getRadioConfigViewModel and pass the route's destNum directly from
entry<SettingsRoute.Settings> and entry<SettingsRoute.SettingsGraph>
args. Sub-routes continue to use the backstack search as fallback.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the bugfix PR tag label May 18, 2026
@jamesarich jamesarich marked this pull request as draft May 18, 2026 16:24
@jamesarich jamesarich changed the title fix: pass destNum directly from route args in remote admin navigation fix: consolidate settings route and fix remote admin destNum May 18, 2026
Remove the separate SettingsGraph route type and make Settings implement
Graph directly. The back button is now derived from stack position
(isTabRoot check) rather than having two distinct route types.

This simplifies the navigation architecture by:
- Eliminating dual-type backstack search in getRadioConfigViewModel
- Reducing the Settings tab to a single entry point
- Making deep links and tab navigation use the same route type

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamesarich jamesarich changed the title fix: consolidate settings route and fix remote admin destNum fix: pass remote admin destNum directly and consolidate Settings routes May 18, 2026
@jamesarich jamesarich marked this pull request as ready for review May 18, 2026 16:28
jamesarich and others added 2 commits May 18, 2026 11:48
Remove ConnectionsGraph, ChannelsGraph, NodesGraph, and ContactsGraph
route types. Their primary routes (Connections, Channels, Nodes, Contacts)
now implement Graph directly and derive back button visibility from
stack position (isTabRoot check).

This matches the pattern established in the Settings consolidation and
eliminates redundant types that existed solely to distinguish tab-root
from pushed-from-another-tab navigation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add predictivePopTransitionSpec for gesture-driven back animation
- Wrap backStack mutation lambdas in dropUnlessResumed to prevent
  double-navigation during exit transitions
- Persist currentTabRoute across process death using rememberSaveable
  with a custom Saver (CurrentTabSaver)
- Remove redundant NodeDetailGraph route; deep links now push
  [Nodes, NodeDetail(destNum)] directly
- Add SharedTransitionLayout wrapper to enable future shared element
  transitions between navigation scenes
- Update detekt baselines for route type renames

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamesarich jamesarich changed the title fix: pass remote admin destNum directly and consolidate Settings routes fix(nav): remote admin nodenum + Nav3 consolidation and improvements May 18, 2026
@jamesarich jamesarich added this pull request to the merge queue May 18, 2026
Merged via the queue into main with commit df4f10c May 18, 2026
15 checks passed
@jamesarich jamesarich deleted the jamesarich/fix-remote-admin-nodenum branch May 18, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant