From 8dba0028af4a98788ae5490c454d72bb3dddaea9 Mon Sep 17 00:00:00 2001 From: broisnees Date: Tue, 17 Nov 2026 05:31:23 +0000 Subject: [PATCH] One Sign in button that opens stroke.click; calmer trial screen; sign-out returns to sign-in; better browser callback page --- src-tauri/src/account.rs | 21 ++++++-- .../components/AccountSignInButtons.svelte | 51 +++++++++---------- src/lib/components/LicenseGate.svelte | 13 ++++- src/lib/components/TrialExpiredScreen.svelte | 29 +++++++---- 4 files changed, 71 insertions(+), 43 deletions(-) diff --git a/src-tauri/src/account.rs b/src-tauri/src/account.rs index dd4c5e1c..43801fd9 100644 --- a/src-tauri/src/account.rs +++ b/src-tauri/src/account.rs @@ -601,11 +601,24 @@ pub fn parse_callback(target: &str, expected_state: &str) -> Option { } } +/// The page the browser shows after it hands the sign-in back to the app. +/// `box-sizing` matters: `min-height: 100vh` plus body padding overflowed by +/// the padding and put a scrollbar on a page with one sentence on it. fn callback_page(heading: &str, body: &str) -> String { + let ok = heading.starts_with("You're"); + let failed = heading.contains("didn't"); + // A check for success, a dash for cancelled, an exclamation for a failure. + let (icon, tone) = if ok { + ("", "ok") + } else if failed { + ("", "bad") + } else { + ("", "") + }; format!( - r#"Stroke - -

{heading}

{body}

"# + r#"{heading} · Stroke + +

{heading}

{body}

Stroke
"# ) } @@ -655,7 +668,7 @@ pub async fn wait_for_callback(listener: TcpListener, expected_state: &str) -> R Some(Callback::Code(code)) => { respond(&mut stream, "200 OK", &callback_page( "You're signed in", - "You can close this tab and return to Stroke.", + "Head back to Stroke. You can close this tab.", )).await; return Ok(code); } diff --git a/src/lib/components/AccountSignInButtons.svelte b/src/lib/components/AccountSignInButtons.svelte index 6523d906..71498661 100644 --- a/src/lib/components/AccountSignInButtons.svelte +++ b/src/lib/components/AccountSignInButtons.svelte @@ -1,9 +1,11 @@