Fix Telegram code block rendering — remove leading spaces from messages

Telegram Markdown treats lines starting with spaces as preformatted code
blocks. Replaced leading spaces with bullet points and arrows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 14:14:47 -08:00
parent ba4bc9ac03
commit c4e5dbc32a
2 changed files with 10 additions and 10 deletions

View File

@@ -97,7 +97,7 @@ export function formatSearchSummary(added, skipped, platforms, trackCounts = {})
if (Object.keys(trackCounts).length > 0) { if (Object.keys(trackCounts).length > 0) {
lines.push(''); lines.push('');
for (const [track, counts] of Object.entries(trackCounts)) { for (const [track, counts] of Object.entries(trackCounts)) {
lines.push(` • *${track}*: ${counts.added} new / ${counts.found} found`); lines.push(`• *${track}*: ${counts.added} new / ${counts.found} found`);
} }
} }
return lines.join('\n'); return lines.join('\n');
@@ -130,8 +130,8 @@ export function formatApplySummary(results) {
lines.push(`${emoji} *${label}:*`); lines.push(`${emoji} *${label}:*`);
for (const j of jobs) { for (const j of jobs) {
const shortUrl = (j.url || '').replace(/^https?:\/\/(?:www\.)?/, '').replace(/\/$/, ''); const shortUrl = (j.url || '').replace(/^https?:\/\/(?:www\.)?/, '').replace(/\/$/, '');
lines.push(` ${j.title} @ ${j.company}`); lines.push(`${j.title} @ ${j.company}`);
if (shortUrl) lines.push(` ${shortUrl}`); if (shortUrl) lines.push(`${shortUrl}`);
} }
} }
@@ -151,7 +151,7 @@ export function formatFilterSummary({ passed, filtered, errors, cost, topJobs =
if (topJobs.length > 0) { if (topJobs.length > 0) {
lines.push('', '*Top scores:*'); lines.push('', '*Top scores:*');
for (const j of topJobs.slice(0, 5)) { for (const j of topJobs.slice(0, 5)) {
lines.push(` ${j.score}${j.title} @ ${j.company}`); lines.push(`${j.score}${j.title} @ ${j.company}`);
} }
} }
return lines.join('\n'); return lines.join('\n');

View File

@@ -166,7 +166,7 @@ function formatReport(s) {
? `⚠️ Last run interrupted ${timeAgo(sr.last_run?.started_at)} (partial results saved)` ? `⚠️ Last run interrupted ${timeAgo(sr.last_run?.started_at)} (partial results saved)`
: `⏸️ Last ran ${timeAgo(sr.last_run?.finished_at)}`; : `⏸️ Last ran ${timeAgo(sr.last_run?.finished_at)}`;
const lastRunDetail = sr.last_run && !sr.running const lastRunDetail = sr.last_run && !sr.running
? ` Found ${sr.last_run.added} new jobs (${sr.last_run.seen} seen, ${sr.last_run.skipped_dupes || 0} dupes)` ? ` Found ${sr.last_run.added} new jobs (${sr.last_run.seen} seen, ${sr.last_run.skipped_dupes || 0} dupes)`
: null; : null;
// Applier section // Applier section
@@ -175,7 +175,7 @@ function formatReport(s) {
? `🔄 Running now` ? `🔄 Running now`
: `⏸️ Last ran ${timeAgo(ar.last_run?.finished_at)}`; : `⏸️ Last ran ${timeAgo(ar.last_run?.finished_at)}`;
const lastApplierDetail = ar.last_run && !ar.running const lastApplierDetail = ar.last_run && !ar.running
? ` Applied ${ar.last_run.submitted} jobs in that run` ? ` Applied ${ar.last_run.submitted} jobs in that run`
: null; : null;
const lines = [ const lines = [
@@ -194,11 +194,11 @@ function formatReport(s) {
byPlatform[t.platform].push(t); byPlatform[t.platform].push(t);
} }
for (const [platform, tracks] of Object.entries(byPlatform)) { for (const [platform, tracks] of Object.entries(byPlatform)) {
lines.push(` ${platform.charAt(0).toUpperCase() + platform.slice(1)}:`); lines.push(`${platform.charAt(0).toUpperCase() + platform.slice(1)}:`);
for (const t of tracks) { for (const t of tracks) {
const pct = t.total > 0 ? Math.round((t.done / t.total) * 100) : 0; const pct = t.total > 0 ? Math.round((t.done / t.total) * 100) : 0;
const bar = t.complete ? '✅ done' : `${t.done}/${t.total} keywords (${pct}%)`; const bar = t.complete ? '✅ done' : `${t.done}/${t.total} keywords (${pct}%)`;
lines.push(` ${t.track}: ${bar}`); lines.push(`${t.track}: ${bar}`);
} }
} }
} }
@@ -237,14 +237,14 @@ function formatReport(s) {
[q.skipped_external, 'External ATS'], [q.skipped_external, 'External ATS'],
]; ];
for (const [count, label] of queueLines) { for (const [count, label] of queueLines) {
if (count > 0) lines.push(` ${label}: ${count}`); if (count > 0) lines.push(` ${label}: ${count}`);
} }
// Ready-to-apply breakdown by type // Ready-to-apply breakdown by type
if (s.apply_type_breakdown && Object.keys(s.apply_type_breakdown).length > 0) { if (s.apply_type_breakdown && Object.keys(s.apply_type_breakdown).length > 0) {
const sorted = Object.entries(s.apply_type_breakdown).sort((a, b) => b[1] - a[1]); const sorted = Object.entries(s.apply_type_breakdown).sort((a, b) => b[1] - a[1]);
const parts = sorted.map(([type, count]) => `${type} ${count}`); const parts = sorted.map(([type, count]) => `${type} ${count}`);
lines.push(` Breakdown: ${parts.join(', ')}`); lines.push(` Breakdown: ${parts.join(', ')}`);
} }
// Last applied // Last applied