Wire the launch screen into the app
The app now opens on the login screen when there is nothing else to show
— no local paths and no configured library — and goes straight to the
images otherwise. Making someone click past a login they already
completed is pure friction.
launch.slint imported by app.slint, replacing the window rather
than overlaying it: there is no library to look at
until an account is configured
launch_ui.rs the Slint wiring, kept out of lib.rs so the launch
flow can change without touching the develop window
Login runs on a worker thread and posts results back through a channel,
since Slint's event loop is single-threaded and a 20-minute browser wait
cannot block it. The system browser is opened via xdg-open, never an
embedded webview (FR-NC-1).
Sign-out deletes the local credential even if server-side revocation
fails: a network error must not leave a usable secret on the machine.
Format tick-boxes persist on each toggle, so a selection survives a
crash before the library is opened.
Two things deliberately incomplete rather than faked:
- "Choose folder" lists the account's folders and reports them, but
there is no picker widget yet, so selection still happens via the
connect example.
- "Open library" logs the request. Opening a remote library needs the
scan-and-cache path, which belongs with the catalog work in flight.
Earlier I broke the other in-flight dr-ui work by calling
slint_build::compile twice, which replaces the generated module. The
correct wiring is an import inside app.slint, which is what this does.
30 dr-ui tests passing; both launch paths verified by running the app.
This commit is contained in:
+51
-1
@@ -1,5 +1,6 @@
|
||||
import { Theme } from "theme.slint";
|
||||
import { AdjustPanel, ParamRow } from "adjust.slint";
|
||||
import { LaunchScreen } from "launch.slint";
|
||||
|
||||
// Status strip — surfaces the GPU backend and adapter, which matters during
|
||||
// v0.1 because assumption A1 is exactly "does this compositing path work on
|
||||
@@ -137,6 +138,30 @@ export component AppWindow inherits Window {
|
||||
in property <int> total: 0;
|
||||
in property <string> load-error: "";
|
||||
|
||||
// --- launch screen (FR-NC-1, FR-NC-4) ---
|
||||
//
|
||||
// The app opens here when no library is configured, and returns here to
|
||||
// sign out or switch account.
|
||||
in property <bool> show-launch: false;
|
||||
in property <bool> launch-signed-in: false;
|
||||
in property <string> launch-account: "";
|
||||
in property <string> launch-root: "";
|
||||
in property <string> launch-server: "";
|
||||
in property <bool> launch-busy: false;
|
||||
in property <string> launch-status: "";
|
||||
in property <string> launch-error: "";
|
||||
in property <string> launch-login-url: "";
|
||||
in property <bool> launch-can-remember: true;
|
||||
in-out property <[string]> launch-format-labels;
|
||||
in-out property <[bool]> launch-format-checked;
|
||||
|
||||
callback launch-sign-in(string);
|
||||
callback launch-sign-out();
|
||||
callback launch-choose-folder();
|
||||
callback launch-open-library();
|
||||
callback launch-format-toggled(int, bool);
|
||||
callback launch-copy-url();
|
||||
|
||||
callback next-image();
|
||||
callback prev-image();
|
||||
|
||||
@@ -164,7 +189,32 @@ export component AppWindow inherits Window {
|
||||
// One-way: report width outward, never read layout back into it.
|
||||
changed width => { root.window-resized(self.width); }
|
||||
|
||||
VerticalLayout {
|
||||
// The launch screen replaces the whole window rather than overlaying it:
|
||||
// there is no library to look at until an account is configured.
|
||||
if root.show-launch: LaunchScreen {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
signed-in: root.launch-signed-in;
|
||||
account: root.launch-account;
|
||||
library-root: root.launch-root;
|
||||
server-url: root.launch-server;
|
||||
busy: root.launch-busy;
|
||||
status: root.launch-status;
|
||||
error: root.launch-error;
|
||||
login-url: root.launch-login-url;
|
||||
can-remember: root.launch-can-remember;
|
||||
format-labels: root.launch-format-labels;
|
||||
format-checked: root.launch-format-checked;
|
||||
|
||||
sign-in(server) => { root.launch-sign-in(server); }
|
||||
sign-out() => { root.launch-sign-out(); }
|
||||
choose-folder() => { root.launch-choose-folder(); }
|
||||
open-library() => { root.launch-open-library(); }
|
||||
format-toggled(i, on) => { root.launch-format-toggled(i, on); }
|
||||
copy-login-url() => { root.launch-copy-url(); }
|
||||
}
|
||||
|
||||
if !root.show-launch: VerticalLayout {
|
||||
StatusBar {
|
||||
adapter: root.adapter;
|
||||
backend: root.backend;
|
||||
|
||||
Reference in New Issue
Block a user