in-web: tab titles in the family 'Page · in' form (im parity)
Browse files at this commita84b9de5e1d0b288a30daf7dacfdee55cf25da35Parent: a125cd52 changed files +8 -2
crates/in-web/src/layout.rsmodified+7 -2
| @@ -1128,8 +1128,9 @@ const STYLE: Asset = asset!("assets/main.css"); | ||
| 1128 | 1128 | pub(crate) async fn document_shell<'a>( |
| 1129 | 1129 | cx: &'a Cx, |
| 1130 | 1130 | slot: topcoat::view::Child<'a>, |
| 1131 | - title: &'a str, | |
| 1131 | + title: impl Into<String>, | |
| 1132 | 1132 | ) -> Result<impl View + 'a> { |
| 1133 | + let title = title.into(); | |
| 1133 | 1134 | // The per-user chrome knobs, read off the request's own user: the theme |
| 1134 | 1135 | // into `data-theme`, the interface into `data-ui`, the language into |
| 1135 | 1136 | // `<html lang>`. Signed-out (or unreadable) wears the provision defaults — |
| @@ -1214,6 +1215,10 @@ fn title_key_of(path: &str) -> Option<Key> { | ||
| 1214 | 1215 | #[layout("/")] |
| 1215 | 1216 | async fn root_layout(cx: &Cx, slot: topcoat::view::Child<'_>) -> Result<impl View> { |
| 1216 | 1217 | 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 | + }; | |
| 1218 | 1223 | document_shell(cx, slot, title).await |
| 1219 | 1224 | } |
crates/in-web/src/share.rsmodified+1 -0
| @@ -685,6 +685,7 @@ async fn public_page( | ||
| 685 | 685 | title: &str, |
| 686 | 686 | page: impl View, |
| 687 | 687 | ) -> Result<topcoat::router::response::Response> { |
| 688 | + let title = format!("{title} · in"); | |
| 688 | 689 | document_shell(cx, topcoat::view::Child::new(page), title) |
| 689 | 690 | .await? |
| 690 | 691 | .first() |