Function
calculateOptimalLeftWidth
(
welcomeMessage: string,
truncatedCwd: string,
modelLine: string,
)
Source from the content-addressed store, hash-verified
| 78 | * Calculates optimal left panel width based on content |
| 79 | */ |
| 80 | export function calculateOptimalLeftWidth( |
| 81 | welcomeMessage: string, |
| 82 | truncatedCwd: string, |
| 83 | modelLine: string, |
| 84 | ): number { |
| 85 | const contentWidth = Math.max( |
| 86 | stringWidth(welcomeMessage), |
| 87 | stringWidth(truncatedCwd), |
| 88 | stringWidth(modelLine), |
| 89 | 20, // Minimum for clawd art |
| 90 | ) |
| 91 | return Math.min(contentWidth + 4, MAX_LEFT_WIDTH) // +4 for padding |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Formats the welcome message based on username |
Tested by
no test coverage detected