Refreshing rebuilt the whole tree, and TreeView.reload() with no argument drops the scroll position. Watching a job meant the view jumped every fifteen seconds. The provider now reconciles instead of replacing. update() rebuilds from the store, matches rows to the existing nodes by identifier, copies the rendered fields onto them, and reports the topmost rows that actually changed; main.js reloads just those. Node identity survives the merge, which is what makes a targeted reload possible. An open row that fetches its own children has that cache dropped so it refetches — the running-job path. A job finishing now reloads one run's row and nothing else. Sections also each describe what they draw, so a section only rebuilds when its own content moved: run activity no longer disturbs the pull request list, and an idle tree is left alone entirely. This does not slow anything down — a section showing a run in progress still updates on every poll, and contributes a time bucket so its elapsed clock keeps moving. A row set changing at the root still needs a whole-tree reload; there the selected row is re-revealed afterwards, which is the closest thing to a scroll anchor Nova exposes. Adds seventeen checks: no-op updates reporting nothing, a finishing job naming only its own row, node identity surviving, a new run reloading just its workflow group, and a new workflow escalating to a full reload. 168 checks total. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MQuusXgZC2dzwpJJ1qhtti
Tests
Two suites that run the extension's real code under plain Node. Nova's runtime and a Gitea server are both stubbed, so there is nothing to install and nothing to reach over the network.
Tests/run.sh # all suites
node Tests/units.test.js
node Tests/host-aliases.test.js
node Tests/integration.test.js
Each exits non-zero on failure, so Tests/run.sh works as a CI step.
What is here
| File | Purpose |
|---|---|
nova-stub.js |
Stands in for Nova's runtime: nova.*, TreeView, TreeItem, Issue, IssueCollection, Process, Range, NotificationRequest. Records messages, clipboard writes, and opened files on globals so assertions can inspect them. |
fake-gitea.js |
A canned Gitea 1.27 instance served through a fetch() stub — three workflow runs, two pull requests, reviews with a line comment, artifacts, secrets, and variables. Records every request it answers. |
assert.js |
The Checker used by both suites. |
units.test.js |
Remote URL parsing, diff-hunk arithmetic, per-file diff extraction, time formatting, preference precedence, HTTP error messages, the pre-1.24 /actions/tasks fallback, pagination and query building, and the no-token path. |
host-aliases.test.js |
Instances answering SSH on a different hostname than the web UI: alias parsing, the unmatched case, a hand-written alias, detection from a repository's ssh_url, and a later repository resolving from the stored alias without another probe. |
integration.test.js |
Activates the extension against a real throwaway git checkout, renders all four sidebar sections, and drives the commands that write files or call the API. |
host-aliases.test.js and integration.test.js create their git fixtures in a temporary directory and
remove them afterwards; nothing is written inside the repository.
Adding a case
Fixtures live in fake-gitea.js — add to the exported data and, if the route is
new, to the router at the bottom of that file. Assertions use
t.check(label, condition, detail) or t.equals(label, actual, expected);
detail is printed only when the check fails.
If a check fails on a value you believe is correct, confirm the expectation by hand before changing the extension — the diff-hunk line arithmetic in particular is easy to get wrong in a test.