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 | |||
| 69 | 69 | form.stack p { margin:10px 0; } form.stack label { font-size:13px; color:var(--muted); } | |
| 70 | 70 | 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; } | |
| 71 | 71 | 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; } | |
| 72 | 74 | .commit-list { list-style:none; padding:0; margin:0; } | |
| 73 | 75 | .commit-list li { padding:8px 0; border-top:1px solid var(--border); display:flex; gap:12px; align-items:baseline; } | |
| 74 | 76 | .commit-list li:first-child { border-top:0; } | |
| ⋯ 249 unchanged lines | |||
| 324 | 326 | h1 style="margin-right:auto" { (owner.username) } | |
| 325 | 327 | @if is_self { a.btn href="/-/new" { "New repository" } } | |
| 326 | 328 | } | |
| 327 | - | @if !owner.email.is_empty() { p.muted { (owner.email) } } | |
| 328 | 329 | h2 { "Repositories" } | |
| 329 | 330 | @if visible.is_empty() { | |
| 330 | 331 | p.muted { "No repositories." } | |
| ⋯ 371 unchanged lines | |||
| 702 | 703 | let header = html! { | |
| 703 | 704 | div style="display:flex;align-items:center;gap:8px" { | |
| 704 | 705 | h1 style="margin-right:auto" { | |
| 705 | - | a href="/" { "anvil" } " / " | |
| 706 | 706 | a href=(format!("/{owner}")) { (owner) } " / " (repo) | |
| 707 | 707 | @if meta.is_private { " " span.pill { "private" } } | |
| 708 | 708 | } | |
| ⋯ 27 unchanged lines | |||
| 736 | 736 | .clone() | |
| 737 | 737 | .unwrap_or_else(|| "HEAD".to_string()); | |
| 738 | 738 | 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(); | |
| 739 | 743 | ||
| 740 | 744 | Ok(layout( | |
| 741 | 745 | &format!("{owner}/{repo}"), | |
| ⋯ 4 unchanged lines | |||
| 746 | 750 | "Branch: " (rev) " · " | |
| 747 | 751 | a href=(format!("/{owner}/{repo}/commits/{rev}")) { "commits" } | |
| 748 | 752 | } | |
| 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 | + | } | |
| 749 | 760 | (tree_table(&owner, &repo, &rev, "", &entries)) | |
| 750 | 761 | }, | |
| 751 | 762 | )) | |
| ⋯ 431 unchanged lines | |||