Skip to content

[CODE-1832] Show the last response's duration and credits in the TUI indicator slot#13501

Open
ianhodge wants to merge 1 commit into
masterfrom
ian/code-1832-tui-credits-next-to-the-loading-indicator
Open

[CODE-1832] Show the last response's duration and credits in the TUI indicator slot#13501
ianhodge wants to merge 1 commit into
masterfrom
ian/code-1832-tui-credits-next-to-the-loading-indicator

Conversation

@ianhodge

@ianhodge ianhodge commented Jul 8, 2026

Copy link
Copy Markdown
Member

Description

Stacked on #13492. Shows the last response's duration and credits in the TUI's indicator slot (CODE-1832, parent CODE-1828; Figma).

What

  • While a response streams, the ⋮ Warping (Ns) row (TUI warping indicator #13442) is unchanged — the mocks keep usage hidden during streaming (the usage element in frame 323:17216 is opacity: 0).
  • Once the response completes, the same slot rests on a static summary row: ∷ 5s • 0.5 credits — resting spinner glyph, wall-to-wall duration, and the credits the response spent (the mock's ∷ 1s • … completed state, with credits instead of tokens per the CODE-1831 direction).
  • The credits segment is omitted until any are reported; brand-new conversations show nothing.

How

  • render_response_summary joins the indicator family in warping_indicator.rs; muted styling per the mock, credits via the GUI's format_credits.
  • Wired in TuiTerminalSessionView::render from existing block-level accessors — wall_to_wall_response_time_since_last_query() and credits_spent_for_last_block() (the GUI footer's "Credits spent (last response)"). No app-side changes.
  • Repaints reuse the CODE-1831 ConversationUsageMetadataUpdated subscription plus the status-change repaint that already removes the Warping row.
  • Historical per-block rows in the transcript would need per-block stamping app-side; deferred (noted in specs/CODE-1828/TECH.md).

Linked Issue

Internal Linear-driven work — CODE-1832; no GitHub issue.

  • The linked issue is labeled ready-to-spec or ready-to-implement. (N/A — Linear-tracked internal task)
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

  • Unit tests in warping_indicator_tests.rs: the summary row renders ∷ 5s • 2.5 credits with no repaint scheduling; the credits segment is omitted for None/zero. cargo nextest run -p warp_tui (97/97), clippy -D warnings, ./script/format all clean.

  • E2E verified on a live PTY run against staging (two full prompt/response cycles). Rendered-screen captures confirmed:

    • Streaming: ⋮ Warping (0s) with no credits segment, for both prompts.
    • Completion: the slot rests on ∷ 1s • 2.4 credits after the first response and ∷ 1s • 1 credit after the second (singular form correct).
    • Footer (CODE-1831 regression): auto (genius) ~/warp • 2.4 credits click-toggles to • $0.04 and back; footer stays hidden until usage is first reported.
    • Cycling: the second prompt swaps the summary row back to the Warping row, then a fresh summary; footer cumulative updates 2.4 → 3.4 credits (last-response 1 credit + prior 2.4).
  • I have manually tested my changes locally with ./script/run-tui

Screenshots / Videos

Live PTY verification screen captures (streaming, completed summary rows for both responses, and the footer credits/$ toggle both directions) recorded from the run described in Testing above.

⋮ Warping (0s)                                     ← streaming (no credits)
∷ 1s • 2.4 credits                                 ← completed, response 1
∷ 1s • 1 credit                                    ← completed, response 2
auto (genius) ~/warp • 2.4 credits  ⇄  • $0.04     ← footer toggle

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Warp conversation

Co-Authored-By: Oz oz-agent@warp.dev

@cla-bot cla-bot Bot added the cla-signed label Jul 8, 2026
@oz-for-oss

oz-for-oss Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@ianhodge

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR adds a completed-response summary row to the TUI indicator slot, showing the resting spinner, wall-to-wall duration, and optional credits for the last response. I did not find actionable correctness, security, or spec-drift issues in the annotated diff.

Concerns

  • This is a user-facing TUI change, but the attached PR description does not include actual screenshots or a screen recording. It only says E2E verification with recording is queued. For this user-facing change, please include screenshots or a screen recording demonstrating it working end to end.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@ianhodge ianhodge force-pushed the ian/code-1831-tui-footer-token-usage-entry-with-click-to-toggle-cost branch from cfc644c to 781b64e Compare July 9, 2026 14:53
@ianhodge ianhodge force-pushed the ian/code-1832-tui-credits-next-to-the-loading-indicator branch from 0e26397 to 138b9bb Compare July 9, 2026 14:53
@ianhodge ianhodge requested a review from kevinyang372 July 9, 2026 15:15
@ianhodge ianhodge force-pushed the ian/code-1832-tui-credits-next-to-the-loading-indicator branch from 138b9bb to f014143 Compare July 9, 2026 16:58
@ianhodge ianhodge force-pushed the ian/code-1831-tui-footer-token-usage-entry-with-click-to-toggle-cost branch from 781b64e to 827a488 Compare July 9, 2026 16:58
}

#[test]
fn response_summary_shows_duration_and_credits_without_repaints() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very much a nit -- but I don't think these two unit tests are that useful

@ianhodge ianhodge force-pushed the ian/code-1831-tui-footer-token-usage-entry-with-click-to-toggle-cost branch from 827a488 to 422b34e Compare July 9, 2026 19:29
@ianhodge ianhodge force-pushed the ian/code-1832-tui-credits-next-to-the-loading-indicator branch from f014143 to 22b00b9 Compare July 9, 2026 19:29
@ianhodge ianhodge force-pushed the ian/code-1831-tui-footer-token-usage-entry-with-click-to-toggle-cost branch from 422b34e to 0ad5c17 Compare July 9, 2026 20:37
@ianhodge ianhodge force-pushed the ian/code-1832-tui-credits-next-to-the-loading-indicator branch from 22b00b9 to 4761080 Compare July 9, 2026 20:37
@ianhodge ianhodge force-pushed the ian/code-1831-tui-footer-token-usage-entry-with-click-to-toggle-cost branch from 0ad5c17 to e0a047f Compare July 9, 2026 21:59
@ianhodge ianhodge force-pushed the ian/code-1832-tui-credits-next-to-the-loading-indicator branch from 4761080 to 50b8746 Compare July 9, 2026 21:59
@ianhodge ianhodge force-pushed the ian/code-1831-tui-footer-token-usage-entry-with-click-to-toggle-cost branch from e0a047f to 925e16f Compare July 9, 2026 22:48
@ianhodge ianhodge force-pushed the ian/code-1832-tui-credits-next-to-the-loading-indicator branch 2 times, most recently from cfd9d4a to 1d27a5d Compare July 9, 2026 22:53
@ianhodge ianhodge force-pushed the ian/code-1831-tui-footer-token-usage-entry-with-click-to-toggle-cost branch 2 times, most recently from 78b1e78 to 6d727fd Compare July 9, 2026 22:57
@ianhodge ianhodge force-pushed the ian/code-1832-tui-credits-next-to-the-loading-indicator branch from 1d27a5d to d39b7a1 Compare July 9, 2026 22:57
Base automatically changed from ian/code-1831-tui-footer-token-usage-entry-with-click-to-toggle-cost to master July 10, 2026 00:18
…ot (CODE-1832)

Per the Figma mocks, usage stays hidden while streaming (the Warping row
is unchanged); once the response completes, the indicator's slot rests
on a static summary row: the resting glyph, the wall-to-wall duration,
and the credits the response spent — the GUI footer's "Credits spent
(last response)" number formatted with format_credits. Consumes the
existing block-level conversation accessors; no app-side changes.

Co-Authored-By: Oz <oz-agent@warp.dev>
@ianhodge ianhodge force-pushed the ian/code-1832-tui-credits-next-to-the-loading-indicator branch from d39b7a1 to 3194a54 Compare July 10, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants