Skip to content

fix: register a dusk navigate adapter so ext.dusk.navigate drives GoRouter#6

Open
anilcancakir wants to merge 1 commit into
masterfrom
fix/register-dusk-navigate-adapter
Open

fix: register a dusk navigate adapter so ext.dusk.navigate drives GoRouter#6
anilcancakir wants to merge 1 commit into
masterfrom
fix/register-dusk-navigate-adapter

Conversation

@anilcancakir

Copy link
Copy Markdown
Contributor

Fixes REPORT friction items #8, #13.

MagicDuskIntegration.install() registered 14 enrichers but no navigate adapter, so dusk:navigate --route was a no-op on GoRouter apps (it fell back to an ignored SystemNavigator broadcast). Registers an adapter via DuskPlugin.registerNavigateAdapter that calls MagicRouter.instance.to(path), returning false on an uninitialised router (StateError).

TDD. analyze 0, format 0-diff, flutter test 86 pass. The frozen dusk typedef is registered through, not modified; uses .to (path), not .toNamed.

…outer

MagicDuskIntegration.install() registered enrichers but no navigate adapter, so dusk:navigate --route was a no-op on GoRouter apps (it fell back to an ignored SystemNavigator broadcast). Registers an adapter via DuskPlugin.registerNavigateAdapter that calls MagicRouter.instance.to(path), returning false on an uninitialised router (#8, #13).
Copilot AI review requested due to automatic review settings June 24, 2026 23:47
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes ext.dusk.navigate --route for GoRouter-based Magic apps by registering a Dusk navigate adapter during MagicDuskIntegration.install(), so Dusk navigation drives MagicRouter instead of falling back to the (ignored) SystemNavigator broadcast.

Changes:

  • Register a DuskPlugin navigate adapter that calls MagicRouter.instance.to(path) and returns false when the router is not yet initialized (catches StateError).
  • Clear the navigate adapter in MagicDuskIntegration.resetForTesting() for clean test isolation.
  • Add integration tests covering adapter registration, reset behavior, and successful/unsuccessful navigation.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
test/dusk_integration_test.dart Adds widget + unit tests to validate navigate adapter registration, behavior, and reset semantics.
lib/src/dusk_integration.dart Registers/clears the Dusk navigate adapter as part of the Magic↔Dusk integration lifecycle.
CHANGELOG.md Documents the new navigate adapter behavior in the Unreleased section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants