Skip to content

Commit 5159a0b

Browse files
fix: add pr_title to CSV schema and fix modal JS crash
- Add pr_title column to CSV_FIELDNAMES and CSVBatchWriter.add_row() - Pass result["title"] from GitHub API into all three CSV write sites in batch.py - Use real pr_title in _build_team_dev_prs with fallback to URL-derived title - Fix forEach crash on non-array chartData values (leaderboard is an object) which also blocked the modal X button from registering its event listener Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5b2dbc7 commit 5159a0b

4 files changed

Lines changed: 11 additions & 2 deletions

File tree

cli/batch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,7 @@ def _write_row_from_result(pr_url_result: str, result: Dict[str, Any]) -> None:
949949
lines_added=lines_added,
950950
lines_deleted=lines_deleted,
951951
approved_by=approved_by,
952+
pr_title=result.get("title", ""),
952953
)
953954

954955
try:
@@ -1378,6 +1379,7 @@ def process_single_pr(
13781379
lines_added=lines_added,
13791380
lines_deleted=lines_deleted,
13801381
source=result.get("source"),
1382+
pr_title=result.get("title", ""),
13811383
)
13821384

13831385
if label_applied:
@@ -1443,6 +1445,7 @@ def process_single_pr(
14431445
lines_added=lines_added,
14441446
lines_deleted=lines_deleted,
14451447
source=result.get("source"),
1448+
pr_title=result.get("title", ""),
14461449
)
14471450

14481451
with completed_lock:

cli/csv_handler.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"explanation",
2323
"source",
2424
"approved_by",
25+
"pr_title",
2526
]
2627

2728

@@ -92,6 +93,7 @@ def add_row(
9293
lines_deleted: Optional[int] = None,
9394
source: Optional[str] = None,
9495
approved_by: Optional[str] = None,
96+
pr_title: Optional[str] = None,
9597
) -> None:
9698
"""
9799
Add a row to the buffer, flush if batch size reached.
@@ -129,6 +131,7 @@ def add_row(
129131
"explanation": explanation,
130132
"source": source,
131133
"approved_by": approved_by or "",
134+
"pr_title": pr_title or "",
132135
}
133136
# Ensure all fieldnames present
134137
for fn in self._fieldnames:

reports/chart_data.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ def _build_team_dev_prs(df: pd.DataFrame) -> Dict[str, Any]:
8787
else:
8888
merged_at = ""
8989

90+
pr_title = str(row.get("pr_title", "") or "").strip()
9091
pr_dict = {
91-
"title": _pr_title_from_url(pr_url),
92+
"title": pr_title if pr_title else _pr_title_from_url(pr_url),
9293
"url": pr_url,
9394
"complexity": float(row.get("complexity", 0) or 0),
9495
"merged_at": merged_at,

reports/interactive_report.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1805,7 +1805,9 @@ def build_interactive_report(
18051805
const allChartEntries = [];
18061806
18071807
tabOrder.forEach(key => {{
1808-
(chartData[key] || []).forEach((c, idx) => {{
1808+
const _tabVal = chartData[key];
1809+
if (!Array.isArray(_tabVal)) return;
1810+
_tabVal.forEach((c, idx) => {{
18091811
allChartEntries.push({{ tab: key, idx, data: c, title: c.title || '', subtitle: c.subtitle || '' }});
18101812
}});
18111813
}});

0 commit comments

Comments
 (0)