Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

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.

#142

Refresh the repository tab counts while the page is open

merged · by keenan 9d ago · merged into main at 11720250 by keenan 9d ago

keenan opened this 9d ago

Why

The open counts beside the Issues and Changes tabs only moved when the page was loaded, so a reader watching a repository had to reload to learn that new work had arrived.

What changed

  • The repository header polls GET /r/{name}/counts every 30 seconds while the page is visible. The response is the two badges as out-of-band updates, so the current tab, the clone menu, a search field and any half-filled form stay where the reader left them.
  • RepoCounts reads the same openCounts the page did and answers 404 for a repository the viewer cannot read, like every other route below /r/{name}.
  • A badge whose number moved keeps one short ring (app.js compares the counts after each out-of-band swap), because a number changing elsewhere on the screen is easy to miss. The reduced-motion rule still applies.
  • The count markup moved into two small templates (repo_issue_count, repo_request_count) so the page and the poll cannot drift apart on the element ids the swap matches.

Tests

  • TestRepoTabCountsPollOutOfBand (server): the page carries the poll and both badges, the response is exactly two out-of-band badges, and an unknown repository answers 404.
  • TestRepositoryPagesShareTheTabHeader and TestRepoTabsCountOpenIssuesAndRequests updated for the badge ids.
  • vole workflow check and vole workflow run verify both pass.

Closes #141

Discussion (0)

No discussion yet.