[WSL] Allows conditionally skipping the SelectLanguagePage #1270
[WSL] Allows conditionally skipping the SelectLanguagePage #1270
Conversation
Asks the server whether the language is C.UTF-8 (the Ubuntu rootfs default) or not.
Sets the appModel.value after the last future. Ensures atomic delivery. It now depends on whether Subiquity has any pre configured language. To be 100% sure we need to set the initial route via CLI. The case for integration test.
This screen is shown due the language not being configured in the server. Thus no reason for a GET. It will return C.UTF-8.
Downwards in the widget tree via Provider. The value passed cannot alter the original ValueListenable.
1a878dd
to
7accfbf
Compare
Server can only be considered up if we have a server variant. It would be waste to make a client.variant() call in here. The AppModel has the answer.
Through a ChangeNotifierProxyProvider. Updates in the value published from main triggers the view model.
7accfbf
to
20ae8bc
Compare
Hmm, we should expose the auto-install HTTP headers for our SubiquityClient responses. Those headers would tell whether endpoints are configured. |
I believe this would simplify a lot this use case and many others for the desktop installer in the future. |
Should we wrap all return values with |
EIther Future<SubiquityResponse<String>> localeWithStatus() {
...
}
Future<String> locale() {
...
} The alternative seems to be less intrusive and allows for a smoother transition. After all, not all |
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.
LGTM 👍
Setting up WSL results in an Ubuntu environment with locale set to
C.UTF-8
by default. So, if aGET
request returns anything different from that value it means the server acknowledged some configuration data for the language, such as when the prefill information file is passed via command line. In such scenarios Subiquity configures the locale controller, so clients can skip the language selection page.This PR leverages that to skip the
SelectLanguagePage
conditionally. Two consequences unfold:selectLanguage
to be the default initial route andparseLocale
sets the UI in English.Those consequences are reflected in the changes herein submitted to the test code.
Skipping that page on the Windows entry point, where it has to pass through the
InstallationSlidesPage
was a bit more evolving, because the decision of whether theSelectLanguagePage
could be skipped or not could only be taken close to the moment when the slides page kicks itself out of the stage.InstallationSlidesModel
now requires knowing about theAppModel
. Thus the AppModel is now passed via aValueListenableProvider
, which carefully exposes the current value, without exposing the listenable object itself. That combined with theChangeNotifierProxyProvider
allows the view model to be in sync with theAppModel
without being able to trigger the listenable object by accident.