[Android] Back navigation broken on foldables after switching conversations on large screen

Resolved 💬 2 comments Opened May 7, 2026 by lyu-xg Closed May 10, 2026

Summary

On Android foldable devices, the back stack accumulated by switching between conversations on the large (unfolded) screen does not collapse when the device folds back to the small screen. Pressing the system back button cycles through previously visited conversations instead of returning to the conversation list that the small-screen layout shows as the parent destination.

Steps to reproduce

  1. Open Claude Code on an Android foldable, unfolded (large screen / multi-pane list-detail layout, conversations list visible on the left).
  2. Tap conversation A, then B, then C. Each one becomes the active detail pane.
  3. Fold the device to the small screen (single-pane layout — only the active conversation is visible, with the conversations list reachable via back).
  4. Press the system back button.

Expected

A single back press returns to the conversation list (the parent destination visible in the small-screen layout).

Actual

Each back press pops one entry off the conversation-switch back stack: C → B → A → list. Three back presses to return from a state where the small-screen layout shows no in-app history at all.

Why this is a foldable-specific bug

In the multi-pane (large-screen) layout, switching the detail pane does not move the user away from a \"conversation list\" parent — both panes are visible simultaneously. Switching detail conversations on large screen should therefore not contribute back-stack entries that the small-screen layout will later treat as ancestors. Android's recommended pattern (\SupportingPaneScaffold\ / \ListDetailPaneScaffold\ with \BackNavigationBehavior\) handles this by collapsing detail-pane history on layout-class transitions.

Environment

  • Claude Code Android client
  • Foldable device (e.g. Pixel Fold, Samsung Galaxy Z Fold, Surface Duo)
  • Triggered by transition from \WindowWidthSizeClass.Expanded\ → \WindowWidthSizeClass.Compact\ while a non-list destination is active.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗