You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pages exist within a view, in this page <-> view dependency, somewhere
inside of there, at least for views that are 'flows' or 'wizards,' there
needs to be logic on:
a) when to move to a new page
b) what page to move to.
We are currently handling this navigation logic primarily inside the
definition of a page itself. Inside of the page, we assume a hard-coded
ID for a parent view and call navigation function directly to the view
from within the page itself telling it to:
a) to pop or push
b) the id of the page we want to push.
This is bad because:
1. It creates a dependency between page declarations that does not
need to exist. As in, PageB.qml doesn't really exist unless
PageA.qml includes code to go to it.
2. This prevents us from being able to 'statically' define and
clearly contain pages. Clearly containing pages makes it so that
when we want to reason about PageA.qml, we only have to look
inside of PageA.qml and the components that are used within that
file; we don't have to go on a chase for interlinked dependencies
on id's or properties that are hidden or at least not easy to
find in other pages.
3. We should never assume outside id's from within a page, as these
can change, and when they change, the page that assumes said
outside id is now broken, and debugging can be annoying.
All of this is unnecessary.
In this commit, we address the issue of the logic for navigation being
contained within the page definitions. This proposes a new navigation
model based on signals and first applies it to the onboarding flow.
Pages within our onboarding flow now:
1. Emit a signal when it's time to go to a new page
2. The parent View itself handles the signals and contains the logic
for navigation.
This removes the dependence on having a hardcoded outside ID within a
a page, and is one step to moving us to pages with no dependency on
other pages.
0 commit comments