vole
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software:2222/vole.git
A free and open-source forge that lives in your Git repo.
Paginate the whole activity feed
c8cdb6accc47af06a3df2b8b5023c21134fdb812 · Keenan Nemetz · 10d ago · parent 4d938fe8
Paginate the whole activity feed Both activity pages stopped at a fixed number of events: the repository feed was truncated at 100, and the instance feed merged 100 per repository and then took 200 before its pager. Anything older was unreachable. Now that issues, changes, comments and state changes are index rows, the whole feed is assembled from the database and paginated: - the repository feed and the instance feed keep the whole sorted, filtered list, and both show 50 events per page; - the repository feed gains a pager (it had none), and the instance pager now reaches all history; - the kind/actor/assignee filters travel through the page links, so paging never widens the feed; - the repository pager swaps the `#activity-feed` fragment over HTMX like the chips and the filter form, and the page links are plain hrefs when JavaScript is not there; - the feed reads comment summaries (parent, id, author, created) rather than every comment body it will not render. The home rail still asks for a bounded feed, so it keeps its handful of events. The feed is assembled in memory per request, so a page costs O(history) instead of O(page); that is the accepted trade for now, and a SQL event stream is the follow-up if a large history makes it visible.
forge/index/detail.go −14
| @@ -122,20 +122,6 @@ func (s *Store) Request(repoID, id string) (*metadata.Request, error) { | |||
| 122 | 122 | return &req, nil | |
| 123 | 123 | } | |
| 124 | 124 | ||
| 125 | // CommentsForRepo returns every comment of one kind in a repository, for a feed | ||
| 126 | // that groups them by parent. It is the "all" form of Comments. | ||
| 127 | func (s *Store) CommentsForRepo(repoID, kind string) ([]CommentRow, error) { | ||
| 128 | rows, err := s.db.Query( | ||
| 129 | `SELECT kind, parent, id, author, created, body, reply_to, deleted, path, side, line, blob | ||
| 130 | FROM comments WHERE repo_id=? AND kind=? ORDER BY parent, id`, | ||
| 131 | repoID, kind) | ||
| 132 | if err != nil { | ||
| 133 | return nil, err | ||
| 134 | } | ||
| 135 | defer rows.Close() | ||
| 136 | return scanComments(rows) | ||
| 137 | } | ||
| 138 | |||
| 139 | 125 | // AllApprovals returns every approval in a repository, keyed by request id. The | |
| 140 | 126 | // activity feed needs all of them; a list page asks for the rows it shows instead. | |
| 141 | 127 | func (s *Store) AllApprovals(repoID string) (map[string][]ApprovalRow, error) { | |