New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 1845409 - File RFC 0010 proposing handling navigation through middleware #4126
Bug 1845409 - File RFC 0010 proposing handling navigation through middleware #4126
Conversation
f31d616
to
1c8de2d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fair to me!
I reviewed the code in Focus to see how it connects the AppStore to an activity that has a lifetime, and I think that flow makes sense for Fenix too for only navigations that that are coming from HomeActivity
.
I'm curious to see a prototype of this though and if it plays well with the navgraph library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all makes sense to me. What would be the next steps? Do you have v0.1 or v1 of what this effort looks like?
I would like to get a small prototype together in the next few days focused on tackling the bug this is filed against. I'll announce more broadly when I get something together |
I worked up a basic prototype that can be found at #4323 |
I've updated the proposal based on offline conversations with the team in our weekly sync meeting. I've left the original proposal as a separate commit for now for context. |
@MatthewTighe, should this be moved out of draft? Did the Debug Drawer navigation help inform some of this direction? Also, will the prototype PR be updated at all? |
Yeah, I will move this out of draft shortly. Was getting a draft pass from @boek offline.
The Debug Drawer, Review Checker, and History fragment refactor all helped inform this, yes.
Yes, I can update the prototype PR |
@MozillaNoah Instead of dealing with a messy diff to update the previous prototype, I've drafted a new one |
Approval on first proposal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job with the updates!
next(action) | ||
when (action) { | ||
is HomeButtonClicked -> getNavController().navigate(R.id.home_fragment) | ||
is HistoryGroupClicked -> getNavController().navigate(R.id.history_metadata_fragment) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: indent missing? I think the original example have the same issue. Maybe the override fun invoke(
part have too much indent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, apparently Android Studio used actual unexpanded tab characters any time I copied a line with a tab in it. Haven't run into a tabs v spaces problem in a longggggg time 😆
e7f3daa
to
5ccfb67
Compare
5ccfb67
to
16e91ee
Compare
|
||
## Summary | ||
|
||
Following the acceptance of [0009 - Remove Interactors and Controllers](0009-remove-interactors-and-controllers), Fenix should have a method of navigation that is tied to the `lib-state` model to provide a method of handling navigation side-effects that is consistent with architectural goals. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is consistent with architectural goals.
nit: Is there documentation that you can link here to outline the architectural goals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, updated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👌
} | ||
``` | ||
|
||
### 3. The special case of `openToBrowserAndLoad` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
Looks good, no objections from me 🙂 having a consistent method for handling the various aspects of navigation would certainly be beneficial. Appreciate the demo provided too. My only immediate concern is around the defined use cases and how clear the boundaries of responsibility are e.g handling telemetry and other various side effects, but I don't think it's reasonable for you to anticipate all use cases upfront |
16e91ee
to
b985a89
Compare
This patch includes an RFC for a new architectural goal of handling navigation through middleware moving forward. Currently, there are two commits.
The first proposal seemed suboptimal after offline conversations with the team, so I've reworked it accordingly. It's included here for context.
Tentative deadline is Feb 2nd.
GitHub Automation
https://bugzilla.mozilla.org/show_bug.cgi?id=1845409