Skip to content

Conversation

@svkozak
Copy link
Contributor

@svkozak svkozak commented Jan 20, 2026

Summary

Recent update introduced /name command to add session names and this PR adds renaming support to the interactive /resume picker allowing to rename sessions in the list without opening them individually. Also modifies how session 'recency' is derived (if only metadata changed, session's 'modified' date remains the same).

Interactive /resume rename support

  • Ctrl+R opens a full-page rename mode inside the session selector (no overlay).
  • Rename mode shows “Rename Session”, an input, and save/cancel hints.
  • Esc/Ctrl+C cancels rename; Enter saves.

rename-1

rename-2

Get session 'modified' time based on latest activity

  • Session “modified” time is derived from last user/assistant message timestamp (with fallbacks), not file mtime, so renaming (or /name) doesn’t reorder the recent list. (mtime is kept as a fallback)

Refresh/reload behaviour

  • After rename/delete, the session list refreshes so updated names appear immediately.
  • Small refactor of refresh logic into a shared loadScope(...) helper to reduce duplication.

Tests

  • Added/updated tests to cover:
    • rename hint behavior (/resume vs --resume)
    • rename flow (Ctrl+R → rename UI → typing → Enter)
    • “modified timestamp uses last message timestamp” behavior
    • existing delete/path/scope behavior remains covered

Session list now displays last message timestamp as modified time
instead of file mtime. Ctrl+N enters rename mode in the interactive
resume picker, allowing quick session renaming without leaving the
selector. Rename hint is shown only in interactive mode, not in the
CLI --resume picker./
}

// Ctrl+N: rename selected session
if (matchesKey(keyData, "ctrl+n")) {
Copy link
Contributor

@w-winter w-winter Jan 24, 2026

Choose a reason for hiding this comment

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

Looks like we both opened a PR the same day adding a ctrl+n-keybinding action to the /resume session picker. @aos very reasonably requested configurability in mine (which is about toggling a Named-only filter in the picker)

One of our patches should use a different default keybinding though. What about ctrl+r (since this action is about Renaming) or one involving alt ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, that makes sense, I'll update 👍

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.

2 participants