Federated via graft
0

Configure Feed

Select the types of activity you want to include in your feed.

Fix Radicle links: recognize /commits/ marker, distinguish nodes

repoRootURL only recognized Forgejo's singular /commit/, /issues/,
/pulls/, /patches/ — Radicle Explorer's plural /commits/ never matched,
so every Radicle-hosted commit sub-row silently fell back to a
non-clickable label instead of a link.

hostLabel also only read a URL's host, which for Radicle Explorer is
always the shared frontend domain regardless of which underlying node
served it — the actual node lives in the /nodes/<host>/<rid>/... path.
Two different Radicle nodes mirroring the same repo would have collapsed
into one indistinguishable sub-row; now each gets its own.

+13 -2
+13 -2
internal/status/status.go
··· 244 244 if err != nil || u.Host == "" { 245 245 return "" 246 246 } 247 - parts := strings.Split(u.Host, ".") 247 + host := u.Host 248 + // A Radicle Explorer URL's host is always the shared frontend 249 + // (e.g. radicle.cyberwild.org) — the actual node lives in the path, 250 + // /nodes/<node-host>/<rid>/... — so different Radicle nodes get 251 + // distinct labels instead of collapsing into one "radicle.cyberwild". 252 + if segs := strings.Split(strings.TrimPrefix(u.Path, "/"), "/"); len(segs) >= 2 && segs[0] == "nodes" { 253 + host = segs[1] 254 + } 255 + parts := strings.Split(host, ".") 248 256 if len(parts) > 1 { 249 257 parts = parts[:len(parts)-1] 250 258 } ··· 396 404 // ".../owner/repo/commit/<sha>" -> ".../owner/repo". Empty if rawURL is 397 405 // empty or doesn't contain a recognized item path. 398 406 func repoRootURL(rawURL string) string { 399 - for _, marker := range []string{"/commit/", "/issues/", "/pulls/", "/patches/"} { 407 + // Forgejo uses singular "/commit/"; Radicle Explorer uses plural 408 + // "/commits/" — both must be recognized, or every Radicle-hosted 409 + // commit link falls back to a non-clickable label. 410 + for _, marker := range []string{"/commit/", "/commits/", "/issues/", "/pulls/", "/patches/"} { 400 411 if idx := strings.Index(rawURL, marker); idx >= 0 { 401 412 return rawURL[:idx] 402 413 }