Skip to content

chore: alias set() onto KaiselNavigator for symmetry with KaiselRouter #73

Description

@Mastersam07

KaiselRouter.set(...) and KaiselNavigator.restoreStack(...) do the same thing under different names.

From context.shell().current you only get a KaiselNavigator, so code that deliberately assigns a branchs stack reads as state restoration:

// "pop this tab back to its root" when the active tab is tapped again
shell.current.restoreStack([DashboardTabRoute(item)]);

versus the equivalent at the root:

router.set([SomeRoute()]);

restoreStack is the right name for its other caller (state restoration), but at a deliberate-assignment call site it misleads — a reviewer reasonably asks what is being restored.

Suggestion

Add set to KaiselNavigator as an alias for restoreStack, or rename for symmetry and keep the old name deprecated for a release. Small, but it is on the path anyone building a branched shell with "tap active tab to reset" behaviour will walk.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions