Skip to content

feat: show copyable session ID in session detail header - #28

Merged
wesm merged 4 commits into
kenn-io:mainfrom
shreyaskarnik:feat/session-id-display
Feb 25, 2026
Merged

feat: show copyable session ID in session detail header#28
wesm merged 4 commits into
kenn-io:mainfrom
shreyaskarnik:feat/session-id-display

Conversation

@shreyaskarnik

@shreyaskarnik shreyaskarnik commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a clickable session ID to the session detail breadcrumb bar
  • Shows first 8 characters of the session ID in a monospace styled element
  • Hovering shows the full session ID as a tooltip
  • Clicking copies the full session ID to clipboard with "Copied!" feedback (1.5s)
  • Extracted a reusable copyToClipboard utility with tests

This lets users easily grab session IDs for claude --resume <id>.

Demo

Screen.Recording.2026-02-24.at.3.05.41.PM.mov

Tests Ran

  • copyToClipboard utility tested (success + failure paths)
  • All 383 frontend tests passing
  • Go tests passing (no backend changes)
  • Manual: navigate to session, verify truncated ID visible
  • Manual: hover shows full ID tooltip
  • Manual: click copies full ID, shows "Copied!" for 1.5s

🤖 Generated with Claude Code

@roborev-ci

roborev-ci Bot commented Feb 24, 2026

Copy link
Copy Markdown

roborev: Combined Review (e49851c)

Summary Verdict: All agents agree the code is clean; no medium, high, or critical issues were found.


Synthesized from 4 reviews (agents: codex, gemini | types: default, security)

@shreyaskarnik

shreyaskarnik commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

@wesm awesome project, after couple of uses figured that the project can show session id for fast resume functionality

@shreyaskarnik

Copy link
Copy Markdown
Contributor Author

Note: just noticed #14 has overlap here - it adds a keyboard shortcut (c) and header button to copy a full CLI continue command for the active session. Our PR focuses on making the session ID visible in the breadcrumb bar with click-to-copy.

If #14 covers the use case sufficiently (copying a ready-to-use CLI command), happy to close this in favor of that. Let us know @wesm!

@wesm wesm mentioned this pull request Feb 24, 2026
6 tasks
shreyaskarnik and others added 4 commits February 24, 2026 18:10
Extract clipboard write pattern into a reusable async utility that
returns true on success and false on failure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Strip agent prefix (codex:, copilot:, etc.) before display/copy
  so the button shows the UUID, not "codex:ab"
- Track copied state by session ID to prevent stale "Copied!" on
  session switch or rapid clicks
- Scope to Claude and Codex for now
- Use vi.stubGlobal instead of Object.assign(navigator) in test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prevents a stale timer from clearing a newer copy action when
sessions are copied in quick succession.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wesm
wesm force-pushed the feat/session-id-display branch from e49851c to ce53634 Compare February 25, 2026 00:10
@roborev-ci

roborev-ci Bot commented Feb 25, 2026

Copy link
Copy Markdown

roborev: Combined Review (ce53634)

The PR introduces a severe Svelte syntax error that will break the
build, alongside a medium-severity UI state bug with the copy timeout.

High

  • Svelte syntax error
    • File: frontend/src/App.svelte (Line 203)
    • Problem: The space in { @const ...} causes Svelte to parse
      the block as an invalid JavaScript expression instead of the special {@const tag, which will break the Vite build.
    • Fix: Remove the space: {@const rawId = sessionDisplayId(session.id)}.

Medium

  • Copied state can clear too early on repeated
    clicks of the same session
    • File: frontend/src/App.svelte (Line 209)
    • Problem: Each successful click creates a new setTimeout, but timers are keyed only by session.id. If the same session is clicked again before the first
      timer fires, the older timer still matches and clears "Copied!" earlier than intended.
    • Fix: Track and clear a per-component timeout handle before starting a new one, or use a monotonic token/counter per click and only clear for the latest token.

Synthesized from 4 reviews (agents: codex, gemini | types: default, security)

@wesm

wesm commented Feb 25, 2026

Copy link
Copy Markdown
Member

review not valid. merging

@wesm
wesm merged commit 19107e7 into kenn-io:main Feb 25, 2026
6 checks passed
@shreyaskarnik
shreyaskarnik deleted the feat/session-id-display branch February 25, 2026 00:22
cursor Bot referenced this pull request in diazMelgarejo/periscope Jun 1, 2026
## Summary 

- Adds a clickable session ID to the session detail breadcrumb bar
- Shows first 8 characters of the session ID in a monospace styled
element
- Hovering shows the full session ID as a tooltip
- Clicking copies the full session ID to clipboard with "Copied!"
feedback (1.5s)
- Extracted a reusable `copyToClipboard` utility with tests

This lets users easily grab session IDs for `claude --resume <id>`.

## Demo


https://github.com/user-attachments/assets/b7ef65c8-d80a-40c7-8a90-13d5e049c494

## Tests Ran

- [x] `copyToClipboard` utility tested (success + failure paths)
- [x] All 383 frontend tests passing
- [x] Go tests passing (no backend changes)
- [x] Manual: navigate to session, verify truncated ID visible
- [x] Manual: hover shows full ID tooltip
- [x] Manual: click copies full ID, shows "Copied!" for 1.5s

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Wes McKinney <wesmckinn+git@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants