Skip to content

📛 feat(notes): show agent author in inline notes and popovers#293

Open
sdougbrown wants to merge 1 commit into
modem-dev:mainfrom
sdougbrown:pr/named-agent-display
Open

📛 feat(notes): show agent author in inline notes and popovers#293
sdougbrown wants to merge 1 commit into
modem-dev:mainfrom
sdougbrown:pr/named-agent-display

Conversation

@sdougbrown
Copy link
Copy Markdown

@sdougbrown sdougbrown commented May 11, 2026

Summary

Surface the optional author field on agent annotations in the TUI. The schema has carried author end-to-end through sidecar JSON, the session daemon, and the wire protocol, but the inline note's title bar always rendered a generic "AI note" label. Multi-agent reviews are hard to read at a glance because every note looks the same.

With this change:

  • inlineNoteTitle() in AgentInlineNote.tsx and the matching popover title in AgentCard.tsx + agentPopover.ts are author-aware.
  • Falls back to "AI note" when an annotation has no author (backward compat).
  • examples/3-agent-review-demo/agent-context.json now uses named authors so the demo exercises the new path.

No file is renamed, no public API changes. The annotation schema itself was unchanged.

Verified

  • bun run typecheck
  • bun run lint
  • bun test — only the pre-existing baseline failures on upstream/main (5 jj-binary-missing + 9 session-daemon-timing) reproduce; no new failures.
  • bun run test:integration (PTY)
  • bun run test:tty-smoke
  • Manual TTY smoke on examples/3-agent-review-demo/change.patch with --agent-context examples/3-agent-review-demo/agent-context.json.

New unit coverage in ui-components.test.tsx exercises: author rendering, fallback when author is absent, multi-note index suffixing, and special-character authors. The popover title path is covered by the existing AgentCard snapshot tests.

Related

Paired with #294, which adds per-author colour tinting on top of these title changes. The two are intended to merge in order — this PR first, since #294's colour tests assert the author-in-title rendering added here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 11, 2026

Confidence Score: 4/5

Safe to merge; the change is narrowly scoped to title rendering and falls back correctly when no author is present.

The author-aware title logic is straightforward, backward-compatible, and well-tested. The only notable issue is that inlineNoteTitle in AgentInlineNote.tsx duplicates the identical conditional from agentPopoverTitle in agentPopover.ts; if the title format evolves the two copies will need to be updated in sync.

src/ui/components/panes/AgentInlineNote.tsx — duplicated title-building logic that should share a single source of truth with agentPopover.ts.

Important Files Changed

Filename Overview
src/ui/components/panes/AgentInlineNote.tsx Adds author parameter to inlineNoteTitle(); logic is correct but duplicates the identical branch in agentPopoverTitle() rather than reusing it.
src/ui/lib/agentPopover.ts Adds author parameter to agentPopoverTitle() and buildAgentPopoverContent(); logic is clean and the fallback is correct.
src/ui/components/panes/AgentCard.tsx Adds optional author prop and passes it through to buildAgentPopoverContent(); straightforward prop threading with no issues.
src/ui/components/ui-components.test.tsx Adds six new unit tests covering author rendering, fallback, multi-note indexing, and special characters; missing one branch (multi-note without author in AgentInlineNote).
examples/3-agent-review-demo/agent-context.json Adds author fields ("sonnet", "prism") to annotations and a new prism annotation; exercises the new rendering path in the demo.
CHANGELOG.md Adds a concise entry for the new author-aware note title behaviour.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[AgentAnnotation\nauthor?: string] --> B[AgentInlineNote]
    A --> C[AgentCard]

    B --> D["inlineNoteTitle(noteIndex, noteCount, author)"]
    C --> E["buildAgentPopoverContent({ author })"]
    E --> F["agentPopoverTitle(noteIndex, noteCount, author)"]

    D --> G{author present?}
    F --> G

    G -- yes, noteCount > 1 --> H["'author N/total'"]
    G -- yes, noteCount = 1 --> I["'author'"]
    G -- no, noteCount > 1 --> J["'AI note N/total'"]
    G -- no, noteCount = 1 --> K["'AI note'"]
Loading

Fix All in Claude Code Fix All in Codex

Reviews (1): Last reviewed commit: "📛 feat(notes): show agent author in inl..." | Re-trigger Greptile

Comment thread src/ui/components/panes/AgentInlineNote.tsx Outdated
Comment thread src/ui/components/ui-components.test.tsx
@sdougbrown sdougbrown force-pushed the pr/named-agent-display branch from ee52b4f to 2864ede Compare May 11, 2026 21:50
The AgentAnnotation schema has carried an optional `author` field
end-to-end (sidecar JSON, session daemon, wire protocol) but the TUI
never surfaced it. Render it in the note title bar and the matching
agent popover so reviewers can tell which agent left which note when
multiple agents annotate the same diff. Falls back to "AI note" when
author is absent for backward compat.
@sdougbrown sdougbrown force-pushed the pr/named-agent-display branch from 2864ede to 6ae1e5f Compare May 12, 2026 00:55
@benvinegar
Copy link
Copy Markdown
Member

@sdougbrown Makes total sense.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants