Show completion timestamps after successful TUI turns (#43558)

## What changed

Replace horizontal turn separators with dim completion metadata after the final answer, including plain conversational answers. Show local completion times such as `done 2:32 PM`, adding the date for other days and the year for other years. Retain `Worked for` durations above sixty seconds and runtime metrics, and wrap metadata on narrow terminals.

Restore saved completion metadata when resuming conversations or loading older history. Keep each footer after its turn's items and deduplicate it across repeated notifications and overlapping pages. Only live completions fall back to the current time when a saved timestamp is unavailable. Failed, interrupted, and in-progress turns do not receive success footers.

Avoid submitting queued input or emitting completion notifications while replaying history.

## Testing

Add unit and snapshot coverage for timestamp formatting, duration thresholds, muted styling, narrow layouts, live and replayed completions, missing metadata, and pagination boundaries with overlapping pages.

GitOrigin-RevId: 308c35c6720720da43c9a391aa5a68c1b231c9a5
This commit is contained in:
Felipe Coury authored and copyberry committed 2026-09-07 19:01:08 +00:00
1 parent 769a6a5bcd
commit 333c41eef6
42 files changed
+1112 -202

No files matched your search

@@ -0,0 +1,26 @@
---
source: tui/src/app/tests/pagination_completion_tests.rs
expression: "snapshots.join(\"\\n\\n--- next overlapping page ---\\n\\n\")"
---
Earlier messages are available — press ctrl + t to view the full transcript
• Middle answer
Worked for 2m 5s · done Sep 6, 2000 at 2:33 PM
--- next overlapping page ---
› Oldest prompt
• Oldest answer
Worked for 2m 5s · done Sep 6, 2000 at 2:32 PM
› Middle prompt
• Middle answer
Worked for 2m 5s · done Sep 6, 2000 at 2:33 PM
@@ -4,4 +4,4 @@ expression: rendered_retry
---
› Handle the safety-buffered request
Keep the accepted steer
⚠ Full-history hydration is deprecated for paginated threads; omit `includeTurns` or set it to `false`, then page with `thread/turns/list` and `thread/items/list`.• done
⚠ Full-history hydration is deprecated for paginated threads; omit `includeTurns` or set it to `false`, then page with `thread/turns/list` and `thread/items/list`.• done done [completion time]