forge
Explore
Log in

Don't you dare go Hollow

in-web: tab titles in the family 'Page · in' form (im parity)

Browse files at this commit

a84b9de5e1d0b288a30daf7dacfdee55cf25da35Ahmet Kaan GümüşParent: a125cd5
crates/in-web/src/layout.rsmodified+7 -2
@@ -1128,8 +1128,9 @@ const STYLE: Asset = asset!("assets/main.css");
11281128 pub(crate) async fn document_shell<'a>(
11291129 cx: &'a Cx,
11301130 slot: topcoat::view::Child<'a>,
1131- title: &'a str,
1131+ title: impl Into<String>,
11321132 ) -> Result<impl View + 'a> {
1133+ let title = title.into();
11331134 // The per-user chrome knobs, read off the request's own user: the theme
11341135 // into `data-theme`, the interface into `data-ui`, the language into
11351136 // `<html lang>`. Signed-out (or unreadable) wears the provision defaults —
@@ -1214,6 +1215,10 @@ fn title_key_of(path: &str) -> Option<Key> {
12141215 #[layout("/")]
12151216 async fn root_layout(cx: &Cx, slot: topcoat::view::Child<'_>) -> Result<impl View> {
12161217 let lang = crate::i18n::lang(cx).await;
1217- let title = title_key_of(uri(cx).path()).map_or("in", |key| t(lang, key));
1218+ let title = match title_key_of(uri(cx).path()) {
1219+ None => "in".to_string(),
1220+ Some(Key::WelcomeTitle) => t(lang, Key::WelcomeTitle).to_string(),
1221+ Some(key) => format!("{} · in", t(lang, key)),
1222+ };
12181223 document_shell(cx, slot, title).await
12191224 }
crates/in-web/src/share.rsmodified+1 -0
@@ -685,6 +685,7 @@ async fn public_page(
685685 title: &str,
686686 page: impl View,
687687 ) -> Result<topcoat::router::response::Response> {
688+ let title = format!("{title} · in");
688689 document_shell(cx, topcoat::view::Child::new(page), title)
689690 .await?
690691 .first()