anvilsign in

collin/anvil · 5cba55f9

feat: repo page polish — latest-commit bar, no profile email, owner/repo breadcrumb

Collin Richards · 2026-06-09 22:49 UTC · 5cba55f95d583049c9359146559ba5c42fb1e545 · parent c48ae612 · browse files

modifiedcrates/anvil-web/src/ui.rs+13 −2
⋯ 68 unchanged lines
6969 form.stack p { margin:10px 0; } form.stack label { font-size:13px; color:var(--muted); }
7070 form.stack input[type=text], form.stack textarea { width:100%; max-width:480px; padding:6px 8px; border:1px solid var(--border); border-radius:6px; font:inherit; }
7171 form.stack .check { display:flex; gap:8px; align-items:flex-start; max-width:480px; }
72+.latest-commit { display:flex; gap:10px; align-items:baseline; background:var(--code-bg); border:1px solid var(--border); border-radius:6px 6px 0 0; border-bottom:0; padding:8px 16px; }
73+.latest-commit + .box { border-radius:0 0 6px 6px; }
7274 .commit-list { list-style:none; padding:0; margin:0; }
7375 .commit-list li { padding:8px 0; border-top:1px solid var(--border); display:flex; gap:12px; align-items:baseline; }
7476 .commit-list li:first-child { border-top:0; }
⋯ 249 unchanged lines
324326 h1 style="margin-right:auto" { (owner.username) }
325327 @if is_self { a.btn href="/-/new" { "New repository" } }
326328 }
327- @if !owner.email.is_empty() { p.muted { (owner.email) } }
328329 h2 { "Repositories" }
329330 @if visible.is_empty() {
330331 p.muted { "No repositories." }
⋯ 371 unchanged lines
702703 let header = html! {
703704 div style="display:flex;align-items:center;gap:8px" {
704705 h1 style="margin-right:auto" {
705- a href="/" { "anvil" } " / "
706706 a href=(format!("/{owner}")) { (owner) } " / " (repo)
707707 @if meta.is_private { " " span.pill { "private" } }
708708 }
⋯ 27 unchanged lines
736736 .clone()
737737 .unwrap_or_else(|| "HEAD".to_string());
738738 let entries = browse::list_tree(&path, &rev, "").map_err(server_error)?;
739+ let latest = browse::commit_log(&path, &rev, 1)
740+ .map_err(server_error)?
741+ .into_iter()
742+ .next();
739743
740744 Ok(layout(
741745 &format!("{owner}/{repo}"),
⋯ 4 unchanged lines
746750 "Branch: " (rev) " · "
747751 a href=(format!("/{owner}/{repo}/commits/{rev}")) { "commits" }
748752 }
753+ @if let Some(c) = &latest {
754+ div.latest-commit {
755+ a.sha href=(format!("/{owner}/{repo}/commit/{}", c.id)) { (c.short) }
756+ a href=(format!("/{owner}/{repo}/commit/{}", c.id)) { (c.summary) }
757+ span.muted style="margin-left:auto" { (c.author) " · " (fmt_time(c.time)) }
758+ }
759+ }
749760 (tree_table(&owner, &repo, &rev, "", &entries))
750761 },
751762 ))
⋯ 431 unchanged lines