# Thread Agent Activity Panel Optimization Spec

## Background

The thread-level agent activity panel is constrained by the reply-thread side/top layer size. The current live activity feed wastes horizontal and vertical space through a full-height left timeline line, extra nesting padding, a wide time column, and inconsistent expand controls. The goal is not maximum density; the panel should feel polished, readable, and structured while avoiding unnecessary whitespace.

## Goals

- Remove visual elements that do not carry useful meaning in the narrow thread panel.
- Keep the existing agent tabs and panel header unchanged so tab hit targets and layout stability remain comfortable.
- Preserve the detailed activity feed semantics while making the thread panel more space-efficient.
- Make expand/collapse behavior consistent across JSON, tool output, prompt input, and long text items.
- Improve structured content readability with JSON formatter-like hierarchy and monospace rendering.
- Scope the visual density changes to the thread agent activity panel; do not unintentionally restyle the full-page Agent activity view.

## Non-goals

- Do not redesign the agent activity data model or trajectory log schema.
- Do not replace the existing JSON tree implementation with a third-party formatter.
- Do not hide timestamps or activity type labels.
- Do not compress the agent tab/header area.
- Do not make the feed an ultra-compact terminal log.

## Design

### Feed container

The thread panel live feed should remove the outer `border-l` timeline rail and its extra left padding. The scroll container should use moderate padding, such as `px-3 py-2`, so more horizontal room is available for the time, label, and preview content.

### Row layout

Thread activity rows should use a scoped dense/detailed row layout:

- Narrower time column than the default Agent page activity feed.
- Smaller horizontal gap between timestamp and content.
- Slightly reduced row padding and content leading.
- A subtle rounded hover background for row affordance.
- The existing status/type dot remains in the first row as the lightweight activity marker.

The standalone Agent activity page can continue to use the current detailed spacing.

### Expand controls

All item-level expand/collapse controls should live in the first row next to the activity label. The second row should be content-only:

- JSON root expand/collapse remains first-row controlled.
- Long text output and tool output should no longer render a chevron before the second-line content preview.
- Prompt input long-text expansion should also be controlled from the first row.
- If an item can be expanded for both JSON root and long-text preview, the control should be unified so the row does not expose two competing expand affordances.

### Structured content and tree lines

Expanded structured content should borrow from JSON formatter tools:

- JSON and raw tool/prompt content should use a monospace font.
- JSON children should be visually nested with local indentation lines or subtle left borders inside the expanded content area.
- Tree lines should be local to structured content; the main feed should not regain a full-height left timeline rail.
- Natural-language reasoning summaries may remain in the normal UI font for readability.

## Acceptance criteria

- The thread agent activity feed no longer renders a full-height left border/timeline rail around `AgentTrajectoryFeed`.
- Agent tabs and the activity panel header keep their current dimensions and spacing.
- Thread panel detailed rows use a scoped compact row layout without changing the default Agent page detailed feed.
- Long output/tool/prompt rows expose their expand control in the first row, not before second-line content.
- Expanded JSON/tool/prompt content uses monospace styling.
- JSON tree content shows local hierarchy lines/indentation.
- Tests cover the scoped thread variant and guard against reintroducing the outer left timeline rail.
