@@ -53323,12 +53323,18 @@ function wrapText(text, maxWidth) {
5332353323 let currentLine = '';
5332453324
5332553325 words.forEach(word => {
53326- const testLine = currentLine ? `${currentLine} ${word}` : word;
53326+ // Handle words that exceed maxWidth by truncating with ellipsis
53327+ let processedWord = word;
53328+ if (word.length > maxWidth) {
53329+ processedWord = word.substring(0, maxWidth - 3) + '...';
53330+ }
53331+
53332+ const testLine = currentLine ? `${currentLine} ${processedWord}` : processedWord;
5332753333 if (testLine.length <= maxWidth) {
5332853334 currentLine = testLine;
5332953335 } else {
5333053336 if (currentLine) lines.push(currentLine);
53331- currentLine = word ;
53337+ currentLine = processedWord ;
5333253338 }
5333353339 });
5333453340
@@ -53446,16 +53452,19 @@ function formatEventsAsSVG(events) {
5344653452 svg += ` <rect class="${rowClass}" x="0" y="${row.y - rowSpacing/2}" width="${width}" height="${row.height}"/>\n`;
5344753453 svg += ` <line x1="${padding}" y1="${row.y + row.height - rowSpacing/2}" x2="${width - padding}" y2="${row.y + row.height - rowSpacing/2}" class="row-border"/>\n`;
5344853454
53449- // Number
53450- svg += ` <text x="${padding + 5}" y="${ row.y + 4}" class="number">${ row.index}.</text>\n` ;
53455+ // Calculate vertical center of the row
53456+ const rowCenterY = row.y + ( row.height / 2) ;
5345153457
53452- // Date
53453- svg += ` <text x="${padding + 35 }" y="${row.y + 4 }" class="date-text ">${escapeXml( row.date)} </text>\n`;
53458+ // Number - centered vertically in the row
53459+ svg += ` <text x="${padding + 5 }" y="${rowCenterY }" dominant-baseline="middle" class="number ">${row.index}. </text>\n`;
5345453460
53455- // Description lines
53461+ // Date - positioned above center with symmetric spacing
53462+ svg += ` <text x="${padding + 35}" y="${rowCenterY - 8}" dominant-baseline="middle" class="date-text">${escapeXml(row.date)}</text>\n`;
53463+
53464+ // Description lines - positioned below date with consistent spacing
5345653465 row.lines.forEach((line, lineIdx) => {
53457- const textY = row.y + 4 + (( lineIdx + 1) * lineHeight);
53458- svg += ` <text x="${padding + 35}" y="${textY}" class="desc-text">${escapeXml(line)}</text>\n`;
53466+ const textY = rowCenterY + 8 + (lineIdx * lineHeight);
53467+ svg += ` <text x="${padding + 35}" y="${textY}" dominant-baseline="middle" class="desc-text">${escapeXml(line)}</text>\n`;
5345953468 });
5346053469 });
5346153470
@@ -53667,8 +53676,12 @@ async function writeSvgFile(activityData) {
5366753676 // File doesn't exist yet, that's fine
5366853677 }
5366953678
53679+ // Cache normalized strings to avoid redundant operations
53680+ const normalizedCurrent = currentContent.replace(/\s+/g, ' ').trim();
53681+ const normalizedNew = svgContent.replace(/\s+/g, ' ').trim();
53682+
5367053683 // Don't update if content hasn't changed
53671- if (currentContent.replace(/\s+/g, ' ').trim() === svgContent.replace(/\s+/g, ' ').trim() ) {
53684+ if (normalizedCurrent === normalizedNew ) {
5367253685 core.notice('📄 No changes in SVG file, skipping...');
5367353686 if (process.env.ACT || dryRun) {
5367453687 logDebugActivity(svgContent);
0 commit comments