renderTurnHeader returns a "── 15:23:45 ─────────…" divider sized to width. Called when the user submits a new prompt so each turn has an unmistakable boundary in the scrollback.
(width int)
| 912 | // width. Called when the user submits a new prompt so each turn has an |
| 913 | // unmistakable boundary in the scrollback. |
| 914 | func renderTurnHeader(width int) string { |
| 915 | if width < 24 { |
| 916 | width = 80 |
| 917 | } |
| 918 | leftSep := "── " |
| 919 | label := " " + time.Now().Format("15:04:05") + " " |
| 920 | // lipgloss.Width handles wide characters / ANSI sanely. |
| 921 | used := lipgloss.Width(leftSep) + lipgloss.Width(label) |
| 922 | tail := width - used |
| 923 | if tail < 3 { |
| 924 | tail = 3 |
| 925 | } |
| 926 | return turnDividerStyle.Render(leftSep) + |
| 927 | turnTimestampStyle.Render(label) + |
| 928 | turnDividerStyle.Render(strings.Repeat("─", tail)) |
| 929 | } |
| 930 | |
| 931 | var debugBoxStyle = lipgloss.NewStyle(). |
| 932 | Border(lipgloss.NormalBorder()). |