git-ents.gitmain
⌘K
foforge
commit 2d7902e
fix: give each repo tab its own browser tab title

Files, Tree, Releases, Checks, Issues, and Settings all rendered the same <title>, so every open browser tab for a repo read identically and a path deep in Files gave no more title context than the repo root. Files/Tree/Blob now include the selected path, and the section-only tabs are prefixed with their section name, both ahead of the repo name.

Assisted-by: Claude:claude-sonnet-5

Joseph D. Carpinelli · 1 month ago

Reviews

No reviews of this commit yet — record a verdict below.

Start a review

verdict

crates/git-ents-server/src/web/pages.rs @@ -355,10 +355,15 @@ }; let name = meta.name(); + let title = if selected.is_empty() { + format!("Files · {name}") + } else { + format!("{selected} · {name}") + }; repo_shell( meta, Tab::Files, - name, + &title, auth, html! { div.files { @@ -508,10 +513,15 @@ return not_found("No such directory.").into_response(); } let name = meta.name(); + let title = if dir.is_empty() { + format!("Files · {name}") + } else { + format!("{dir} · {name}") + }; repo_shell( meta, Tab::Files, - name, + &title, auth, html! { (crumbs(rel, &dir, false)) @@ -595,10 +605,11 @@ } }; let comments = file_comments(repo, &path).await; + let title = format!("{path} · {}", meta.name()); repo_shell( meta, Tab::Files, - name, + &title, auth, html! { (crumbs(rel, &path, true)) @@ -884,10 +895,11 @@ auth: Option<&super::Auth>, ) -> Markup { let releases = releases(repo).await; + let title = format!("Releases · {}", meta.name()); repo_shell( meta, Tab::Releases, - "Releases", + &title, auth, html! { div.page-header { h1.page-title { "Releases" } } @@ -959,10 +971,11 @@ .and_then(|commits| commits.iter().find(|commit| commit.commit == head_oid)) .and_then(|commit| commit.runs.first()) }); + let title = format!("Checks · {}", meta.name()); repo_shell( meta, Tab::Checks, - "Checks", + &title, auth, html! { div.page-header { h1.page-title { "Checks" } } @@ -1270,7 +1283,8 @@ } } }; - repo_shell(meta, Tab::Issues, "Issues", auth, render_body(&tpl)) + let title = format!("Issues · {}", meta.name()); + repo_shell(meta, Tab::Issues, &title, auth, render_body(&tpl)) } /// The Issues tab body: the open/closed filter and per-issue cards. @@ -1304,10 +1318,11 @@ let members = component::load::<git_member::members::Member>(repo).await; let checks = component::load::<git_effect::Effect>(repo).await; let config = load_repo_config(repo).await; + let title = format!("Settings · {}", meta.name()); repo_shell( meta, Tab::Settings, - "Repository settings", + &title, auth, html! { div.settings {