diffstalkerd 0.12.3 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +127 -0
- package/README.md +15 -3
- package/dist/index.js +46 -46
- package/dist/symbolWorker.js +4 -4
- package/dist/web/assets/index-CBRce9t3.css +1 -0
- package/dist/web/assets/index-tTr_-mF7.js +15 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-DCu3bn_X.js +0 -14
- package/dist/web/assets/index-Dgf4Da4P.css +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,133 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.13.0] - 2026-08-26
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **`diffstalker link` — print a web-UI URL for a place in a repo.** For
|
|
13
|
+
pointing someone at code instead of pasting a copy of it, and written for a
|
|
14
|
+
coding agent as much as for a person: `diffstalker link` gives the journal
|
|
15
|
+
(a whole session in one place), `diffstalker link src/App.vue` the explorer,
|
|
16
|
+
and `changes` / `history` / `compare` take the anchor each of those views
|
|
17
|
+
understands. The command exists because a hand-written diffstalker URL fails
|
|
18
|
+
silently — a non-view-first path names no place, an `at` that matches nothing
|
|
19
|
+
leaves the view aimed at nothing — so it proves every part against the daemon
|
|
20
|
+
first: the repo, the file, the `u:`/`s:` side a changes row is actually on,
|
|
21
|
+
the short hash a commit-ish resolves to. Anything it cannot prove is an error
|
|
22
|
+
on stderr with a non-zero exit, not a URL that breaks in someone's browser.
|
|
23
|
+
- **`GET /health` reports the port the web UI is reachable on** (`http.port`,
|
|
24
|
+
null when the daemon bound only a socket). A socket client could not
|
|
25
|
+
otherwise tell whether a browser URL exists at all; `diffstalker link` says
|
|
26
|
+
so plainly instead of guessing a port.
|
|
27
|
+
- **`GET /resolve?path=`** — can this exact path be opened, and as which
|
|
28
|
+
worktree, without opening it. It shares one resolver with `POST /repos` so
|
|
29
|
+
the two can never disagree, but requires the path to EXIST: git resolves a
|
|
30
|
+
missing path to its parent worktree, which would make a typo look openable.
|
|
31
|
+
- **Whole-file mode in the web UI.** A `whole file` toggle in each diff header
|
|
32
|
+
(Changes, Compare, History) draws that one file in full — every line
|
|
33
|
+
numbered, the changed ones marked in place — instead of hunks with three
|
|
34
|
+
lines of context.
|
|
35
|
+
It is for reading a change in the context of the file it happened in, which
|
|
36
|
+
is the one thing `view file` could not do: it gave you the file and dropped
|
|
37
|
+
every change marker.
|
|
38
|
+
You never pick a ref. The view already fixes the pair and the mode inherits
|
|
39
|
+
it. It applies to one file at a time — the anchored one — which is what lets
|
|
40
|
+
it live in the URL as `whole=<path>`, so F5 lands in the same view, a link
|
|
41
|
+
shares it, and Back turns it off. Untracked files do not offer it (their diff is
|
|
42
|
+
already the whole file); binary files and diffs withheld over the size cap
|
|
43
|
+
disable it with the reason, and keep their hunks on screen.
|
|
44
|
+
In History it is the only correct answer to "show me this in context":
|
|
45
|
+
`view file` there opens TODAY's copy of the path, which is different bytes
|
|
46
|
+
than the historical diff is about. A file over the per-file diff cap keeps
|
|
47
|
+
its hunks and says why on the toggle, rather than replacing a working diff
|
|
48
|
+
with a "not shown" notice.
|
|
49
|
+
The Explorer gains the mirror of `view file` — a `show changes` button, shown
|
|
50
|
+
only for a file that actually has one — so the trip between reading a file
|
|
51
|
+
and reading its diff finally goes both ways. The Explorer renders no diff and
|
|
52
|
+
holds no ref. See `docs/whole-file-mode.md`.
|
|
53
|
+
- **Every diff header now says what it is comparing.** `index → working tree`,
|
|
54
|
+
`HEAD → index`, `origin/main…HEAD`, `a1b2c3d^ → a1b2c3d`. Each view always
|
|
55
|
+
fixed a ref pair and none of them said which, which is what made the question
|
|
56
|
+
feel unanswerable. It also separates Compare's two kinds of row: committed
|
|
57
|
+
ones sit against the merge-base, uncommitted ones against HEAD.
|
|
58
|
+
- **Syntax highlighting is document-wide in whole-file mode.** With full
|
|
59
|
+
context each side of the diff is a complete file, so a block comment stays a
|
|
60
|
+
comment for all twenty of its lines instead of being re-tokenized row by row.
|
|
61
|
+
Hunk views keep per-line highlighting — a hunk interleaves two file versions
|
|
62
|
+
and has no single valid document to feed the highlighter.
|
|
63
|
+
- **`GET /repos/:id/compare/file?path=&base=&uncommitted=&whole=`** and
|
|
64
|
+
`path`/`whole` on **`GET /repos/:id/commits/:hash/diff`** — one file's diff
|
|
65
|
+
inside a comparison or a commit, which the stacked views need because they
|
|
66
|
+
pull a range whole and split it client-side. Both carry BOTH sides of a
|
|
67
|
+
rename in the pathspec: scoped to the new path alone, git reports a rename as
|
|
68
|
+
a plain add, which at full context would turn a two-line edit into a whole
|
|
69
|
+
file of additions.
|
|
70
|
+
- **`GET /repos/:id/diff?whole=true`** — the wire behind it. Requires `path`
|
|
71
|
+
(400 without one: a wide whole-tree diff is unbounded work behind an
|
|
72
|
+
unthrottled GET), and is never annotated with hunk edit times, because a
|
|
73
|
+
whole-file diff is one hunk per file and stamping it would write keys the
|
|
74
|
+
daemon's own `-U3` refresh never produces — the file would read back as
|
|
75
|
+
edited just now.
|
|
76
|
+
|
|
77
|
+
### Changed
|
|
78
|
+
|
|
79
|
+
- **The repo picker is one input over one list.** The header panel used to
|
|
80
|
+
stack three lists (open on daemon, discovered, recent) with a path field
|
|
81
|
+
above them and a filter buried in the middle that narrowed only the
|
|
82
|
+
discovered list — four ways in, and no obvious one. Now: one input at the
|
|
83
|
+
top that filters everything at once, one list with the open repos first
|
|
84
|
+
under an `OPEN` label, and the discovered repos behind a single control
|
|
85
|
+
that is collapsed by default and says how many revealing will add. Typing
|
|
86
|
+
a name searches every source including discovered; typing an absolute path
|
|
87
|
+
grows an **Open** button, but only once the daemon confirms the path is
|
|
88
|
+
precisely a repository it can open. Arrows move, Enter opens, the first
|
|
89
|
+
Escape clears and the second closes. The empty state mounts the same
|
|
90
|
+
picker, so the two cannot drift apart.
|
|
91
|
+
- Two behaviours were dropped with it. The path field no longer starts
|
|
92
|
+
prefilled with the active repo's path — in an input that also filters, a
|
|
93
|
+
prefill would narrow the list to the repo you are already in. And the empty
|
|
94
|
+
state's recents now wait for their worktree lookup like every other list,
|
|
95
|
+
instead of painting straight from localStorage: that is what keeps a
|
|
96
|
+
three-worktree project from reading as three repos there and one everywhere
|
|
97
|
+
else.
|
|
98
|
+
|
|
99
|
+
### Fixed
|
|
100
|
+
|
|
101
|
+
- **A repo directory literally named `~` produced a link to a different
|
|
102
|
+
repo.** The URL grammar documented that such a segment is written `%7E`, but
|
|
103
|
+
`encodeURIComponent` leaves `~` alone (it is an unreserved character), so a
|
|
104
|
+
repo at `/~/x` wrote `/~/x` and read back as `$HOME/x`. The sentinel is now
|
|
105
|
+
escaped explicitly. Found by extracting the grammar into
|
|
106
|
+
`@diffstalker/core/view/urlGrammar` — one copy shared by the web client and
|
|
107
|
+
`diffstalker link`, with a round-trip test — instead of two copies that could
|
|
108
|
+
disagree about a URL without either erroring.
|
|
109
|
+
- **Compare with "include uncommitted" dropped the uncommitted changes to any
|
|
110
|
+
file the branch's commits already touched.** The compare returns such a file
|
|
111
|
+
twice — once for the committed side, once for the working tree — but the file
|
|
112
|
+
tree keyed leaves by path and merged the two into one row, so the second
|
|
113
|
+
entry's diff never reached the view. On a branch where you edit the files you
|
|
114
|
+
have been committing to (the normal case), ticking the box added nothing. The
|
|
115
|
+
tree now gives every entry its own row, and both views key compare rows by
|
|
116
|
+
side + path the way the Changes list already does.
|
|
117
|
+
- **Untracked files never showed in the compare at all.** `git diff` does not
|
|
118
|
+
report them, and nothing else looked. They now appear as new-file diffs, with
|
|
119
|
+
the same gitignore filter the Changes view applies, so both views agree on
|
|
120
|
+
what counts as untracked.
|
|
121
|
+
- **A file with both staged and unstaged edits showed only the staged half.**
|
|
122
|
+
The uncommitted side was read as two separate diffs and de-duplicated by path,
|
|
123
|
+
so the unstaged chunk was thrown away while the stats still counted its lines.
|
|
124
|
+
It is one `git diff HEAD` now: staged and unstaged together, in one entry,
|
|
125
|
+
with stats that match what is drawn.
|
|
126
|
+
- **A `diff.context` setting in your git config changed what diffstalker
|
|
127
|
+
showed.** Context width is not cosmetic here — it decides where hunks merge
|
|
128
|
+
and split, so it moved the per-file hunk badges, the identity a hunk's edit
|
|
129
|
+
time is keyed by, and the patches built for staging. Only the journal's diff
|
|
130
|
+
pinned it; every other read took git's default. All of them pin `-U3` now, so
|
|
131
|
+
the same repo reads the same everywhere. If you have `diff.context` set, this
|
|
132
|
+
re-keys your hunks once: existing edit times restamp and hunk badges shift,
|
|
133
|
+
one time.
|
|
134
|
+
|
|
8
135
|
## [0.12.3] - 2026-08-12
|
|
9
136
|
|
|
10
137
|
### Added
|
package/README.md
CHANGED
|
@@ -192,24 +192,26 @@ values are rejected with a 400 so they can never be parsed as git flags.
|
|
|
192
192
|
|
|
193
193
|
| Method | Path | What |
|
|
194
194
|
| ------ | -------------------------- | ------------------------------------------------ |
|
|
195
|
-
| GET | `/health` | `{ok, ready}`
|
|
195
|
+
| GET | `/health` | `{ok, ready, home, http: {port}, symbols}` — `http.port` is the loopback port a browser reaches the web UI on, or null when only a socket is bound (what `diffstalker link` needs to build a URL at all) |
|
|
196
196
|
| GET | `/version` | `{current, latest, status, install}` — the running version against npm's `latest` dist-tag (`current` \| `outdated` \| `ahead` \| `unknown`). The npm lookup is cached (6h, 5min after a failure) and only ever runs when this endpoint is called; `--no-update-check` skips it, leaving `latest: null`. `install` is `{method, package, command}` — how this daemon was installed (`npm` \| `bun` \| `pnpm` \| `yarn` \| `pacman` \| `unknown`) and the one command that updates it, detected once from where the daemon's own files live. An install nothing owns reports `unknown` with a null command rather than a guess |
|
|
197
197
|
| GET | `/repos` | List open repos (`id`, `path`, `branch`) |
|
|
198
198
|
| POST | `/repos` | Open a repo: `{"path": "/abs/path"}` → `{id, path}` (201 created, 200 already open) |
|
|
199
199
|
| DELETE | `/repos/:id` | Close a repo (refcounted per open) |
|
|
200
200
|
| GET | `/repos/:id/worktrees` | Registered worktrees (`path`, `branch`, `head`, `isBare`, `lastActivity`, `aheadOfBase`): main worktree, linked worktrees, and the bare entry in a bare-worktree layout |
|
|
201
201
|
| GET | `/worktrees?path=` | Same as above, but for a raw filesystem path instead of an already-opened repo id (e.g. a recently-visited repo a client hasn't opened on this daemon) |
|
|
202
|
+
| GET | `/resolve?path=` | `{openable, root}` — can this exact path be opened, and as which worktree, without opening it. Same resolver as `POST /repos`, but the path must EXIST (git resolves a missing path to its parent worktree, which would make a typo look openable). A relative path is a 400; not-a-repo is a 200 answer |
|
|
202
203
|
| GET | `/repos/:id/status` | Shared state: status, hunk counts, stash list, in-progress operation, error, working-file mtimes (path → mtimeMs; what browser clients build mtime-based auto mode on) |
|
|
203
|
-
| GET | `/repos/:id/diff?path=&staged=` | Diff; whole tree without `path`, staged side with `staged=true`. Per-file cap: a file's diff over 256 KB or 5,000 lines is withheld — its headers are kept and its body becomes one `Large file — diff not shown (…)` line, the same shape git uses for `Binary files … differ`. Applies to every diff-bearing response (compare, commit diffs, journal) |
|
|
204
|
+
| GET | `/repos/:id/diff?path=&staged=&whole=` | Diff; whole tree without `path`, staged side with `staged=true`. `whole=true` draws ONE file in full instead of as hunks (wide context, so every unchanged line is present and the changed ones are marked in place) — it **requires** `path` (400 without one: a wide whole-tree diff is unbounded work behind an unthrottled GET), it is never annotated with hunk edit times (see the note under this table), and it is ignored for an untracked file, whose diff is the whole file already. Per-file cap: a file's diff over 256 KB or 5,000 lines is withheld — its headers are kept and its body becomes one `Large file — diff not shown (…)` line, the same shape git uses for `Binary files … differ`. Applies to every diff-bearing response (compare, commit diffs, journal), and it is what bounds a whole-file diff |
|
|
204
205
|
| GET | `/repos/:id/history?count=` | Commit history (`CommitInfo[]`, default 100, ISO dates) |
|
|
205
206
|
| GET | `/repos/:id/commits/:hash` | One commit by hash or short hash (404 on unknown) — what a link to a commit outside a client's loaded log resolves through |
|
|
206
|
-
| GET | `/repos/:id/commits/:hash/diff
|
|
207
|
+
| GET | `/repos/:id/commits/:hash/diff?path=&whole=` | Diff introduced by one commit (404 on unknown hash; merge and `--allow-empty` commits are 200 with an empty diff, matching the CLI). `path` narrows to one file and `whole=true` widens its context to the whole file (400 without `path`). The pathspec carries BOTH sides of a rename, because scoping to the new path alone makes git report a rename as a plain add |
|
|
207
208
|
| GET | `/repos/:id/head-message` | HEAD commit message for amend prefill: `{message}` (`""` when the repo has no commits) |
|
|
208
209
|
| GET | `/repos/:id/branches` | Local branches (`name`, `current`, `tracking`) |
|
|
209
210
|
| GET | `/repos/:id/base-branches` | Candidate compare bases (remote branches in recent history) |
|
|
210
211
|
| GET | `/repos/:id/compare/base` | Effective compare base: `{base}` (persisted choice or discovered default, null when none) |
|
|
211
212
|
| PUT | `/repos/:id/compare/base` | Persist the compare base: `{"branch": "origin/main"}` → `{base}`; the ref is validated first (400 on an unknown ref, nothing persisted) |
|
|
212
213
|
| GET | `/repos/:id/compare?base=&uncommitted=` | Base-vs-HEAD `CompareDiff` (three-dot); base defaults to the effective base — a stale persisted base falls back to the discovered default, 422 when nothing usable resolves; an explicit unknown `base` is a 400; a base with no common history is a 422; `uncommitted=true` merges working-tree changes |
|
|
214
|
+
| GET | `/repos/:id/compare/file?path=&base=&uncommitted=&whole=` | One file's diff inside a comparison, as a `DiffResult`. The stacked views pull a range whole and split it client-side, so they have no per-file request of their own to widen. `uncommitted=true` reads the row against HEAD instead of against the base — Compare's stack mixes the two and they are genuinely different comparisons. Same rename-preserving pathspec as above. 400 without `path` |
|
|
213
215
|
| GET | `/repos/:id/tree?dir=&hidden=&ignored=` | One directory level (`name`, `path`, `type`), gitignored/hidden filtered by default (`hidden=true` / `ignored=true` include them, mirroring the TUI toggles), files annotated with `gitStatus` + `staged`, changed dirs with `hasChanges` (400 outside the repo root, on a file, or on the git directory, 404 unknown dir). The git directory is never listed, even with `hidden=true` |
|
|
214
216
|
| GET | `/repos/:id/file?path=` | File content for display with flags: `{content, binary, truncated, tooLarge, size, totalLines, media?}` — binary/oversized come back with empty content and the flag set, never prose; `media` carries the image verdict (`{image, refusal, version}`) when the bytes say something about it; 400 for anything that is not a regular file (directory, FIFO, device), resolves outside the repo root, or addresses the git directory |
|
|
215
217
|
| GET | `/repos/:id/media?path=&staged=` | Image metadata for one changed file, both sides resolved server-side (renames included): `{old, new}`, each side `{path, side, bytes, oid, image, refusal, version}` or `null` when the file does not exist there. `staged` must be spelled `0` or `1`. 404 when the path is not in status. See [Image bytes](#image-bytes) |
|
|
@@ -264,6 +266,16 @@ at the display line limit. A merely large file that fits within the limit
|
|
|
264
266
|
is served whole with `truncated: false` (the old TUI code conflated the
|
|
265
267
|
two: a >100KB file used to be flagged truncated regardless).
|
|
266
268
|
|
|
269
|
+
Note on `whole=true` and hunk edit times: a whole-file diff is **never**
|
|
270
|
+
stamped. Stamping WRITES into the repo's shared hunk-time map, keyed by a
|
|
271
|
+
hash of each hunk's +/- body, and a whole-file diff is one hunk per file —
|
|
272
|
+
so it would write keys the manager's own `-U3` refresh never produces, and
|
|
273
|
+
the file would read back as edited just now. `/commits/:hash/diff` skips
|
|
274
|
+
stamping for the same reason. Whole-file mode therefore shows no per-hunk
|
|
275
|
+
age; the `-U3` read is a separate request and keeps all of it. Requesting
|
|
276
|
+
`whole=true` on an untracked file changes nothing at all, stamping
|
|
277
|
+
included: the response is byte-identical to the plain one.
|
|
278
|
+
|
|
267
279
|
Repo ids are stable hashes of the worktree root, so a cached id still
|
|
268
280
|
addresses the same repo after a daemon restart.
|
|
269
281
|
|