fix(back): don't short-circuit side-nav back chain to home

The side-nav host's onSystemBack called _handleMainBack on the system
route-pop path, jumping straight to the home tab and skipping the dpad
back chain (content -> top tabs -> sidebar). Restore the original inert
behavior: canPop:false blocks the route-pop and the key path owns the
chain; the host still closes an open sheet on back. Bottom-nav unchanged.
This commit is contained in:
edde746
2026-06-07 10:05:57 +02:00
parent 4728564e0c
commit 273d0c7985
+5 -11
View File
@@ -1588,18 +1588,12 @@ class _MainScreenState extends State<MainScreen>
return OverlaySheetHost(
onOpenChanged: _handleOverlaySheetOpenChanged,
// The host owns sheet + system back. canPop:false because the dpad
// back is handled by the key path below; onSystemBack mirrors it for
// a pure popRoute (focus sidebar first, otherwise home/exit).
// canPop:false blocks the system route-pop (matching the old inert
// PopScope). The dpad/key back chain (content → top tabs → sidebar →
// home) is owned entirely by the key path below; there is NO
// onSystemBack because a pure popRoute must not short-circuit that
// chain to home. The host still closes an open sheet on system back.
canPop: false,
onSystemBack: () {
if (BackKeyCoordinator.consumeIfHandled()) return;
if (!_isSidebarFocused) {
_focusSidebar();
return;
}
_handleMainBack();
},
child: Focus(
onKeyEvent: (node, event) {
final fullscreenResult = _handleFullscreenShortcut(event);