Skip to content

Commit 304a487

Browse files
authored
Merge branch 'main' into release
2 parents 0744c93 + 0569d16 commit 304a487

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/webview/diagnostics/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function formatDate(isoString: string | null): string {
119119
return "N/A";
120120
}
121121
try {
122-
return new Date(isoString).toLocaleString();
122+
return escapeHtml(new Date(isoString).toLocaleString());
123123
} catch {
124124
return escapeHtml(isoString);
125125
}
@@ -535,7 +535,7 @@ function renderSessionTable(
535535
<td class="repository-cell" title="${sf.repository ? escapeHtml(sf.repository) : "No repository detected"}">${sf.repository ? escapeHtml(getRepoDisplayName(sf.repository)) : '<span style="color: #666;">—</span>'}</td>
536536
<td>${formatFileSize(sf.size)}</td>
537537
<td>${sanitizeNumber(sf.interactions)}</td>
538-
<td title="${getContextRefsSummary(sf.contextReferences)}">${sanitizeNumber(getTotalContextRefs(sf.contextReferences))}</td>
538+
<td title="${escapeHtml(getContextRefsSummary(sf.contextReferences))}">${sanitizeNumber(getTotalContextRefs(sf.contextReferences))}</td>
539539
<td>${formatDate(sf.lastInteraction)}</td>
540540
<td>
541541
<a href="#" class="view-formatted-link" data-file="${encodeURIComponent(sf.file)}" title="View formatted JSONL file">📄 View</a>

src/webview/usage/main.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ function renderLayout(stats: UsageAnalysisStats): void {
323323
<th style="text-align: center; padding: 8px; border-bottom: 2px solid #2a2a30;">Sessions</th>
324324
${matrix.customizationTypes.map(type => `
325325
<th style="text-align: center; padding: 8px; border-bottom: 2px solid #2a2a30;" title="${escapeHtml(type.label)}">
326-
${type.icon}
326+
${escapeHtml(type.icon)}
327327
</th>
328328
`).join('')}
329329
</tr>
@@ -351,7 +351,7 @@ function renderLayout(stats: UsageAnalysisStats): void {
351351
: 'Status unknown';
352352
return `
353353
<td style="position: relative; padding: 6px 8px; border-bottom: 1px solid #2a2a30; text-align: center; font-size: 16px;" title="${statusLabel}" aria-label="${statusLabel}">
354-
<span aria-hidden="true">${status}</span>
354+
<span aria-hidden="true">${escapeHtml(status)}</span>
355355
<span style="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;">${statusLabel}</span>
356356
</td>
357357
`;
@@ -364,7 +364,7 @@ function renderLayout(stats: UsageAnalysisStats): void {
364364
<div style="margin-top: 12px; font-size: 10px; color: #999; border-top: 1px solid #2a2a30; padding-top: 8px;">
365365
<div style="display: flex; gap: 16px; flex-wrap: wrap;">
366366
${matrix.customizationTypes.map(type => `
367-
<span>${type.icon} ${escapeHtml(type.label)}</span>
367+
<span>${escapeHtml(type.icon)} ${escapeHtml(type.label)}</span>
368368
`).join('')}
369369
</div>
370370
<div style="margin-top: 8px;">
@@ -884,7 +884,7 @@ function renderLayout(stats: UsageAnalysisStats): void {
884884
</div>
885885
886886
<div class="footer">
887-
Last updated: ${new Date(stats.lastUpdated).toLocaleString()} · Updates every 5 minutes
887+
Last updated: ${escapeHtml(new Date(stats.lastUpdated).toLocaleString())} · Updates every 5 minutes
888888
</div>
889889
</div>
890890
`;
@@ -1358,7 +1358,7 @@ function renderRepositoryHygienePanels(): void {
13581358
${escapeHtml(ws.workspaceName)}
13591359
</div>
13601360
<div style="font-size: 10px; color: #999; margin-top: 2px;">
1361-
${ws.sessionCount} ${ws.sessionCount === 1 ? 'session' : 'sessions'} · ${ws.interactionCount} ${ws.interactionCount === 1 ? 'interaction' : 'interactions'} · Score: ${escapeHtml(scoreLabel)}
1361+
${Number(ws.sessionCount) || 0} ${ws.sessionCount === 1 ? 'session' : 'sessions'} · ${Number(ws.interactionCount) || 0} ${ws.interactionCount === 1 ? 'interaction' : 'interactions'} · Score: ${escapeHtml(scoreLabel)}
13621362
</div>
13631363
</div>
13641364
<vscode-button class="btn-repo-action" data-action="${buttonAction}" data-workspace-path="${escapeHtml(ws.workspacePath)}" ${isCurrentSelection ? 'disabled="true"' : ''} style="min-width: 80px;">

0 commit comments

Comments
 (0)