feat: pr tab switching btwn body/diff

This commit is contained in:
2026-05-25 23:49:33 +01:00
parent 91a57cbc0f
commit 231353bea4
13 changed files with 500 additions and 352 deletions

View File

@@ -234,12 +234,12 @@ fn render_github_fixtures(fixture_root: &Path) -> String {
output.push_str(&string_literal(&path));
output.push_str(", ");
match reff {
| Some(reff) => {
output.push_str("Some(");
output.push_str(&string_literal(&reff));
output.push(')');
}
| None => output.push_str("None"),
| Some(reff) => {
output.push_str("Some(");
output.push_str(&string_literal(&reff));
output.push(')');
}
| None => output.push_str("None"),
}
output.push_str(") => Some(");
output.push_str(&string_literal(&content));
@@ -293,8 +293,8 @@ fn render_github_fixtures(fixture_root: &Path) -> String {
output.push_str(&string_literal(&id));
output.push_str(", ");
match previous_end_cursor.as_deref() {
| Some(after) => output.push_str(&format!("Some({})", string_literal(after))),
| None => output.push_str("None"),
| Some(after) => output.push_str(&format!("Some({})", string_literal(after))),
| None => output.push_str("None"),
}
output.push_str(") => Some(");
output.push_str(&string_literal(&fixture.json));
@@ -429,9 +429,9 @@ fn issue_fixture_state(issue: &serde_json::Value) -> &'static str {
}
match required_string(issue, &["state"]) {
| "open" => "OPEN",
| "closed" => "CLOSED",
| state => panic!("unsupported pull request state in fixture: {state}"),
| "open" => "OPEN",
| "closed" => "CLOSED",
| state => panic!("unsupported pull request state in fixture: {state}"),
}
}
@@ -500,8 +500,8 @@ fn collect_repo_file_content_fixtures(
let owner = parts[0].clone();
let repo = parts[1].clone();
let reff = match parts[2].as_str() {
| "@default" => None,
| value => Some(value.to_owned()),
| "@default" => None,
| value => Some(value.to_owned()),
};
let virtual_path = parts[3..].join("/");
let content = fs::read_to_string(&path).unwrap_or_else(|err| {