Skip to content

fix(td): fix task title truncation in td view (Fixes #215)#217

Merged
marcus merged 2 commits intomainfrom
shrike/issue-215-fix-title-truncation
Mar 1, 2026
Merged

fix(td): fix task title truncation in td view (Fixes #215)#217
marcus merged 2 commits intomainfrom
shrike/issue-215-fix-title-truncation

Conversation

@marcus
Copy link
Owner

@marcus marcus commented Mar 1, 2026

Problem

Task titles in sidecar's embedded td view are truncated earlier than necessary (Fixes #215).

Root cause: A calculation error in formatIssueShort (td package) overestimated the row overhead by 3 chars:

  • The category tag was counted as 8 chars (" [TAG] ") but is actually 6 chars ("[TAG] " — no leading spaces)
  • The type icon was hardcoded as 2 chars wide; all actual icons are 1 visual char wide

This caused titles to truncate 3 chars earlier than needed in both td monitor and sidecar's embedded td view. Both tools use the same rendering code path.

Fix

Updated td dependency to v0.41.0 which corrects the overhead calculation in formatIssueShort:

// Before (wrong):
overhead := 4 + 8 + 2 + lipgloss.Width(idStr) + lipgloss.Width(priorityStr) + 3

// After (correct):
overhead := 4 + 5 + 1 + lipgloss.Width(typeIcon) + lipgloss.Width(idStr) + lipgloss.Width(priorityStr) + 3

Before / After (80 col terminal)

Before: [RDY] ■ td-484f39 P2 Long title two investigating td monitor panel ...
After: [RDY] ■ td-484f39 P2 Long title two investigating td monitor panel wid...

3 more characters of title visible before truncation.

Testing

  • All tests pass: go test ./...
  • Manually verified with betamax screenshots at 80 cols

Adds scripts/pre-commit.sh that runs:
- gofmt on staged .go files
- go vet ./...
- go build ./...

Install with: make install-hooks

Also adds make install-hooks target and documents it in README.
In the task list panel, task titles were being truncated 3 characters
earlier than necessary due to an incorrect overhead calculation in
formatIssueShort (td pkg/monitor).

Root cause: the row prefix was counted as 8 chars ('  [TAG] ' with
2 phantom leading spaces) but the actual format is '[TAG] ' = 6 chars.
Additionally the type icon was hardcoded as 2 chars wide when all icons
are 1 visual char wide.

td v0.41.0 fixes this by computing overhead from actual char widths:
  overhead = 4(panel) + 5(tag) + 1(space) + typeIconWidth + idWidth + priWidth + 3(spaces)

This gives task titles 3 more display characters, making them more
readable in both standalone td monitor and sidecar's embedded td view.

Fixes #215
@marcus marcus merged commit 091ce26 into main Mar 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

td: task titles are cutoff

1 participant