Skip to content

[feature request] Show new PR review comments on the task row in the sidebar (bot reviews included) #283

Open

Description

@lukaszflorczak

Problem

The sidebar is where I look to know what is happening across tasks: several worktrees open, agents working in them, PRs out for review. It already carries the PR state (TaskPrBadge: open / draft / merged / closed, turning red when checks fail) and it already aggregates activity dots onto a collapsed project or group. What it cannot tell me is the thing I actually wait for: this PR has review feedback on it.

Termic already fetches those comments (pr_comments in forge.rs, the watcher behind the bell on the PR card). It just never shows that they exist. Three things follow from that:

1. The only signal is a toast. Transient, and only if the comment watcher bell is on for that task, and only if a live agent tab is there to receive them. Miss it, or be on another task, and nothing anywhere says a review arrived. The sidebar row looks the same as it did before.

2. Watching means injecting. Turning the bell on does not mean "tell me", it means "queue this into the main agent" (checkComments -> commentPromptFor -> queue or ptyWrite). Often I want to read the review first and decide: some remarks I fix by hand, some are noise, some change what I am about to ask the agent for. Wanting to see that feedback exists should not require handing it straight to an agent.

3. A reviewed PR looks exactly like an unreviewed one. A bot review is submitted as COMMENTED, which leaves reviewDecision empty, and forge.rs maps "" to none, so ReviewChip renders nothing and the sidebar glyph stays plain green. On my PRs (coderabbitai submitting COMMENTED reviews plus inline comments) there is no difference at a glance between a PR nobody has touched and one carrying a full review.

Bot reviews specifically. trusted is authorAssociation in OWNER/MEMBER/COLLABORATOR. coderabbitai[bot] comes back as NONE on my repos (checked with gh api repos/{owner}/{repo}/pulls/comments), so it is untrusted and filtered out by default. The only way to see it is watch_untrusted_comments, which is all or nothing: it also lets any drive-by commenter's text into the agent's PTY. That gate is right for injection. For display it is the wrong trade, because seeing that a bot reviewed my PR is not the same risk as piping an anonymous comment into a terminal.

Expected

In the order I would value it:

  1. A comment signal on the task row in the sidebar. A dot or an accent on TaskPrBadge (or right next to it) when the PR has comments newer than pr_comments_seen_at. Same precedence idea the badge already uses for checks === "failing". Ideally it aggregates onto a collapsed project or group the way projAttention / grpAttention already do, so a folded project still tells me something needs my eyes.
  2. Click it and read them. Author, kind (comment / review / inline), path for inline ones, body, link out. The PR card in the Git tab is the obvious home. Read-only is fine for a first cut; I do not need to reply from the app.
  3. "Hand to agent" as an action, not the only outcome. A button on that list (per comment too, if cheap) that sends exactly the prompt it sends today. The bell can keep working as it does; this makes the automatic path a choice rather than the sole behaviour.
  4. Separate "bot" from "untrusted" for display. GitHub marks these authors (user.type == "Bot", login suffixed [bot]) and GitLab has the same notion. If you would rather keep one knob, a per-project allowlist of comment authors covers my case too.
  5. Optional: when reviewDecision is empty but reviews of state COMMENTED exist, ReviewChip could say "commented" instead of rendering nothing.

Sketch of where it would live

Three things stand between the current code and the sidebar dot, and I think they are the whole feature:

  • Unread is not recoverable from what is stored today. checkComments advances pr_comments_seen_at past everything new, including comments it then filters out as self-authored or untrusted (deliberately, so the tail is not re-considered forever). So the mark alone cannot answer "how many are waiting for me". A count persisted next to it on the task record (pr_comments_unread, or the last fetched list) would.
  • Counting has to be independent of the bell. The watcher only ticks for tasks that opted in, because opting in means injection. A sidebar signal should be there for every task with a PR, which argues for splitting "count and show" from "queue into the agent".
  • The badge reads a live snapshot only. TaskPrBadge takes usePr.byTask[task.id]?.lookup?.pr and falls back to the persisted pr_url with no state, which is why rows not polled this session sit grey (that is [Bug] Sidebar PR badge stays grey, merge not detected #281). A comment count wants the same persistence as pr_number / pr_provider, or it will be blank on exactly the tasks I have not opened yet, which are the ones I most need it on.

Touch points: src/components/sidebar/Sidebar.tsx (TaskPrBadge, and the collapsed-group dots), src/store/pr.ts (already owns the watcher, pr_comments_seen_at and taskSetPrCommentsSeen), src/components/task/PrCard.tsx for the list, and one more field on PrComment in forge.rs for the bot flag, filled from the same JSON that already feeds github_association_trusted.

Termic 1.3.3, macOS 15.7.9, GitHub.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions