Skip to content

fix: render showSpeed and showDuration in expanded layout#232

Open
hoklims wants to merge 2 commits intojarrodwatts:mainfrom
hoklims:fix/expanded-layout-speed-duration
Open

fix: render showSpeed and showDuration in expanded layout#232
hoklims wants to merge 2 commits intojarrodwatts:mainfrom
hoklims:fix/expanded-layout-speed-duration

Conversation

@hoklims
Copy link

@hoklims hoklims commented Mar 18, 2026

Summary

  • Fixes showSpeed and showDuration config options having no effect in expanded layout mode
  • Adds both options to renderProjectLine (the expanded layout's project line), matching the existing compact layout behavior in renderSessionLine

Root Cause

showSpeed and showDuration were only implemented in src/render/session-line.ts (compact layout). The expanded layout renderers under src/render/lines/ had no corresponding logic, so these config options were silently ignored.

Changes

src/render/lines/project.ts:

  • Import getOutputSpeed from speed-tracker.ts
  • Add showSpeed rendering (output token speed in tok/s) after session name
  • Add showDuration rendering (session timer) after speed, matching compact layout defaults

Test plan

  • npx tsc — compiles without errors
  • node --test tests/render.test.js — all 73 render tests pass (no regressions)
  • Verified speed/duration appear in expanded layout with showSpeed: true / showDuration: true

Closes #221

🤖 Generated with Claude Code

These config options were only implemented in the compact layout
(renderSessionLine in session-line.ts). When using lineLayout: "expanded",
enabling display.showSpeed or display.showDuration had no effect.

This adds both options to renderProjectLine (the expanded layout's
project line), matching the compact layout behavior:
- showSpeed: output token speed (tok/s)
- showDuration: session duration timer

Fixes jarrodwatts#221

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hoklims hoklims requested a review from jarrodwatts as a code owner March 18, 2026 08:36
Copilot AI review requested due to automatic review settings March 18, 2026 08:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes display.showSpeed and display.showDuration being ignored in expanded layout by adding the same rendering logic used in the compact renderSessionLine() to the expanded layout’s renderProjectLine().

Changes:

  • Import getOutputSpeed() into the expanded project-line renderer.
  • Render output speed (out: … tok/s) when display.showSpeed is enabled.
  • Render session duration (⏱️ …) when display.showDuration is enabled (default-on unless explicitly false).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Address Copilot review feedback by adding test coverage for the
new expanded layout rendering of speed and duration:
- duration shown when showDuration is true
- duration omitted when showDuration is false
- speed code path doesn't crash when showSpeed is true
- speed omitted when showSpeed is false

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

showSpeed and showDuration not rendered in expanded layout

2 participants