0.5.2 — Sessions tab UX overhaul + universal y clipboard yank#11
Merged
Conversation
Adds YankMixin to every screen with a DataTable (Sessions, Perms, Context, Memory, Hooks, Schedule, Audit, Dream). `y` copies the highlighted cell (fallback: full row joined by tabs) via App.copy_to_clipboard (OSC 52) and shows a preview notification. Also introduces tui/_format.py with format_tokens, format_cost, relative_time, duration, short_id, strip_project_slug, topic_from_session, estimate_tokens_from_size — used by Sessions column reorg in the next commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sessions tab UX overhaul (proof-of-concept for the pattern): - New columns left→right: Topic · Activity · Duration · Msgs · Tokens · Cost · ID · Project. Topic eats available width; Activity is relative (`2h ago`, `yesterday`, `Apr 14`); Duration shows started→last (`4h22m`, `1d3h`); Tokens uses size_bytes/4 estimate (O(1), no full re-read of jsonl); Cost shows $ at Opus input rate ($15/M). - ID truncated to 8 chars + `..`; full UUID lives in the new SessionDetailScreen and is copyable via `y`. - Header is action-oriented: `Sessions — N stored`, key map, plus a hint about the biggest session and a `cc-janitor session prune` tip. - Enter on a row pushes SessionDetailScreen (ModalScreen) with full metadata, all summaries, first/last user messages (truncated past 30 lines), and footer `d`/`r`/`y`/`Esc` actions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
yclipboard yank across all 8 DataTable screens (Sessions, Perms, Context, Memory, Hooks, Schedule, Audit, Dream) via Textual'sApp.copy_to_clipboard(OSC 52). Works around Textual's mouse-capture which blocks the terminal's native select-to-copy.Topic · Activity · Duration · Msgs · Tokens · Cost · ID · Project. Topic eats width; Activity is relative (2h ago); Duration showsstarted→last(4h22m); Tokens uses size_bytes/4 estimate (cheap, no full re-read); Cost shows $ at Opus input rate.SessionDetailScreenmodal with full metadata, summaries, first/last user messages, andd/r/y/Escfooter actions.cc-janitor session prunetip.Test plan
uv run ruff check src tests— cleanuv run pytest -q— 338 passed, 2 skipped (was 319 before; +19 new tests)tests/tui/test_yank.py,tests/tui/test_sessions_columns.py,tests/tui/test_session_detail.pyuv run cc-janitor→ Sessions tab → new columns visibleyon any cell → notification "Copied to clipboard: ..." → paste in another app to verifyEnteron a Sessions row → detail screen opens →EscreturnsNotes
tokens_estimateusessize_bytes // 4rather than a full JSONL re-read — trades ±20% accuracy for O(1) per session vs O(file_size). The CLIsession token-countremains the source of truth for an exact count.🤖 Generated with Claude Code