fix(home): raw JSON shown for unhandled comment_pull activity event type #375

Closed
opened 2026-07-08 12:53:28 +00:00 by fuzzy · 0 comments
Owner

Problem

The home activity feed shows raw JSON for comment_pull events instead of a formatted string:

comment_pull  thwap/steeper  ["374","1) there is nothing in the bar at the bottom about the keybindings.\r"]

Root Cause

formatActivityDesc in internal/tui/homeview.go doesn't have a case for the comment_pull op type. It falls through to the default if a.Content != "" fallback, which displays the raw JSON verbatim.

Existing Pattern

comment_issue is already handled (lines ~360-364 in homeview.go):

case "comment_issue":
    return fmt.Sprintf("Comment on #%s", parts[0])

Proposed Fix

Add comment_pull to the comment_issue case in formatActivityDesc. The Content format is the same [prNumber, commentText] JSON array:

case "create_issue", "close_issue", "comment_issue", "comment_pull":

And optionally add an opTypeLabel entry:

case "comment_pull":
    return "💬 Commented"

Also consider adding comment_pull to the activityColor mapping if a distinct color is wanted (currently comment_issue uses app.ColorYellow).

## Problem The home activity feed shows raw JSON for `comment_pull` events instead of a formatted string: ``` comment_pull thwap/steeper ["374","1) there is nothing in the bar at the bottom about the keybindings.\r"] ``` ## Root Cause `formatActivityDesc` in `internal/tui/homeview.go` doesn't have a case for the `comment_pull` op type. It falls through to the default `if a.Content != ""` fallback, which displays the raw JSON verbatim. ## Existing Pattern `comment_issue` is already handled (lines ~360-364 in homeview.go): ```go case "comment_issue": return fmt.Sprintf("Comment on #%s", parts[0]) ``` ## Proposed Fix Add `comment_pull` to the `comment_issue` case in `formatActivityDesc`. The Content format is the same `[prNumber, commentText]` JSON array: ```go case "create_issue", "close_issue", "comment_issue", "comment_pull": ``` And optionally add an `opTypeLabel` entry: ```go case "comment_pull": return "💬 Commented" ``` Also consider adding `comment_pull` to the `activityColor` mapping if a distinct color is wanted (currently `comment_issue` uses `app.ColorYellow`).
the.auditor changed title from display error on home panel to fix(home): raw JSON shown for unhandled comment_pull activity event type 2026-07-08 12:53:57 +00:00
fuzzy closed this issue 2026-07-08 13:07:25 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
thwap/steeper#375
No description provided.