Feature 145/improve task sidebar #147

Merged
noe.trevino merged 5 commits from feature-145/improve-task-sidebar into main 2026-05-30 15:01:40 -05:00
Owner

Checklist

  • Read CONTRIBUTING.md
  • Ran tests (go test ./... -race) locally
  • Formatted and linted with gofmt -w . and golangci-lint run ./... respectively
  • Added tests if necessary (significant changes/complex logic)
  • Updated documentation if applicable
  • Updated README.md if applicable

Summary

## Checklist - [x] Read `CONTRIBUTING.md` - [x] Ran tests (`go test ./... -race`) locally - [x] Formatted and linted with `gofmt -w .` and `golangci-lint run ./...` respectively - [x] Added tests if necessary (significant changes/complex logic) - [x] Updated documentation if applicable - [x] Updated `README.md` if applicable ## Summary <!-- What does this PR change and/or fix? Examples: Closes: 54 Fixes: 67 -->
claude[bot] (Migrated from github.com) reviewed 2026-04-15 23:36:38 -05:00
@ -0,0 +1,102 @@
package components
claude[bot] (Migrated from github.com) commented 2026-04-15 23:36:39 -05:00

The empty-items branch is dead code. Both callers pre-guard before calling this function:

  • renderDetailComments returns early when len(comments) == 0 (before it ever builds items)
  • renderFormCommentsPreview handles activityCount == 0 with its own message before calling RenderActivityPreviews

Additionally, the label "No comments" is wrong for a function whose signature accepts generic ActivityItem values — 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".

The empty-items branch is dead code. Both callers pre-guard before calling this function: - `renderDetailComments` returns early when `len(comments) == 0` (before it ever builds `items`) - `renderFormCommentsPreview` handles `activityCount == 0` with its own message before calling `RenderActivityPreviews` Additionally, the label `"No comments"` is wrong for a function whose signature accepts generic `ActivityItem` values — 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"`.
claude[bot] (Migrated from github.com) reviewed 2026-04-15 23:36:44 -05:00
claude[bot] (Migrated from github.com) commented 2026-04-15 23:36:44 -05:00

strings.Builder adds 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 original header := ticketStyle.Render(ticketNumber) + header += "\n" + ... idiom was simpler and equally correct. strings.Builder is an optimisation for many allocations in a tight loop; using it here just adds noise.

`strings.Builder` adds 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 original `header := ticketStyle.Render(ticketNumber)` + `header += "\n" + ...` idiom was simpler and equally correct. `strings.Builder` is an optimisation for many allocations in a tight loop; using it here just adds noise.
claude[bot] (Migrated from github.com) reviewed 2026-04-15 23:36:49 -05:00
claude[bot] (Migrated from github.com) commented 2026-04-15 23:36:49 -05:00

The test name CommentsAdaptToHeight implies 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.

The test name `CommentsAdaptToHeight` implies 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.
claude[bot] commented 2026-04-15 23:36:58 -05:00 (Migrated from github.com)

Overall: The DRY refactor (extracting RenderActivityBadge/RenderActivityPreviewItem/RenderActivityPreviews and deleting renderActivityBadgePreview) is correct and the height-aware comment rendering is a genuine improvement. Three issues:

  1. Dead code with wrong label (activity_preview.go:93-97) — the empty-items branch in RenderActivityPreviews is unreachable from every current call site, and its "No comments" label is semantically wrong for a function that also handles Events.
  2. Gratuitous strings.Builder (detail_panel.go:129) — introduced in renderDetailHeader for a handful of small concatenations; adds complexity with zero benefit over the original + idiom.
  3. Test doesn't cover its stated purpose (detail_panel_test.go:570) — TestRenderDetailPanel_CommentsAdaptToHeight only asserts the full-height path; no assertion that a constrained height actually truncates visible items.

7/10

**Overall:** The DRY refactor (extracting `RenderActivityBadge`/`RenderActivityPreviewItem`/`RenderActivityPreviews` and deleting `renderActivityBadgePreview`) is correct and the height-aware comment rendering is a genuine improvement. Three issues: 1. **Dead code with wrong label** (`activity_preview.go:93-97`) — the empty-items branch in `RenderActivityPreviews` is unreachable from every current call site, and its `"No comments"` label is semantically wrong for a function that also handles Events. 2. **Gratuitous `strings.Builder`** (`detail_panel.go:129`) — introduced in `renderDetailHeader` for a handful of small concatenations; adds complexity with zero benefit over the original `+` idiom. 3. **Test doesn't cover its stated purpose** (`detail_panel_test.go:570`) — `TestRenderDetailPanel_CommentsAdaptToHeight` only asserts the full-height path; no assertion that a constrained height actually truncates visible items. **7/10**
Author
Owner

no, i like it. tell reader we build string now

no, i like it. tell reader we build string now
Author
Owner

its also faster idiot

its also faster idiot
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
noe.trevino/paso!147
No description provided.