fix(td): fix task title truncation in td view (Fixes #215)#217
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:" [TAG] ") but is actually 6 chars ("[TAG] "— no leading spaces)This caused titles to truncate 3 chars earlier than needed in both
td monitorand 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 / 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
go test ./...