Feature 145/improve task sidebar #147
No reviewers
Labels
No labels
bug
ci
documentation
duplicate
enhancement
feature
good first issue
help wanted
invalid
performance
priority
P0
priority
P1
priority
P2
question
refactor
size
L
size
M
size
S
size
XL
size
XS
tests
trivial
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
noe.trevino/paso!147
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature-145/improve-task-sidebar"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Checklist
CONTRIBUTING.mdgo test ./... -race) locallygofmt -w .andgolangci-lint run ./...respectivelyREADME.mdif applicableSummary
@ -0,0 +1,102 @@package componentsThe empty-items branch is dead code. Both callers pre-guard before calling this function:
renderDetailCommentsreturns early whenlen(comments) == 0(before it ever buildsitems)renderFormCommentsPreviewhandlesactivityCount == 0with its own message before callingRenderActivityPreviewsAdditionally, the label
"No comments"is wrong for a function whose signature accepts genericActivityItemvalues — it will also receive Events. Either remove the branch (since it's unreachable), or if the intent is to keep it for future callers, rename the message to"No activity".strings.Builderadds no value here. This function performs at most ~10 small string concatenations on already-rendered styled strings — not a hot loop over large data. The originalheader := ticketStyle.Render(ticketNumber)+header += "\n" + ...idiom was simpler and equally correct.strings.Builderis an optimisation for many allocations in a tight loop; using it here just adds noise.The test name
CommentsAdaptToHeightimplies the height-adaptive truncation behaviour is verified, but the test only checks the full-height case. There is no assertion that reducing the available height causes items to be hidden. A complementary call with a constrained height (e.g.height=10, which should squeeze out Bob and Charlie) would actually exercise the adaptation path introduced in this PR.Overall: The DRY refactor (extracting
RenderActivityBadge/RenderActivityPreviewItem/RenderActivityPreviewsand deletingrenderActivityBadgePreview) is correct and the height-aware comment rendering is a genuine improvement. Three issues:activity_preview.go:93-97) — the empty-items branch inRenderActivityPreviewsis unreachable from every current call site, and its"No comments"label is semantically wrong for a function that also handles Events.strings.Builder(detail_panel.go:129) — introduced inrenderDetailHeaderfor a handful of small concatenations; adds complexity with zero benefit over the original+idiom.detail_panel_test.go:570) —TestRenderDetailPanel_CommentsAdaptToHeightonly asserts the full-height path; no assertion that a constrained height actually truncates visible items.7/10
no, i like it. tell reader we build string now
its also faster idiot