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
286286 let q = lq.q.unwrap_or_default();
287287 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();
288292 let entries: Vec<RepoEntry> = repos
289293 .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+ })
291298 .map(|r| RepoEntry::owned(&owner.username, r))
292299 .collect();
293300
@@ -301,11 +308,11 @@ pub async fn user_page(
301308 placeholder="Search repositories…" aria-label="Search repositories";
302309 button class="btn btn-primary" type="submit" { "Search" }
303310 }
304- @if !groups.is_empty() {
311+ @if !top_groups.is_empty() {
305312 section class="listing" {
306313 h2 { "Groups" }
307314 ul class="repo-list card" {
308- @for group in &groups {
315+ @for group in &top_groups {
309316 li {
310317 a class="repo-row" href={ "/" (owner.username) "/" (group.path) } {
311318 span class="repo-row-name" {
data/repos/01/01kydta3a2b6gmfh0c4x7tx4b0.git/HEAD +1 −0
@@ -0,0 +1 @@
1+ref: 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 @@
1+Unnamed 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
2+exec "/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
2+exit 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 @@
1+ref: 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 @@
1+Unnamed 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
2+exec "/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
2+exit 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.