Every diff in Tori opens as an editor tab: a file in the Changes panel, a commit in the graph, a stash, a checkpoint, a file in a pull request. Several can be open at once and the list you opened them from stays put.
Clicking a file in a list opens its diff in a preview tab, which the next click replaces. Double-click the row or the tab, or start staging in it, to keep it.
Reading a diff
Rows are coloured in the file’s own language and numbered on both sides: the
old line number on the left, the new one on the right. Unchanged stretches fold
into a band you can click to open. Copying lines copies only the code, without
the numbers or the + and -.
The tab’s bar names the file and whether you are looking at Staged changes or the Working tree, and has:
| Control | What it does |
|---|---|
| N comments | The hunk comments you are holding, with Send. Only there while you hold some, see Comment on a hunk |
| Previous change, Next change | Jump between hunks. Shift+Option+F5 and Option+F5 in the file view |
| Stage this file or Unstage this file | The whole file at once |
| Discard every hunk below | Throws away every unstaged change in the file, after a confirmation and a snapshot |
| Ignore whitespace changes | Hides changes that are only whitespace |
| Show the diff in the file itself | Switches to the file view, below |
| Copy diff | Copies the diff as text |
| Open the file itself | Opens the file in the editor |
| Re-read this diff | Reloads it from disk |
Staging needs the whitespace: while whitespace is ignored, the stage and discard buttons are greyed out with Show whitespace changes, which staging needs.
Inline or side by side
Side-by-side diffs, in Settings > Editor, shows every diff in Tori as two columns, old and new, instead of one. It applies to commits, pull requests, reviews and chats too. A pane too narrow for two columns falls back to inline.
Stage part of a file
Each hunk has its own buttons:
- Stage this hunk (or Unstage this hunk in a staged diff).
- Throw away this hunk: it asks Discard this hunk? first. The change is not staged, so git has no other copy, but Tori saves a snapshot before discarding, and you can bring it back from the Checkpoints tab.
- Who wrote this hunk: the agent turn and tool call behind the lines, and a box to ask that session why. See Who wrote a hunk.
To stage only some lines of a hunk:
- Click the lines you want, or drag across them, in the diff.
- A Stage 3 lines button appears on the hunk (and on the bar). Click it.
The rest of the hunk stays unstaged. In a staged diff the same thing unstages the lines you picked.
The file view
Show the diff in the file itself turns the tab into the whole file as a read only buffer with git’s changes drawn over it:
- Removed lines shown in place, and changed characters marked within a line.
- A second gutter with the old line numbers.
- Blame in the gutter, an overview ruler with added and removed strips down the side, and breadcrumbs.
- The editor’s selection, find and Vim keys.
- A stage button by each hunk in the gutter. Select lines to stage just those.
Switch back to diff rows returns to the rows view. The file view has no hunk headers, so Who wrote this hunk is only on the rows view.
Comment on a hunk
Each hunk has a comment button, Comment on this hunk. Use it to point an agent at a specific change: “this should handle a 429 too”, “rename this”. Write as many as the review needs, then send them all at once.
- Click the comment button on a hunk and type your comment.
- Press
Enteror Hold comment.Escapecloses the box. - Do the same on any other hunk, in this file or another. The tab’s bar counts them: 3 comments.
- Select the session you want to tell in the sidebar.
- Click the count, check the list, and click Send.
The list shows each comment’s file, lines and text. Remove this comment takes one out, Clear empties it. Send is greyed out with the reason when no session is selected.
Every diff tab in the workspace shares one list, and so does the Session pane, which has its own count next to Show reads and sends to the session it shows. Holding a comment needs no session. The list lives until you send or clear it, or quit Tori. A second opinion’s findings join the same list, carry the reviewer’s name, and are kept across a quit.
All the comments go as one message, each with its file and lines:
- A chat gets it as a turn of its own, sent right away. If a turn is running it waits in the queue like a message you queued. A chat that autopilot is driving, that is stopped at its spend limit, or whose queue is parked refuses it, and your comments stay in the list. A chat you opened only to read has to be running first: send it a message, then send the comments.
- A terminal agent gets it typed at its prompt as one line, 1) In @src/sign.ts lines 12-18: your comment 2) In @src/api.ts lines 4-9: another, and nothing more. Tori never presses Enter in a terminal; read it there and send.
A single comment goes as In @src/sign.ts lines 12-18: your comment, without the number.
Send each comment right away
Send hunk comments right away, in Settings > Editor, skips the list: each
comment goes to the selected session as soon as you press Enter or Send,
the same way as above. The comment button then needs a session, and is greyed
out with the reason without one. If the send fails, your comment stays in the
box.
Diffs in the editor
In an ordinary editor tab, the gutter marks lines added, changed or removed since the last commit. Click a mark, or the line number beside it, to see the lines that used to be there.
Commit diffs
A commit opened from the graph, a stash or a pull request lists the files it changed; each opens its diff for that commit, with Copy diff and Open the file as it is now. A merge commit is shown against its first parent, and says so.