Skip to content

Commit 06f202a

Browse files
committed
Add Section 1 Mermaid draft, bot-comments figure, two storyboard GIFs
Three deliverables for the parallel Option A / Option B pass: 1. planning/section-1-draft.mdx — working draft of the chapter's opening section with four Mermaid diagrams (repository as a filing cabinet, branch as a parallel working copy, commit as a snapshot, pull request as the formal merge proposal) plus a glossary. Will migrate into the main chapter MDX when the chapter is finalized. 2. fig-05-bot-comments — annotated figure showing the three bot comments every reviewer needs to recognize on the PR (assigned-reviewers state, stage progression, preview deployed). Captured from PR #121 via the existing pr-overview.png; coords merged in via the new probe-bot-comments.mjs. 3. Two storyboard GIFs (with editable .pptx variants): - gif-commit-filter-storyboard: walks through clicking the commit selector pill on the Files toolbar and picking the content commit to filter out the scaffolding diff (Section 3). - gif-changes-since-last-review-storyboard: walks through using the commit selector to pick 'Changes since your last review' on a backcheck round (Section 7). Both storyboards use the existing filtered Files-changed capture as the base, with Pillow-drawn dropdown mocks for the in-between states. The user re-records these in ScreenToGif against the real UI when ready.
1 parent fbd8bb4 commit 06f202a

12 files changed

Lines changed: 500 additions & 1 deletion

planning/assets/captures/pr-overview.coords.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,25 @@
7878
"w": 1440,
7979
"h": 3729
8080
},
81-
"pageHeight": 3729
81+
"stageProgression": {
82+
"x": 168,
83+
"y": 2064,
84+
"w": 808,
85+
"h": 209
86+
},
87+
"assignedReviewers": {
88+
"x": 168,
89+
"y": 1665,
90+
"w": 808,
91+
"h": 304
92+
},
93+
"previewDeployed": {
94+
"x": 168,
95+
"y": 2305,
96+
"w": 808,
97+
"h": 210
98+
},
99+
"ciBuild": null,
100+
"issueTrackerLabels": null
82101
}
83102
}
108 KB
Binary file not shown.
Binary file not shown.
283 KB
Binary file not shown.

planning/section-1-draft.mdx

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
title: Section 1 Draft — Before you start, why we work this way
3+
---
4+
5+
{/*
6+
Working draft of Section 1 of the rewritten Reviewer Workflow chapter.
7+
Mermaid diagrams convey the four core concepts a first-time reviewer
8+
needs: repository, branch, commit, pull request. When the chapter is
9+
finalized, this content moves into docs/dev/documentation-guide/12-
10+
reviewer-workflow.mdx. Until then this is just a sketch — prose can
11+
be tightened.
12+
*/}
13+
14+
# Before you start — why we work this way
15+
16+
Reviewing documentation on GitHub is unfamiliar territory for most engineers. Before clicking anything, this short tour explains the four concepts everything else in this chapter is built on: the **repository**, **branches**, **commits**, and **pull requests**. Read this once and most of the rest of the chapter will feel obvious.
17+
18+
## The site you're reviewing is built from text files in a repository
19+
20+
Every page on the RMC Software Documentation site is generated from a text file. All of those files live together in a single folder we call the **repository**`RMC-Software-Documentation`. The repository is the source of truth: change a file there, the site updates.
21+
22+
```mermaid
23+
flowchart TD
24+
repo[("📁 RMC-Software-Documentation (the repository)")]
25+
repo --> docs[("📁 docs/")]
26+
docs --> desktop[("📁 desktop-applications/")]
27+
docs --> toolbox[("📁 toolbox-technical-manuals/")]
28+
docs --> web[("📁 web-applications/")]
29+
desktop --> totalrisk[("📁 rmc-totalrisk/")]
30+
totalrisk --> usersGuide[("📁 users-guide/")]
31+
usersGuide --> v10[("📁 v1.0/")]
32+
usersGuide --> v11[("📁 v1.1/ ← the revision you're reviewing")]
33+
v11 --> mdxFiles["01-preface.mdx<br/>02-welcome.mdx<br/>03-overview.mdx<br/>… and so on"]
34+
```
35+
36+
You will not be editing any of these files. Your job is to read the rendered output and either approve it or leave comments. The author is the one who edits.
37+
38+
## A branch is a parallel copy of the repository
39+
40+
If an author edited the live files directly, every keystroke would be on the published site instantly — typos and all. Instead, the author creates a **branch**: a working copy of the entire repository that they can edit freely without affecting anything readers see.
41+
42+
The main branch — literally called `main` — is the published site. Branches with names like `docs/minor/totalrisk-users-guide-v1.1` are work-in-progress copies.
43+
44+
```mermaid
45+
gitGraph
46+
commit id: "v1.0 published"
47+
commit id: "earlier work"
48+
branch "docs/minor/totalrisk-users-guide-v1.1"
49+
checkout "docs/minor/totalrisk-users-guide-v1.1"
50+
commit id: "scaffold v1.1"
51+
commit id: "edit preface, GUI..."
52+
checkout main
53+
commit id: "(meanwhile on main)"
54+
```
55+
56+
The branch sits off to the side. Anything on `main` is live. Anything on a branch is in progress.
57+
58+
## A commit is a saved snapshot
59+
60+
Authors don't save every keystroke — they save in batches called **commits**. Each commit bundles up a coherent set of changes with a short message describing what was done.
61+
62+
In a typical revision PR you'll see two commits:
63+
64+
```mermaid
65+
gitGraph
66+
commit id: "main HEAD"
67+
branch "docs/minor/totalrisk-users-guide-v1.1"
68+
commit id: "1. Scaffold v1.1 (boilerplate copy)"
69+
commit id: "2. Edit preface, installation, GUI, acronyms"
70+
```
71+
72+
The first commit is usually **scaffolding** — boilerplate that prepares the new version folder. It's mechanical and not something you need to review carefully. The second commit is the real content edit and is what the author wants your eyes on. Later in this chapter you'll learn how to skip past the scaffolding commit so you only see the changes that matter.
73+
74+
## A pull request is a formal proposal to merge a branch back into main
75+
76+
When an author is ready for review, they open a **pull request** (PR). A PR is a proposal: "please merge this branch into `main` so it goes live." It holds the review conversation in one place — comments, suggested changes, approvals, and the eventual merge button.
77+
78+
```mermaid
79+
flowchart LR
80+
branch["docs/minor/totalrisk-users-guide-v1.1<br/>(author's working branch)"]
81+
pr{{"Pull Request #121<br/>Sample Document for Reviewer Training"}}
82+
main["main<br/>(the live site)"]
83+
branch -->|"author opens PR"| pr
84+
pr -->|"reviewers comment, approve"| pr
85+
pr -->|"admin merges<br/>after all approvals"| main
86+
```
87+
88+
Two things matter:
89+
90+
1. **Pull requests are the only way changes reach the live site.** Direct edits to `main` are blocked. Every change goes through this same review process.
91+
2. **A reviewer's entire job happens inside the pull request.** You will never edit a file directly. You read the rendered preview, leave comments on the PR, and approve when you're happy.
92+
93+
## Glossary
94+
95+
| Term | Plain-English meaning |
96+
|---|---|
97+
| **Repository** | The folder of files that the website is built from. |
98+
| **Branch** | A parallel copy of the repository where someone is making edits without disturbing the live site. |
99+
| **Commit** | A saved snapshot of one batch of edits, with a short message describing what changed. |
100+
| **Pull request (PR)** | A formal proposal to merge a branch into `main`. The conversation, the review, and the merge all happen here. |
101+
| **Merge** | The act of folding a branch's commits into `main`, making them part of the live site. |
102+
| **Main** | The branch that *is* the live site. Protected — you can only merge into it through a pull request. |
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
"""
2+
Annotated "PR bot comments" figure for the reviewer-workflow chapter.
3+
4+
Teaches reviewers to recognize the three automated comments that show up
5+
on every PR. Together they tell the reviewer everything they need without
6+
clicking around:
7+
1. Assigned reviewers state — who's responsible for the current stage
8+
2. Stage progression — which lane this PR is in, what review is needed
9+
3. Preview deployed — the URL to read the rendered document on
10+
11+
Source:
12+
planning/assets/captures/pr-overview.png (full-page capture)
13+
planning/assets/captures/pr-overview.coords.json
14+
"""
15+
16+
import json
17+
import sys
18+
from pathlib import Path
19+
20+
sys.path.insert(0, str(Path(__file__).resolve().parent))
21+
from annotate_lib import annotate_and_crop # noqa: E402
22+
23+
REPO_ROOT = Path(__file__).resolve().parents[2]
24+
SRC = REPO_ROOT / "planning" / "assets" / "captures" / "pr-overview.png"
25+
COORDS = REPO_ROOT / "planning" / "assets" / "captures" / "pr-overview.coords.json"
26+
OUT = REPO_ROOT / "static" / "figures" / "dev" / "reviewer-workflow" / "fig-05-bot-comments.png"
27+
PPTX = REPO_ROOT / "planning" / "assets" / "figure-pptx" / "fig-05-bot-comments.pptx"
28+
29+
elements = json.loads(COORDS.read_text())["elements"]
30+
assigned = elements["assignedReviewers"]
31+
stage = elements["stageProgression"]
32+
preview = elements["previewDeployed"]
33+
34+
# Crop to span all three bot comments with a little context above and below.
35+
top = min(assigned["y"], stage["y"], preview["y"]) - 50
36+
bottom = max(assigned["y"] + assigned["h"], stage["y"] + stage["h"], preview["y"] + preview["h"]) + 60
37+
CROP = (80, top, 1340, bottom)
38+
39+
callouts = [
40+
(assigned["x"], assigned["y"], assigned["w"], assigned["h"], "tl", 1),
41+
(stage["x"], stage["y"], stage["w"], stage["h"], "tl", 2),
42+
(preview["x"], preview["y"], preview["w"], preview["h"], "tl", 3),
43+
]
44+
45+
annotate_and_crop(SRC, callouts, CROP, OUT, pptx_out=PPTX)
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
"""
2+
Storyboard GIF: viewing only what's new since your last review
3+
(Section 7 — the backcheck round).
4+
5+
After the reviewer submits a Comment-style review and the author pushes
6+
new commits, the Files-changed toolbar gains a "Changes since your last
7+
review" option in the commit-range dropdown. This storyboard walks
8+
through that flow.
9+
10+
Frames:
11+
1. After your first review, the author has pushed more commits
12+
2. Click the commit selector to open the dropdown
13+
3. The "Changes since your last review" option is at the top — pick it
14+
4. The diff narrows to only what's new
15+
16+
The state where this UI appears requires both a prior review and new
17+
commits, which the sandbox PR doesn't naturally produce. The storyboard
18+
mocks the dropdown overlay; the user re-records with ScreenToGif against
19+
a real backcheck PR when one shows up.
20+
"""
21+
22+
import io
23+
from pathlib import Path
24+
from PIL import Image, ImageDraw, ImageFont
25+
26+
REPO_ROOT = Path(__file__).resolve().parents[2]
27+
SRC = REPO_ROOT / "planning" / "assets" / "captures" / "pr-files-changed.png"
28+
OUT_GIF = REPO_ROOT / "static" / "figures" / "dev" / "reviewer-workflow" / "gif-changes-since-last-review-storyboard.gif"
29+
OUT_PPTX = REPO_ROOT / "planning" / "assets" / "figure-pptx" / "gif-changes-since-last-review-storyboard.pptx"
30+
31+
CROP = (20, 200, 1340, 700)
32+
33+
ACCENT = (74, 124, 155, 255)
34+
WHITE = (255, 255, 255, 255)
35+
RED = (200, 30, 30, 255)
36+
LABEL_BG = (255, 248, 220, 250)
37+
BLUE_HOVER = (221, 244, 255, 255)
38+
39+
40+
def load_font(size):
41+
for p in ("C:/Windows/Fonts/segoeuib.ttf", "C:/Windows/Fonts/arialbd.ttf"):
42+
if Path(p).exists():
43+
return ImageFont.truetype(p, size)
44+
return ImageFont.load_default()
45+
46+
47+
def caption(draw, x, y, text, font):
48+
bb = draw.textbbox((0, 0), text, font=font)
49+
tw, th = bb[2] - bb[0], bb[3] - bb[1]
50+
pad = 12
51+
rect = [x, y, x + tw + pad * 2, y + th + pad * 2]
52+
draw.rounded_rectangle([rect[0] - 2, rect[1] - 2, rect[2] + 2, rect[3] + 2], radius=12, fill=WHITE)
53+
draw.rounded_rectangle(rect, radius=10, fill=LABEL_BG, outline=(50, 90, 115, 255), width=2)
54+
draw.text((x + pad - bb[0], y + pad - bb[1]), text, font=font, fill=(40, 40, 40, 255))
55+
56+
57+
def draw_dropdown(draw, x, y, items, highlighted=None):
58+
item_h = 44
59+
w = 560
60+
h = item_h * len(items) + 16
61+
draw.rounded_rectangle([x, y, x + w, y + h], radius=8, fill=(255, 255, 255, 255), outline=(208, 215, 222, 255), width=1)
62+
f_title = load_font(13)
63+
f_sub = load_font(11)
64+
for i, (title, subtitle) in enumerate(items):
65+
iy = y + 8 + i * item_h
66+
if i == highlighted:
67+
draw.rectangle([x + 4, iy, x + w - 4, iy + item_h], fill=BLUE_HOVER)
68+
draw.text((x + 14, iy + 4), title, font=f_title, fill=(36, 41, 47, 255))
69+
draw.text((x + 14, iy + 22), subtitle, font=f_sub, fill=(101, 109, 118, 255))
70+
71+
72+
def render_frame(base, n):
73+
img = base.copy()
74+
overlay = Image.new("RGBA", img.size, (0, 0, 0, 0))
75+
d = ImageDraw.Draw(overlay)
76+
f_cap = load_font(18)
77+
f_step = load_font(28)
78+
79+
# Step indicator
80+
d.rounded_rectangle([20, 18, 130, 56], radius=8, fill=ACCENT)
81+
d.text((35, 24), f"Step {n}", font=f_step, fill=WHITE)
82+
83+
pill_xy = (60, 78, 140, 24) # commit selector in cropped frame
84+
px, py, pw, ph = pill_xy
85+
86+
dropdown_items = [
87+
("Changes since your last review", "only the new commits the author just pushed"),
88+
("All commits", "everything in the PR"),
89+
("Scaffold v1.1 of RMC TotalRisk Users Guide", "commit 85e53a4 — boilerplate"),
90+
("Update preface, installation, GUI, and acronyms for v1.1", "commit 7ae2022 — the content edits"),
91+
]
92+
93+
if n == 1:
94+
caption(d, 160, 24, "1. You've already reviewed. The author has pushed new commits. Come back to the PR.", f_cap)
95+
elif n == 2:
96+
caption(d, 160, 24, "2. On Files changed, click the commit selector pill.", f_cap)
97+
d.rectangle([px - 3, py - 3, px + pw + 3, py + ph + 3], outline=RED, width=4)
98+
elif n == 3:
99+
caption(d, 160, 24, "3. Pick \"Changes since your last review\" at the top of the dropdown.", f_cap)
100+
d.rectangle([px - 3, py - 3, px + pw + 3, py + ph + 3], outline=RED, width=4)
101+
draw_dropdown(d, px, py + ph + 8, dropdown_items, highlighted=0)
102+
elif n == 4:
103+
caption(d, 160, 24, "4. The diff narrows to only the new changes — backcheck just those.", f_cap)
104+
# Highlight the file tree + diff area
105+
d.rectangle([13, 184, 308, 344], outline=RED, width=4)
106+
d.rectangle([336, 380, 1316, 470], outline=RED, width=4)
107+
108+
return Image.alpha_composite(img.convert("RGBA"), overlay).convert("RGB")
109+
110+
111+
def main():
112+
OUT_GIF.parent.mkdir(parents=True, exist_ok=True)
113+
OUT_PPTX.parent.mkdir(parents=True, exist_ok=True)
114+
115+
base = Image.open(SRC).convert("RGBA").crop(CROP)
116+
frames = [render_frame(base, i) for i in range(1, 5)]
117+
frames[0].save(OUT_GIF, save_all=True, append_images=frames[1:], duration=2400, loop=0, optimize=True)
118+
print(f"Wrote {OUT_GIF} ({base.size[0]}x{base.size[1]}, {len(frames)} frames)")
119+
120+
from pptx import Presentation
121+
from pptx.util import Inches
122+
prs = Presentation()
123+
prs.slide_width = Inches(base.size[0] / 96)
124+
prs.slide_height = Inches(base.size[1] / 96)
125+
blank = prs.slide_layouts[6]
126+
for frm in frames:
127+
slide = prs.slides.add_slide(blank)
128+
buf = io.BytesIO()
129+
frm.save(buf, format="PNG")
130+
buf.seek(0)
131+
slide.shapes.add_picture(buf, 0, 0, prs.slide_width, prs.slide_height)
132+
prs.save(str(OUT_PPTX))
133+
print(f"Wrote {OUT_PPTX} ({len(frames)} slides)")
134+
135+
136+
if __name__ == "__main__":
137+
main()

0 commit comments

Comments
 (0)