Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "github-mobile-reader",
"version": "0.1.13",
"version": "0.1.14",
"description": "Transform git diffs into mobile-friendly Markdown — no more horizontal scrolling when reviewing code on your phone.",
"keywords": [
"github",
Expand Down
6 changes: 5 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,11 @@ async function processPR(
// AI summary (opt-in — only when geminiKey is provided)
if (geminiKey) {
const summary = await summarizeWithGemini(filename, diff, geminiKey);
if (summary) sections.push(`> 💡 ${summary}\n`);
if (summary) {
const lines = summary.split('\n').filter(l => l.trim());
const quoted = lines.map((l, i) => i === 0 ? `> 💡 ${l}` : `> ${l}`).join('\n');
sections.push(quoted + '\n');
}
}

sections.push(body);
Expand Down
6 changes: 4 additions & 2 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1047,8 +1047,10 @@ function buildBehaviorSummary(lines: string[], mode: "added" | "removed" = "adde
const catchMatch = line.match(/^catch\s*\(\s*(\w+)\s*\)/);
if (catchMatch) { tier2.push(`(catch) \`${catchMatch[1]}\``); continue; }

// ── Tier 3: Conditionals (non-guard) ────────────────────
const condMatch = line.match(/^(if|else if)\s*\((.{1,60})\)/);
// ── Tier 3: Conditionals (non-guard)
// Only match `if (cond) {` or `if (cond)` at end of line — reject inline one-liners
// like `if (x) doSomething()` which produce garbled output
const condMatch = line.match(/^(if|else if)\s*\(([^)]{1,60})\)\s*\{?\s*$/);
if (condMatch) { tier3.push(`(cond) \`${condMatch[2].trim()}\``); continue; }

// ── Tier 4: useEffect ────────────────────────────────────
Expand Down