Files
tty7/docs/git/diffs.mdx
0x38eandl0ng-ai 90073007f0 fix(ui): align title-bar rows and share document header switches (#1178)
* fix(ui): align title-bar rows and share document header switches

Keep #1146's leading space derived from the macOS traffic lights, rather
than the previous fixed 80pt. Add a shared content centre for the title-bar
rows, so headers with different bottom borders align with those buttons.

Keep the editor's full leading space: a control's inner padding should not
reduce the gap before its clickable area or shift docked file tabs.

Share Dock / Fill controls between the editor and diff headers, and use
matching icons with localized tooltips for Split / Unified view.

Validation: formatting and Host boundary checks passed; GUI tests passed
(2506 passed, 2 ignored); local visual acceptance passed.

* fix(ui): give icon switches accessible button names

Expose each shared switch cell as a button with its localized tooltip name
and pressed state. This lets assistive technology identify the icon-only
choices and use GPUI's existing accessible click handling.

Formatting, Host boundary, and diff checks passed. GUI tests: 2506 passed,
2 ignored.

* fix(ui): share the terminal button in filled document headers

Use the editor's terminal button in both filled headers. Clicking it docks
the current file or diff beside the terminal without closing its content.
The shared builder also provides an accessible button name.

The click test verifies that the diff, focused file, expanded state, view
mode, and other tabs' layouts are preserved. GUI tests: 2507 passed, 2
ignored. Build, formatting, Host boundary, and visual acceptance passed.

* fix(ui): draw Split / Unified as two panes so they don't read as Dock

The diff header now holds both switches side by side, and a frame with
one vertical stroke was the Dock glyph shifted a point and a half. Split
is two frames next to each other, Unified two frames stacked.

---------

Co-authored-by: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com>
2026-10-15 15:03:17 +08:00

48 lines
1.9 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Diffs"
description: "The diff overlay: side-by-side or unified, from the sidebar or the panel."
---
## Opening one
| From | How |
|---|---|
| The sidebar | Click a row's `+N −M` counts |
| Source Control | **Open Changes** on a file, or click the row |
| History | Click a file inside a commit's detail view |
A diff docks beside the terminal, in the same column an open file uses, so the
pane you were reading stays on screen. <kbd>Esc</kbd> closes it, and the two
cells at the end of its header — the same Dock / Fill switch an open file
carries — send it across the whole window instead
[more about the column →](/window/side-panel#where-it-opens)
<Frame caption="The diff, side by side, across every changed file">
<img src="/images/diff-overlay.webp" alt="The tty7 diff overlay" />
</Frame>
## Side-by-side or unified
The two cells beside the Dock / Fill switch draw it: two panes next to each
other is side by side, two panes stacked is unified. Hovering one
names it, and **Toggle Unified / Side-by-Side Diff** in Search Everywhere does
the same thing from the keyboard. The choice is global — one setting for every
diff, the same call VS Code's `diffEditor.renderSideBySide` makes — and persists
as `diff_view` in `config.json`.
## What it shows
- Every changed file, with its status and `+N −M`
- **Untracked files** as a preview of their contents, up to 4 MB — past that the
card says the read failed rather than showing a silently cut-off file
- A commit's files, when the diff came from the history
Two limits keep a huge diff from becoming a huge wait:
| Limit | Value | What happens |
|---|---|---|
| Files rendered | 300 | *"… and N more changed files — run git diff in the terminal to see them."* |
| Lines before auto-collapse | 400 per file | Big files start collapsed; expand the ones you care about |
Both are stated in the overlay when they apply — nothing is dropped silently.