Skip to content

feat: add a timeline_event transcript card - #3814

Merged
ThomasK33 merged 1 commit into
mainfrom
feat/timeline-event-tool-card
Aug 6, 2026
Merged

feat: add a timeline_event transcript card#3814
ThomasK33 merged 1 commit into
mainfrom
feat/timeline-event-tool-card

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Summary

Adds a dedicated transcript card for the timeline_event tool, which currently falls back to the generic renderer. Collapsed, the agent's one-sentence note is the summary, tagged with an ask-mode category chip. Expanded, the card previews the row exactly as it lands in the Timeline tab (ask-mode ink, Sparkles ring, category badge) under its day header, and explains where to find it.

Background

The durable workspace timeline landed in #3755/#3756 with the timeline_event tool, but calls render as generic JSON dumps in the transcript. The card design comes from the Mux Design System mockup (Timeline Event Tool Call.html), bound here to the real backend shapes rather than the mockup's idealized ones.

Implementation

  • TimelineEventToolResultSchema (+ derived TimelineEventToolArgs/TimelineEventToolResult types) — the real result is { success: true, recorded: boolean }, where recorded: false means TimelineService throttled the note (duplicate or rate-limited) and nothing was written. The card surfaces that as an amber "Not recorded" chip plus an explanation instead of a preview that would overstate what happened.
  • The feed-row preview is a static replica of TimelineEventRow's agent-authored variant. To keep it provably in sync with the tab, the row icon comes from the shared getTimelinePresentation("agent.event"), and the day/time formatters (getTimelineDayLabel, formatTimelineTime) are extracted from TimelinePanel.tsx into timelinePresentation.ts and used by both. The preview's day header and time cell derive from toolCallTimestamp and are omitted when unavailable — nothing is fabricated.
  • Result handling follows the current card conventions: unwrapResult for the SDK JSON container, safeParse for self-healing on malformed persisted results, and both persisted error shapes ({ success: false, error } and the nested bare { error }).
  • Registered in getToolComponent.ts; header icon (Sparkles, matching the feed's agent.event rows) in TOOL_NAME_TO_ICON.

Validation

  • New happy-dom suite covers the behavioral branches: recorded/throttled gating, badge derivation (picked_up → "picked up", missing category → "Agent"), both error shapes, JSON-container unwrap, and timestamp gating.
  • Stories mirror the design gallery (all five categories, fallback, throttled, executing, error) plus a 375px pinned-width play test asserting no horizontal overflow. Snapshots are pixel: PIXEL_DISABLED since the repo-wide budget is at its ceiling.
  • Full bun test src matches the clean-main baseline exactly (the same 30 pre-existing env-dependent failures, none in touched areas); TimelinePanel's 16 jest tests and a static Storybook build pass.

Risks

Low. The card and registry entry are new code paths gated to timeline_event. The only shared-code change is moving the day/time formatters out of TimelinePanel.tsx (behavior-preserving, covered by the existing timeline jest suite).

Dedicated tool-call card for timeline_event (previously rendered by the
generic fallback): ask-mode category chip in the header, a preview of the
feed row as it lands in the Timeline tab, and an explicit throttled state
for recorded:false results.

Change-Id: I119a8d893a47534b59f25a548e8524eb8873840d
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 974f03b6f7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ThomasK33
ThomasK33 added this pull request to the merge queue Aug 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 6, 2026
@ThomasK33
ThomasK33 added this pull request to the merge queue Aug 6, 2026
@ThomasK33
ThomasK33 removed this pull request from the merge queue due to a manual request Aug 6, 2026
@ThomasK33
ThomasK33 added this pull request to the merge queue Aug 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Aug 6, 2026
@ThomasK33
ThomasK33 added this pull request to the merge queue Aug 6, 2026
Merged via the queue into main with commit 9c19807 Aug 6, 2026
48 of 57 checks passed
@ThomasK33
ThomasK33 deleted the feat/timeline-event-tool-card branch August 6, 2026 23:32
@mux-bot mux-bot Bot mentioned this pull request Aug 7, 2026
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