Skip to content

fix(mobile): handle GO_BACK navigation error with safe fallback - #40

Merged
Talljack merged 1 commit into
mainfrom
fix/listen-practice-back-navigation
Apr 22, 2026
Merged

Talljack merged 1 commit into
mainfrom
fix/listen-practice-back-navigation

Conversation

@Talljack

Copy link
Copy Markdown
Owner

Summary

Fixes the "The action 'GO_BACK' was not handled by any navigator" error that occurs when clicking the back button in practice screens when there's no navigation history.

Problem

When users navigate directly to a practice screen (e.g., via deep link or direct URL), clicking the back button throws an error because router.back() fails when there's no previous screen in the navigation stack.

Solution

All router.back() calls now check router.canGoBack() first and fallback to router.replace() to the appropriate tab screen when no navigation history exists:

  • Listen practice → /(tabs)/listen
  • Read practice → /(tabs)/read
  • Speak conversation → /(tabs)/speak
  • Write practice → /(tabs)/write

Changes

  • ✅ Listen practice screen (/practice/listen/[id])
  • ✅ Read practice screen (/practice/read/[id])
  • ✅ Speak conversation screen (/practice/speak/conversation)
  • ✅ Write practice screen (/practice/write/[id])

Test Plan

  • Navigate to practice screen with history → back button works
  • Navigate to practice screen without history → fallback to tab screen
  • Complete practice and rate → navigation works correctly
  • Click back in header → safe navigation
  • Content not found screen → safe navigation

🤖 Generated with Claude Opus 4.7

Fix "The action 'GO_BACK' was not handled by any navigator" error in practice screens.
All router.back() calls now check canGoBack() first and fallback to router.replace()
to the appropriate tab screen when no navigation history exists.

Affected screens:
- Listen practice (/practice/listen/[id])
- Read practice (/practice/read/[id])
- Speak conversation (/practice/speak/conversation)
- Write practice (/practice/write/[id])

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
echo-type Building Building Preview, Comment Apr 22, 2026 4:24pm

@Talljack
Talljack merged commit 2a7a4eb into main Apr 22, 2026
4 of 5 checks passed
@Talljack
Talljack deleted the fix/listen-practice-back-navigation branch April 22, 2026 16:24

This branch was successfully deployed

1 active deployment
Preview — ddd5d290 Deployed Apr 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant