(stale: PendingFile[])
| 419 | * without bloating the main banner. |
| 420 | */ |
| 421 | export function formatStaleFooter(stale: PendingFile[]): string { |
| 422 | const MAX = 5; |
| 423 | const now = Date.now(); |
| 424 | const shown = stale.slice(0, MAX); |
| 425 | const lines = shown.map((p) => { |
| 426 | const ageMs = Math.max(0, now - p.lastSeenMs); |
| 427 | return ` - ${p.path} (edited ${ageMs}ms ago)`; |
| 428 | }); |
| 429 | const more = stale.length > MAX ? `\n - …and ${stale.length - MAX} more` : ''; |
| 430 | return ( |
| 431 | `(Note: ${stale.length} file(s) elsewhere in this project are pending index ` + |
| 432 | `sync but were not referenced above:\n${lines.join('\n')}${more})` |
| 433 | ); |
| 434 | } |
| 435 | |
| 436 | /** |
| 437 | * Whole-index degradation banner (issue #876). Emitted at the top of a read |
no test coverage detected