fabrica

hanna/fabrica

feat(web): show last-updated instead of duplicate visibility in repo rows

44642d0 · hanna committed on 2026-07-25

The visibility badge next to the name already conveys it, so the row subtitle
now shows the default branch and a relative "Updated …" time (pushed_at,
falling back to updated_at) like other forges.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed by hannaSSH key fingerprint: SHA256:4g9cWhkAAw8gwqhJUcVbSnGEvdGwklW+1Aa/fMUu59k
1 files changed · +8 −2UnifiedSplit
crates/web/src/repo.rs +8 −2
@@ -1498,6 +1498,9 @@ pub(crate) struct RepoEntry {
14981498 pub(crate) visibility: model::Visibility,
14991499 /// The default branch, shown in the subtitle.
15001500 pub(crate) default_branch: String,
1501+ /// When the repo was last pushed to (falling back to its last metadata
1502+ /// change), for the "Updated …" subtitle.
1503+ pub(crate) updated: i64,
15011504 /// Optional one-line description, shown under the name when present.
15021505 pub(crate) description: Option<String>,
15031506 }
@@ -1510,6 +1513,7 @@ impl RepoEntry {
15101513 label: repo.path.clone(),
15111514 visibility: repo.visibility,
15121515 default_branch: repo.default_branch.clone(),
1516+ updated: repo.pushed_at.unwrap_or(repo.updated_at),
15131517 description: repo.description.clone(),
15141518 }
15151519 }
@@ -1522,6 +1526,7 @@ impl RepoEntry {
15221526 label: format!("{owner}/{}", repo.path),
15231527 visibility: repo.visibility,
15241528 default_branch: repo.default_branch.clone(),
1529+ updated: repo.pushed_at.unwrap_or(repo.updated_at),
15251530 description: repo.description.clone(),
15261531 }
15271532 }
@@ -1540,6 +1545,7 @@ fn visibility_badge(visibility: model::Visibility) -> Markup {
15401545 /// card headed by `title`, one bordered row per repo with a bold name and a
15411546 /// muted `visibility · default: branch` subtitle.
15421547 pub(crate) fn repo_card(title: &str, empty: &str, entries: &[RepoEntry]) -> Markup {
1548+ let now = crate::now_ms();
15431549 html! {
15441550 section class="listing" {
15451551 @if !title.is_empty() { h2 { (title) } }
@@ -1558,8 +1564,8 @@ pub(crate) fn repo_card(title: &str, empty: &str, entries: &[RepoEntry]) -> Mark
15581564 span class="repo-row-desc muted" { (desc) }
15591565 }
15601566 span class="repo-row-meta muted" {
1561- (e.visibility.as_str())
1562- " · " (icon(Icon::GitBranch)) " " (e.default_branch)
1567+ (icon(Icon::GitBranch)) " " (e.default_branch)
1568+ " · Updated " (crate::activity::fmt_relative(e.updated, now))
15631569 }
15641570 }
15651571 }