fix(tui): wrap long artifact lines in viewer instead of truncating

Artifact content wider than the modal was silently cut off. Lines are now
hard-wrapped at rune boundaries to the modal content width, and scroll
clamping uses the wrapped line count so the last page stays reachable.
This commit is contained in:
2026-06-10 20:54:39 +04:00
parent cba9dd4583
commit c82a86477d
2 changed files with 49 additions and 10 deletions
+2 -1
View File
@@ -401,7 +401,8 @@ func (m Model) handleOverlayKey(k tea.KeyMsg) (tea.Model, tea.Cmd) {
m.artifactScroll--
}
case k.Type == tea.KeyPgDown:
if m.artifactScroll < m.artifactContentMaxScroll() {
contentW := m.modalWidth() - 6
if m.artifactScroll < m.artifactContentMaxScroll(contentW) {
m.artifactScroll++
}
case runeIs(k, "v"):