From 247f80f28dcca10ee2c0901990108f6537ecabbf Mon Sep 17 00:00:00 2001 From: daniel daum Date: Mon, 23 Nov 2026 11:17:10 -0800 Subject: [PATCH] fix: tab bars fit the page: tighter repo tabs, compact document tabs --- docs/decisions.md | 71 +++++++++++ internal/build/activity.go | 10 +- internal/build/build.go | 11 +- internal/build/build_test.go | 2 +- internal/build/extra.go | 57 ++++++++- internal/build/loop.go | 2 +- internal/build/repo.go | 33 +++++ internal/config/config.go | 14 +++ internal/config/config_test.go | 54 ++++++++ internal/gitea/gitea.go | 100 +++++++++++++-- internal/gitea/gitea_test.go | 112 +++++++++++++++++ scripts/icons.py | 3 + .../api/v1/repos/daniel/repo-a/issues.json | 34 +++++ .../daniel/repo-a/issues/4/comments.json | 7 ++ .../daniel/repo-a/issues/7/comments.json | 12 ++ .../api/v1/repos/daniel/repo-a/pulls.json | 1 + testdata/golden/index.html | 30 ++--- testdata/golden/repo-a/blob/README.md.html | 11 +- testdata/golden/repo-a/blob/big.txt.html | 11 +- .../golden/repo-a/blob/cmd/hello/main.go.html | 11 +- testdata/golden/repo-a/blob/data.bin.html | 11 +- .../golden/repo-a/blob/docs/logo.png.html | 11 +- testdata/golden/repo-a/branches/index.html | 11 +- testdata/golden/repo-a/commit-latest.html | 11 +- testdata/golden/repo-a/index.html | 27 ++-- testdata/golden/repo-a/issues/index.html | 119 ++++++++++++++++++ testdata/golden/repo-a/log/index.html | 11 +- testdata/golden/repo-a/packages/index.html | 11 +- testdata/golden/repo-a/pulls/index.html | 20 ++- testdata/golden/repo-a/releases/index.html | 11 +- testdata/golden/repo-a/tags/index.html | 11 +- .../golden/repo-a/tree/cmd/hello/index.html | 11 +- testdata/golden/repo-a/tree/docs/index.html | 11 +- testdata/golden/repo-b/index.html | 9 +- testdata/golden/repo-b/issues/index.html | 66 ++++++++++ testdata/golden/repo-b/log/index.html | 9 +- testdata/golden/repo-b/releases/index.html | 9 +- testdata/golden/repos/index.html | 6 +- web/static/icons/octicons/comment.svg | 1 + web/static/icons/octicons/issue-closed.svg | 1 + web/static/icons/octicons/issue.svg | 1 + web/static/style.css | 88 +++++++++++-- web/templates/_repo.html | 21 +++- web/templates/issues.html | 29 +++++ web/templates/profile.html | 3 +- web/templates/pulls.html | 3 +- 46 files changed, 957 insertions(+), 151 deletions(-) create mode 100644 internal/config/config_test.go create mode 100644 internal/gitea/gitea_test.go create mode 100644 testdata/gitea/api/v1/repos/daniel/repo-a/issues.json create mode 100644 testdata/gitea/api/v1/repos/daniel/repo-a/issues/4/comments.json create mode 100644 testdata/gitea/api/v1/repos/daniel/repo-a/issues/7/comments.json create mode 100644 testdata/golden/repo-a/issues/index.html create mode 100644 testdata/golden/repo-b/issues/index.html create mode 100644 web/static/icons/octicons/comment.svg create mode 100644 web/static/icons/octicons/issue-closed.svg create mode 100644 web/static/icons/octicons/issue.svg create mode 100644 web/templates/issues.html diff --git a/docs/decisions.md b/docs/decisions.md index f162bda..4c17d3a 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -805,3 +805,74 @@ allowlist of it. looks like a WAF rule against `.env` leaks (for example CrowdSec's `vpatch-env-access`). Fix it there with an exception for this host, not by renaming routes in showcase. + +## Issues and comments + +The spec lists issues and comments as non-goals. Daniel asked for both, so +they're in, read-only like pulls. + +- **Issues tab** (`//issues/`), between Releases and Pulls: the 50 + newest issues (`/issues?state=all&type=issues`; the issues API has no sort + option). Gitea's issues API returns pulls too, so anything with + `pull_request` set is dropped. The heading counts open and closed issues; + labels are plain pills, since the CSP allows no inline colors. +- **Comments** on issues and pulls, oldest first, from + `/issues/{n}/comments`, fetched only when the item's `comments` count is + above zero. That endpoint only returns real comments, not timeline + events. Bodies come from anyone, so they go through the same Markdown + allowlist as READMEs; the fixture's comment carries a `\n\n[click](javascript:alert(1))", + "created_at": "2026-11-20T09:00:00Z", + "user": { "login": "Daniel" } + }, + { + "body": "That works, thanks!", + "created_at": "2026-11-20T10:30:00Z", + "user": { "login": "friend" } + } +] diff --git a/testdata/gitea/api/v1/repos/daniel/repo-a/pulls.json b/testdata/gitea/api/v1/repos/daniel/repo-a/pulls.json index 1741587..f87916a 100644 --- a/testdata/gitea/api/v1/repos/daniel/repo-a/pulls.json +++ b/testdata/gitea/api/v1/repos/daniel/repo-a/pulls.json @@ -1,6 +1,7 @@ [ { "number": 4, + "comments": 1, "title": "Add a /healthz endpoint", "body": "Adds a health check.\n\n- [x] handler\n- [ ] docs", "state": "open", diff --git a/testdata/golden/index.html b/testdata/golden/index.html index 5069ee1..08534a5 100644 --- a/testdata/golden/index.html +++ b/testdata/golden/index.html @@ -21,13 +21,13 @@ - - - + + + - +