Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@ surface, and the HTTP API may change in any minor release.

## [Unreleased]

## [0.14.0] - 2026-10-21

### Added

- **Worktrees.** A repo with linked worktrees gets a panel beside the graph listing each
one with its branch and a live count of changed files. Click a row to open it as its own
`⎇` tab. The panel resizes, collapses to a rail showing the count, and deletes a worktree
from the trash icon on hover, after confirming (its branch stays).
- A branch checked out in another worktree carries a `⎇` marker on its chip. Checking it
out offers to open that worktree's tab instead, before anything is stashed.

### Fixed

- Tabs for linked worktrees refresh on their own after commits, checkouts and stashes made
outside megit. Only file edits used to show up.
- A worktree tab whose folder was deleted shows "Worktree removed" and stays open until
you close it.

## [0.13.0] - 2026-10-09

### Added
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ A sticky WIP row sits at the top of the list whenever the worktree is dirty, con

Stashes appear as their own rows, attached to the commit they were taken from with a dotted connector, and can be popped, deleted, or retitled in place.

### Worktrees

A repository with linked worktrees gets a panel beside the graph listing each one with its branch and changed-file count. Click a row to open it in its own purple `⎇` tab; counts update live, and a branch checked out elsewhere is marked on its chip and offers to open that tab instead of failing the checkout. Drag the panel's edge to resize it, collapse it to a rail that keeps the worktree count, and the trash icon on a row deletes that worktree (its branch stays).

### Diffs

Click a commit to see its changed files, then a file to see the diff. Syntax highlighting, word-level intra-line highlighting, collapsed context you can expand a hunk at a time, and a per-file "Viewed" checkbox.
Expand Down
4 changes: 4 additions & 0 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ Graph queries use `--date-order`, deliberately not `--topo-order`: topological o

**`watch.ts` drives auto-refresh.** One `fs.watch` per open repository, filtered by `isRelevant`, fed into a trailing debouncer with a max-wait cap (400 ms quiet flush, 2 s under sustained churn — a long install or a big rebase still updates twice a second rather than never). Changes are pushed to the browser over SSE at `/api/events`, with a 30 s `: ping` comment to keep intermediaries from closing an idle stream.

**Worktrees extend the watch set, not the protocol.** `worktrees.ts`'s `watchRepo` wraps `subscribe()` and sends two SSE message kinds: `data: changed` (the viewed repo, or — for a linked worktree — the common git dir, since a commit there lands in the common dir rather than in the worktree) and `data: worktrees` (a sibling worktree changed). Siblings are reconciled after each `changed` fire, because `git worktree add/remove` touches the common dir; a worktree nested inside a watched root (`.claude/worktrees/*` inside the repo, or the viewed worktree inside a sibling main checkout) is on that root's ignore list (`setIgnored`, re-applied on every reconcile, for the repo and each sibling alike) and is counted only by its own watcher — so an edit in it fires once, from the watcher that owns it. Filenames are normalised to `/` before the ignore and relevance checks, since Windows reports backslashes. A `worktrees` message refetches only `/api/worktrees`, never `/api/graph`, so editing a file in another worktree costs one `git status` per worktree and no graph re-layout.

**`/api/worktrees` returns `{worktrees}`** — path, branch (or detached), head, `changed` count, `current`. A single-worktree repo costs one `git worktree list` and returns `[]`; the strip only renders when there is more than one. Paths are git's resolved paths, so compare with `current` (and realpath on the server), never against registered strings. `/api/config` also carries `linked`: the registered paths that are linked worktrees, so the tab bar can badge them without a request per tab. Checkout and branch delete consult `heldBy` first and refuse before stashing anything: checkout answers `{heldBy: path}` (the client offers to open that tab), delete answers 409. `POST /api/worktrees {path, force}` runs `git worktree remove`, with `path` allow-listed against `git worktree list` minus the main worktree.

**Only a manual refresh touches the network.** `/api/graph` and `/api/status` read local git, which cannot see upstream commits until something fetches — so Pull was once the only button that surfaced them. The ⟳ button and <kbd>r</kbd> now POST `{action:'fetch'}` to `/api/branch` and re-enter `refresh` for the local read; a failed fetch is swallowed so the read still lands. Everything else stays local-only on purpose: SSE refetches fire every 400 ms–2 s, and RepoView remounts per tab switch, so neither may cost a round-trip.

**`/api/graph` pages.** 200 commits per request by default, clamped to 5000 — an uncapped limit turns one request into the entire history (4.2 MB / 380 ms on a 14.8k-commit repo), and 5000 rows is already far past where the DOM gives out.
Expand Down
Loading
Loading