forge
Explore
Log in

Don't you dare go Hollow

in-web: signed-out default light (family parity), uppercase labels via CSS

Browse files at this commit

a125cd5000189c1163f9b1bdbd498a44f4ff8cadAhmet Kaan GümüşParent: aa7d6b2
crates/in-web/src/layout.rsmodified+3 -2
@@ -1133,13 +1133,14 @@ pub(crate) async fn document_shell<'a>(
1133 // The per-user chrome knobs, read off the request's own user: the theme1133 // The per-user chrome knobs, read off the request's own user: the theme
1134 // into `data-theme`, the interface into `data-ui`, the language into1134 // into `data-theme`, the interface into `data-ui`, the language into
1135 // `<html lang>`. Signed-out (or unreadable) wears the provision defaults —1135 // `<html lang>`. Signed-out (or unreadable) wears the provision defaults —
1136- // dark and instrument — and the language falls back to `Accept-Language`.1136+ // light and instrument, matching im and iz — and the language falls back
1137+ // to `Accept-Language`.
1137 let me = match current_user(cx).await {1138 let me = match current_user(cx).await {
1138 Ok(user) => user.as_ref(),1139 Ok(user) => user.as_ref(),
1139 Err(_) => None,1140 Err(_) => None,
1140 };1141 };
1141 let asking = me.is_some();1142 let asking = me.is_some();
1142- let dark = me.as_ref().is_none_or(|user| user.theme == "dark");1143+ let dark = me.as_ref().is_some_and(|user| user.theme == "dark");
1143 let ui = me.as_ref().map_or("instrument", |user| user.ui.as_str());1144 let ui = me.as_ref().map_or("instrument", |user| user.ui.as_str());
1144 let lang = crate::i18n::lang(cx).await;1145 let lang = crate::i18n::lang(cx).await;
1145 1146
crates/in-web/tests/http.rsmodified+3 -3
@@ -4845,13 +4845,13 @@ impl TestApp {
4845 #[tokio::test]4845 #[tokio::test]
4846 async fn signed_out_settings_falls_back_to_accept_language() {4846 async fn signed_out_settings_falls_back_to_accept_language() {
4847 let app = TestApp::build().await;4847 let app = TestApp::build().await;
4848-4848+ // No header: English chrome on a light instrument shell.
4849- // No header: English chrome on a dark instrument shell.
4850 let page = app.get("/settings", None).await;4849 let page = app.get("/settings", None).await;
4851 assert_eq!(page.status, StatusCode::OK, "{}", page.text());4850 assert_eq!(page.status, StatusCode::OK, "{}", page.text());
4852 assert!(page.text().contains("lang=\"en\""), "{}", page.text());4851 assert!(page.text().contains("lang=\"en\""), "{}", page.text());
4852+ // Signed-out wears the family default: a light instrument shell.
4853 assert!(4853 assert!(
4854- page.text().contains("data-theme=\"dark\""),4854+ !page.text().contains("data-theme=\"dark\""),
4855 "{}",4855 "{}",
4856 page.text()4856 page.text()
4857 );4857 );
style/main.scssmodified+2 -0
@@ -625,6 +625,7 @@ a {
625 font-size: 10px;625 font-size: 10px;
626 letter-spacing: 0.08em;626 letter-spacing: 0.08em;
627 color: var(--muted-soft);627 color: var(--muted-soft);
628+ text-transform: uppercase;
628 }629 }
629 630
630 // The address an invited member signs in as: shown, never edited.631 // The address an invited member signs in as: shown, never edited.
@@ -3350,6 +3351,7 @@ img.avatar {
3350 font-size: 10px;3351 font-size: 10px;
3351 letter-spacing: 0.08em;3352 letter-spacing: 0.08em;
3352 color: var(--muted-soft);3353 color: var(--muted-soft);
3354+ text-transform: uppercase;
3353 }3355 }
3354 3356
3355 // A read-only value under a field label — the profile's name, address and3357 // A read-only value under a field label — the profile's name, address and