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 @@