Skip to content

feat(agents): fit session turn timeline to the transcript width - #355

Merged
cihanalagoz merged 1 commit into
mainfrom
ft/agent-session-fit-timeline
Sep 29, 2026
Merged

cihanalagoz merged 1 commit into
mainfrom
ft/agent-session-fit-timeline

Conversation

@Bor4brn

@Bor4brn Bor4brn commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Summary

The blue turn timeline above the Agent Session transcript used to get wider with every new agent response. It now always fits the transcript panel's width.

  • Fits the panel: a new turn resizes all segments together instead of making the timeline wider, and there is no horizontal scrolling. Segment widths stay proportional to turn duration. Very short turns get a small minimum width so they stay visible, and the gaps between segments shrink as the number of turns grows.
  • Labels inside segments: a segment shows 45.7s · 2 tool calls when it has room. A narrower one shows only the duration, and one too narrow for that shows no text. The label is chosen by measuring the text in the page font, so text is never cut off mid-word.
  • Hover details: the tooltip always shows the turn number, duration and tool call count, including 0 tool calls, and adds Failed for failed turns.
  • Unchanged: clicking a segment still jumps to that turn, and failed turns are still red.
  • Zoom: because the width is now fixed to the panel, the zoom buttons change the timeline's height and text size instead of its width. The smallest step is a thin bar with no labels.

Changes

  • TurnTimeline.tsx (new): the timeline component, split out of AgentSessionView.tsx.
  • turnTimelineLayout.ts (new): pure helpers for segment widths, label choice and tooltip text.
  • AgentSessionView.tsx / .module.css: use the new component and replace the old scrolling timeline styles.
  • agent-session-turn-timeline.test.ts (new): unit tests.

Testing

  • vitest: 11 tests cover proportional widths, staying within the width as up to 500 turns are added one by one, more turns than pixels, turns with no duration, and the label and tooltip rules.
  • eslint and tsc --noEmit pass.
  • Checked in a headless browser with a temporary test page (not committed) that rendered the timeline at 900px and 360px wide:
    • The timeline stayed inside the panel with 6, 16 and 216 turns.
    • Labels were correct for wide and narrow segments, and for turns with 0, 1, 2 and 5 tool calls.
    • Clicking a segment jumped to the right turn, failed turns were red, and all zoom steps worked.
  • Not checked on the real Agent Session page: the in-app browser panel stopped responding.

Notes

In very long sessions the gaps between segments disappear, so the timeline reads as one solid band. Each segment still has its own hover details.

The turn strip above the session transcript now always fits the panel:
new turns re-divide the same width instead of extending it, segment
widths stay proportional to turn duration (with a small floor so short
turns stay visible), and there is no horizontal scrolling.

Segments show "duration · N tool calls" when there is room, fall back to
the duration alone, then to no text. The tooltip always shows the turn
number, duration and tool call count (including 0), plus "Failed" for
failed turns. Click-to-jump and failed-turn colors are kept; zoom now
changes strip height and label size.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@Bor4brn
Bor4brn requested a review from a team September 29, 2026 13:45
@cihanalagoz
cihanalagoz merged commit e911a09 into main Sep 29, 2026
5 checks passed
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