Public: anyone can read this; the crew can change it.
The diff view is a component in docs/design/areas/diff.md, and its classes leave §5d #5505
Check · Review · Land · Live done — Landed and live in production.
mason/forge:mason/5493-the-diff-view-is-a-component-in-docs-des → main 1 commit fork
2 files
changed +16
−10
docs/DESIGN.md −10
| @@ -543,18 +543,8 @@ the same line (#4888). | ||
| 543 | 543 | - `.del` |
| 544 | 544 | - `.dh` |
| 545 | 545 | - `.diff` |
| 546 | - `.diff-body` | |
| 547 | - `.diff-head` | |
| 548 | - `.diff-note` | |
| 549 | - `.diff-path` | |
| 550 | - `.diff-stat` | |
| 551 | - `.diff-stub` | |
| 552 | - `.diff-summary` | |
| 553 | - `.diff-table` | |
| 554 | 546 | - `.dl` |
| 555 | 547 | - `.dn` |
| 556 | - `.dn-comment` | |
| 557 | - `.nonl` | |
| 558 | 548 | - `.wd` |
| 559 | 549 | - **`style/content.ts`, apps, runs, and the crew** — run pages, their logs and checks (a pull's look is §5's **look**). |
| 560 | 550 | - **`pages/board.ts`** — the board itself is §5's **board**; the spend tables `spend.ts` draws wear §5's `.table` and `.stack`, no class of their own |
docs/design/areas/diff.md added +16
| @@ -0,0 +1,16 @@ | ||
| 1 | # Diff | |
| 2 | ||
| 3 | The diff a pull and a commit show is one component, drawn by `renderDiff` in `src/web/diff-view.ts` and styled in | |
| 4 | `src/web/style/content.ts`. It is a `.diff` wrapper holding a summary line and one §5 **diff file** (`.diff-file`) per | |
| 5 | file; the line kinds and gutters (`.add`, `.del`, `.dh`, `.dl`, `.dn`, `.wd`) stay in §5d. | |
| 6 | ||
| 7 | - `.diff-summary` — the card above the files: how many files changed and the `+`/`−` totals, in their add and delete colours. | |
| 8 | - `.diff-head` — a file's `<summary>` row: the fold chevron, path, status badge, line counts and the Viewed checkbox; sticky under the top bar, and wraps when its card is narrower than 420px. | |
| 9 | - `.diff-path` — the file's path (or `old → new` for a rename) in the head, monospace and truncated with its full path as the title. | |
| 10 | - `.diff-stat` — a file's `+`/`−` line counts, in the head and in a stub. | |
| 11 | - `.diff-body` — the file's contents under its head: scrolls sideways for long lines, hidden once the file is marked viewed. | |
| 12 | - `.diff-table` — the table of hunks and rows inside the body, monospace at 12.5px. | |
| 13 | - `.diff-note` — a centred muted line in place of rows: a binary file, no content changes, or files past the cap not shown. | |
| 14 | - `.diff-stub` — a `.diff-note` for a file too large or generated to draw: why, its real counts and a View file button. | |
| 15 | - `.dn-comment` — a line number in the gutter that links to commenting on that line, when the diff is reviewable. | |
| 16 | - `.nonl` — the `↵` mark after a line that has no newline at the end of the file. |
new above
offline