Expanding a workflow run and waiting through one poll closed it again. Two causes. Nova applies whatever collapsible state getTreeItem returns, and it returned Collapsed for every row that was not built default-open, so each reload closed everything the user had opened. On top of that, a reload fired on every poll whether or not anything had changed, so an idle tree was rebuilt every 15 to 60 seconds for no reason. The provider now tracks expansion by node identifier, fed from the tree view's expand and collapse events. A node built default-open seeds that set the first time its identifier is seen, so such a section can still be closed by hand and stay closed. Node identifiers consequently have to be stable across rebuilds. The fallback for nodes without an explicit one was a counter, which changed on every build; it is now derived from the node's kind and name. Step rows were keyed by step number alone, which collided between jobs, and are now qualified by the job. Reloads are also skipped entirely when store.signature() is unchanged. The signature covers everything drawn, including the branch filter, which changes the tree without changing any data. A live run contributes a coarse time bucket so its elapsed clock still ticks, and the explicit Refresh command always redraws. Adds twelve checks covering expansion surviving a rebuild, a default-open section staying closed once closed, and the signature responding to run state and the branch filter but not to a no-op poll. 143 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.