Skip to content

fix(web): every thread and agent hover comes from the preview registry - #394

Merged
adampeterhiggins merged 1 commit into
mainfrom
fix/web-registry-owned-hover-previews
Oct 20, 2026
Merged

adampeterhiggins merged 1 commit into
mainfrom
fix/web-registry-owned-hover-previews

Conversation

@adampeterhiggins

Copy link
Copy Markdown
Owner

Problem

The same thread showed different hover previews depending on where you hovered it. A thread chip in a user message showed a sparse card (title, project, model, branch), while an agent's "Read thread" row showed status and recent messages, and sidebar rows showed a third, richer card. Agents had the same split: conversation rows, Lineage and workflow members used a compact tooltip, while @agent chips showed the Agents panel card.

The context presentation registry from #369 only governed context chips. Sidebar rows, tool cards and relationship rows drew their own hovers, and nothing stopped them.

Fix

  • One thread preview. The registry's thread body (ThreadHoverCard.tsx) now has the sidebar's metadata (project, environment, branch and checkout mismatch, provider/model, handoff, started-by, terminals, errors, PRs) plus the thread's latest messages, which load only while the preview is open. v2 shells never carry a message (latestVisibleMessage is always null), so the old chip preview's message line was dead.
  • Every thread hover uses it: chips, thread links, all five sidebar row kinds, the read-thread tool card (which shows what the agent read rather than the live thread), and parent/fork rows in thread details, which previously only showed a text hint.
  • One agent preview. Conversation agent rows, Lineage rows and workflow members now use the registry's Agents panel card. SubagentTooltipContent is deleted. Its catalog model name, effort, speed icon and branch/worktree lines moved into the card (SubagentModelLabel.tsx). Workflow members without a thread yet still preview, via agentFleetEntryFromRuntime.
  • Rows can use the registry. ContextPreviewHover takes a placement and disabled.
  • Guard. A new t3code/no-unregistered-context-preview lint rule (with tests) stops anything outside the registry from importing preview bodies.
  • Sidebar. Rows no longer run a git status query each just for the hover's branch-mismatch line; the preview queries when opened. The provider-entries atom moved to state/providerEntries.ts so the preview can share it.

Verification

  • Web and client-runtime typecheck are clean, and lint is clean on changed files.
  • The new lint rule's tests pass, as does a new unit test for latestThreadPreviewItems.
  • Passing existing tests:
    • unit: contextPresentationRegistry, ThreadRelationshipsControl.logic, V2LifecycleRow.logic, agentFleet, toolPreview
    • browser: WorkflowOpeningBlock, ThreadDetailsPrRows
  • ThreadRelationshipsControl.agents.browser.test.tsx still has the same 13 failures it has on main (child.turnItems undefined in SubagentActivityLine). I confirmed this on an unmodified checkout, and a separate fix is in progress. This PR only updates that file's mocks so preview cards render inline.
  • Not yet checked in a real client. Before/after screenshots are still to come.

Claude Opus 5.5 via Claude Code in T3 Code.

🤖 Generated with Claude Code

Thread chips showed a sparse hover while the sidebar, an agent's "Read
thread" row and the thread details list each drew their own, richer one.
Agent rows in the conversation, Lineage and workflow members used a
compact tooltip while `@agent` chips showed the Agents panel card. The
registry only governed context chips, so nothing stopped surfaces from
rendering their own previews.

The registry's `thread` preview is now the single thread hover: the
sidebar's metadata plus the thread's latest messages, loaded while open.
Sidebar rows, the read-thread tool card (showing what the agent read),
and related-thread rows use it. Every agent hover uses the registry's
Agents panel card, which gains the catalog model name, effort and speed,
and branch or worktree lines from the old tooltip. ContextPreviewHover
takes a placement and a disabled flag so rows can use it, and a new
`t3code/no-unregistered-context-preview` lint rule keeps preview bodies
reachable only through the registry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adampeterhiggins
adampeterhiggins merged commit 9462503 into main Oct 20, 2026
@adampeterhiggins
adampeterhiggins deleted the fix/web-registry-owned-hover-previews branch October 20, 2026 23:24
adampeterhiggins added a commit that referenced this pull request Oct 20, 2026
* test(web): fix agents relationship browser tests

The upstream sync merge (2523410) took upstream's useThreadProjection
mock, dropping the fork's guard that leaves child agent threads unloaded,
so the fork's SubagentActivityLine read a parent projection with no
turnItems. Restore the guard alongside upstream's per-ref projections map,
give the new supervisor test's shell the createdAt every real shell has,
and pick the agent card tooltip rather than the fork's header tooltip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(web): agent preview tests read the card every agent hover now shows

#394 made Lineage rows and workflow members preview agents with the
Agents panel card, so this file's tests now render that card inline. Its
fixtures lacked fields every real record and shell has (a prompt,
createdAt, the shell's provider and model selection), the projection mock
handed workflow members' threads the parent's projection, and several
assertions still read the old tooltip's format.

The fixtures gain those fields, only the viewed thread counts as loaded,
the owner's shell and project resolve from the fixtures, and assertions
follow the card: its status label, account before model, and a clamped
rather than cut long result. A blank reported model now falls back to the
thread's model as a missing one already did, and the card's identity line
reads with spaces around its separators.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant