fix(tui): clean up stream row density — drop ID, fix newline leak, align margins

ID cluttered rows and caused wrapping on long entries. Body newlines
leaked into stream rendering extra unindented lines. Cursor glyph
shifted selected rows 1 col right of unselected.

Remove ID from all row renderers (detail pane already shows it),
collapse multiline body to first line, cap tags to 2 in stream,
and reserve cursor column on unselected rows for consistent alignment.
This commit is contained in:
2026-05-20 18:12:18 -04:00
parent 98fdae1e3a
commit 3eb778f31b
4 changed files with 22 additions and 18 deletions
+9 -9
View File
@@ -204,23 +204,23 @@ func renderEntity(e *db.Entity, maxWidth int) string {
}
glyph := style.Render(glyphStr)
id := idStyle.Render("[" + display.FormatID(e.ID) + "]")
body := e.Body
if e.Title != nil {
body = *e.Title
}
if idx := strings.IndexByte(body, '\n'); idx >= 0 {
body = body[:idx]
}
var extras []string
if e.Pinned {
extras = append(extras, pinnedStyle.Render("•"))
}
if len(e.Tags) > 0 {
tagParts := make([]string, len(e.Tags))
for i, t := range e.Tags {
tagParts[i] = tagStyle.Render("#" + t)
limit := min(2, len(e.Tags))
for _, t := range e.Tags[:limit] {
extras = append(extras, tagStyle.Render("#"+t))
}
extras = append(extras, strings.Join(tagParts, " "))
}
extraStr := ""
@@ -228,11 +228,11 @@ func renderEntity(e *db.Entity, maxWidth int) string {
extraStr = " " + strings.Join(extras, " ")
}
line := fmt.Sprintf("%s %s%s %s", glyph, body, extraStr, id)
line := fmt.Sprintf("%s %s%s", glyph, body, extraStr)
if maxWidth > 0 && len(stripAnsi(line)) > maxWidth {
body = truncate(body, maxWidth-20)
line = fmt.Sprintf("%s %s%s %s", glyph, body, extraStr, id)
body = truncate(body, maxWidth-6)
line = fmt.Sprintf("%s %s%s", glyph, body, extraStr)
}
return line