MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / createFallbackTitle

Function createFallbackTitle

source code/components/Feedback.tsx:477–501  ·  view source on GitHub ↗
(description: string)

Source from the content-addressed store, hash-verified

475 }
476}
477function createFallbackTitle(description: string): string {
478 // Create a safe fallback title based on the bug description
479
480 // Try to extract a meaningful title from the first line
481 const firstLine = description.split('\n')[0] || '';
482
483 // If the first line is very short, use it directly
484 if (firstLine.length <= 60 && firstLine.length > 5) {
485 return firstLine;
486 }
487
488 // For longer descriptions, create a truncated version
489 // Truncate at word boundaries when possible
490 let truncated = firstLine.slice(0, 60);
491 if (firstLine.length > 60) {
492 // Find the last space before the 60 char limit
493 const lastSpace = truncated.lastIndexOf(' ');
494 if (lastSpace > 30) {
495 // Only trim at word if we're not cutting too much
496 truncated = truncated.slice(0, lastSpace);
497 }
498 truncated += '...';
499 }
500 return truncated.length < 10 ? 'Bug Report' : truncated;
501}
502
503// Helper function to sanitize and log errors without exposing API keys
504function sanitizeAndLogError(err: unknown): void {

Callers 1

generateTitleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected