fabrica

hanna/fabrica

refactor(web): drop section headers that duplicate the active tab

571457d · hanna committed on 2026-07-25

Remove the Commits/Branches/Tags headings on repo views and the
listing/user-card titles on Explore — the active tab already labels the
section. repo_card now omits its heading when given an empty title, keeping
the profile and dashboard titles intact.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed by hannaSSH key fingerprint: SHA256:4g9cWhkAAw8gwqhJUcVbSnGEvdGwklW+1Aa/fMUu59k
3 files changed · +2 −7UnifiedSplit
crates/web/src/pages.rs +1 −2
@@ -153,7 +153,7 @@ async fn explore_repos_body(state: &AppState, q: &str) -> AppResult<Markup> {
153153 aria-label="Search repositories";
154154 button class="btn btn-primary" type="submit" { "Search" }
155155 }
156- (repo_card("Public repositories", "No public repositories.", &entries))
156+ (repo_card("", "No public repositories.", &entries))
157157 })
158158 }
159159
@@ -189,7 +189,6 @@ async fn explore_users_body(state: &AppState, q: &str) -> AppResult<Markup> {
189189 fn user_card(users: &[User]) -> Markup {
190190 html! {
191191 section class="listing" {
192- h2 { "Users" }
193192 @if users.is_empty() {
194193 div class="card" { p class="muted" { "No users." } }
195194 } @else {
crates/web/src/repo.rs +1 −4
@@ -635,7 +635,6 @@ async fn branches_view(
635635 let now = crate::now_ms();
636636 let body = html! {
637637 (repo_header(state, &ctx, Tab::Branches, &ctx.repo.default_branch, &branch_list))
638- h2 { "Branches" }
639638 ul class="entry-list card" {
640639 @for b in &branches {
641640 li class="entry-row" {
@@ -681,7 +680,6 @@ async fn tags_view(
681680 let base = format!("/{}/{}", ctx.owner.username, ctx.repo.path);
682681 let body = html! {
683682 (repo_header(state, &ctx, Tab::Tags, &ctx.repo.default_branch, &branches))
684- h2 { "Tags" }
685683 @if tags.is_empty() {
686684 div class="card" { p class="muted" { "No tags." } }
687685 } @else {
@@ -762,7 +760,6 @@ async fn commits_view(
762760 let branches = branch_names(state, &ctx.repo.id).await;
763761 let body = html! {
764762 (repo_header(state, &ctx, Tab::Commits, &rev_name, &branches))
765- h2 { "Commits" }
766763 ul class="entry-list card" {
767764 @for (commit, sig) in commits.iter().zip(states.iter()) {
768765 @let commit_url = format!("{base}/-/commit/{}", commit.oid);
@@ -1195,7 +1192,7 @@ fn visibility_badge(visibility: model::Visibility) -> Markup {
11951192 pub(crate) fn repo_card(title: &str, empty: &str, entries: &[RepoEntry]) -> Markup {
11961193 html! {
11971194 section class="listing" {
1198- h2 { (title) }
1195+ @if !title.is_empty() { h2 { (title) } }
11991196 @if entries.is_empty() {
12001197 div class="card" { p class="muted" { (empty) } }
12011198 } @else {
crates/web/src/tests.rs +0 −1
@@ -314,7 +314,6 @@ async fn explore_lists_public_repos_for_anonymous() {
314314 let res = app.oneshot(get("/explore")).await.unwrap();
315315 assert_eq!(res.status(), StatusCode::OK);
316316 let html = body_string(res).await;
317- assert!(html.contains("Public repositories"), "explore heading");
318317 assert!(html.contains("ada/open"), "public repo listed");
319318 // The Explore sub-nav offers the repositories and users tabs.
320319 assert!(html.contains("/explore/users"), "users tab present");