fabrica

hanna/fabrica

feat(web): profile lists only top-level groups and repos

650cf01 · hanna committed on 2026-07-25

Grouped repositories and subgroups now appear only inside their group, not
duplicated on the owner's profile. A search still spans everything so nested
items remain findable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed by hannaSSH key fingerprint: SHA256:4g9cWhkAAw8gwqhJUcVbSnGEvdGwklW+1Aa/fMUu59k
15 files changed · +54 −3UnifiedSplit
crates/web/src/repo.rs +10 −3
@@ -285,9 +285,16 @@ pub async fn user_page(
285285
286 let q = lq.q.unwrap_or_default();286 let q = lq.q.unwrap_or_default();
287 let needle = q.trim().to_lowercase();287 let needle = q.trim().to_lowercase();
288 // The profile lists only top-level groups and repos; grouped ones live in
289 // their group. A search, however, spans everything so nested items are
290 // findable.
291 let top_groups: Vec<_> = groups.iter().filter(|g| !g.path.contains('/')).collect();
288 let entries: Vec<RepoEntry> = repos292 let entries: Vec<RepoEntry> = repos
289 .iter()293 .iter()
290 .filter(|r| needle.is_empty() || r.path.to_lowercase().contains(&needle))294 .filter(|r| {
295 let matches = needle.is_empty() || r.path.to_lowercase().contains(&needle);
296 matches && (!needle.is_empty() || !r.path.contains('/'))
297 })
291 .map(|r| RepoEntry::owned(&owner.username, r))298 .map(|r| RepoEntry::owned(&owner.username, r))
292 .collect();299 .collect();
293300
@@ -301,11 +308,11 @@ pub async fn user_page(
301 placeholder="Search repositories…" aria-label="Search repositories";308 placeholder="Search repositories…" aria-label="Search repositories";
302 button class="btn btn-primary" type="submit" { "Search" }309 button class="btn btn-primary" type="submit" { "Search" }
303 }310 }
304 @if !groups.is_empty() {311 @if !top_groups.is_empty() {
305 section class="listing" {312 section class="listing" {
306 h2 { "Groups" }313 h2 { "Groups" }
307 ul class="repo-list card" {314 ul class="repo-list card" {
308 @for group in &groups {315 @for group in &top_groups {
309 li {316 li {
310 a class="repo-row" href={ "/" (owner.username) "/" (group.path) } {317 a class="repo-row" href={ "/" (owner.username) "/" (group.path) } {
311 span class="repo-row-name" {318 span class="repo-row-name" {
data/repos/01/01kydta3a2b6gmfh0c4x7tx4b0.git/HEAD +1 −0
@@ -0,0 +1 @@
1ref: refs/heads/main
data/repos/01/01kydta3a2b6gmfh0c4x7tx4b0.git/config +9 −0
@@ -0,0 +1,9 @@
1[core]
2 bare = true
3 repositoryformatversion = 0
4 filemode = true
5 logallrefupdates = true
6[receive]
7 denyNonFastForwards = false
8[gc]
9 auto = 0
data/repos/01/01kydta3a2b6gmfh0c4x7tx4b0.git/description +1 −0
@@ -0,0 +1 @@
1Unnamed repository; edit this file 'description' to name the repository.
data/repos/01/01kydta3a2b6gmfh0c4x7tx4b0.git/hooks/README.sample +5 −0
@@ -0,0 +1,5 @@
1#!/bin/sh
2#
3# Place appropriately named executable hook scripts into this directory
4# to intercept various actions that git takes. See `git help hooks` for
5# more information.
data/repos/01/01kydta3a2b6gmfh0c4x7tx4b0.git/hooks/post-receive +2 −0
@@ -0,0 +1,2 @@
1#!/bin/sh
2exec "/nix/store/dbq6s7lwz3v3bbj7hx24x1zswyhi4wws-fabrica-0.1.0/bin/.fabrica-wrapped" hook post-receive
data/repos/01/01kydta3a2b6gmfh0c4x7tx4b0.git/hooks/pre-receive +2 −0
@@ -0,0 +1,2 @@
1#!/bin/sh
2exit 0
data/repos/01/01kydta3a2b6gmfh0c4x7tx4b0.git/info/exclude +2 −0
@@ -0,0 +1,2 @@
1# File patterns to ignore; see `git help ignore` for more information.
2# Lines that start with '#' are comments.
data/repos/01/01kydtah34meqbxcfatt6m90p3.git/HEAD +1 −0
@@ -0,0 +1 @@
1ref: refs/heads/main
data/repos/01/01kydtah34meqbxcfatt6m90p3.git/config +9 −0
@@ -0,0 +1,9 @@
1[core]
2 bare = true
3 repositoryformatversion = 0
4 filemode = true
5 logallrefupdates = true
6[receive]
7 denyNonFastForwards = false
8[gc]
9 auto = 0
data/repos/01/01kydtah34meqbxcfatt6m90p3.git/description +1 −0
@@ -0,0 +1 @@
1Unnamed repository; edit this file 'description' to name the repository.
data/repos/01/01kydtah34meqbxcfatt6m90p3.git/hooks/README.sample +5 −0
@@ -0,0 +1,5 @@
1#!/bin/sh
2#
3# Place appropriately named executable hook scripts into this directory
4# to intercept various actions that git takes. See `git help hooks` for
5# more information.
data/repos/01/01kydtah34meqbxcfatt6m90p3.git/hooks/post-receive +2 −0
@@ -0,0 +1,2 @@
1#!/bin/sh
2exec "/nix/store/dbq6s7lwz3v3bbj7hx24x1zswyhi4wws-fabrica-0.1.0/bin/.fabrica-wrapped" hook post-receive
data/repos/01/01kydtah34meqbxcfatt6m90p3.git/hooks/pre-receive +2 −0
@@ -0,0 +1,2 @@
1#!/bin/sh
2exit 0
data/repos/01/01kydtah34meqbxcfatt6m90p3.git/info/exclude +2 −0
@@ -0,0 +1,2 @@
1# File patterns to ignore; see `git help ignore` for more information.
2# Lines that start with '#' are comments.