Skip to content

feat: show last message snippet in session list - #3

Merged
alexmt merged 2 commits into
mainfrom
feat/session-list-last-msg-preview
Apr 11, 2026
Merged

feat: show last message snippet in session list#3
alexmt merged 2 commits into
mainfrom
feat/session-list-last-msg-preview

Conversation

@alexmt

@alexmt alexmt commented Apr 11, 2026

Copy link
Copy Markdown
Owner

Closes #4

Summary

  • Each session row in the left pane gains a third line showing the most recent meaningful message text (user or assistant), giving an at-a-glance preview without opening the right pane
  • Skips system-injected strings like [Request interrupted by user for tool use]

Implementation

  • Session.LastMsg — new field populated in readSession() while already scanning the full JSONL; no extra I/O
  • Capture logic covers both "user" and "assistant" entries, keeping the last real text block found
  • renderSessionRow() adds a dim third line; newlines collapsed to keep it single-row, truncated to column width
  • listPageSize() divisor updated 2 → 3 so scroll clamping stays correct with taller rows

Test plan

  • Sessions show a truncated snippet on the third row
  • Most recent message wins — snippet updates as conversation progresses
  • [Request interrupted by user for tool use] entries are skipped; previous real message shown instead
  • Sessions with no text content show a blank third row without crashing
  • Scrolling through a long list keeps the selected session fully visible

🤖 Generated with Claude Code

alexmt and others added 2 commits April 11, 2026 12:21
Each session row now has a third line displaying the most recent
human message text, giving a quick preview of where the conversation
was left off without opening the right pane.

- Session.LastMsg captured in readSession() while already scanning JSONL
- renderSessionRow() adds a dim third line with the truncated snippet
- listPageSize() updated to divisor 3 for correct scroll clamping

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…text

- Expand capture from user-only to both user and assistant entries so the
  snippet reflects the most recent actual exchange
- Skip text blocks starting with "[Request interrupted" which are injected
  system strings, not real conversation content

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alexmt
alexmt merged commit 2ea599e into main Apr 11, 2026
1 check passed
@alexmt
alexmt deleted the feat/session-list-last-msg-preview branch April 11, 2026 19:28
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.

Feature: show most recent message snippet in session list

1 participant