v0.6.1: show project + session id in the UI header#5
Merged
Conversation
The page never said which run you were looking at — with two live UIs or a folder of snapshots, telling them apart meant reading URLs out of pair rows. The header now carries the run identity: - project name = the directory cctrace ran in (basename; full path on hover), injected as PageMeta by the live server and the exit-snapshot writer. `cctrace view` rebuilds pass no meta — the original cwd is not recorded in the trace. - current Claude session id, extracted client-side from the pairs (newest live pair wins over prior-run merges), short form with the full id on hover and click-to-copy. - tab title becomes `<project> · cctrace` so multiple live UIs are tellable apart in the tab bar. extractSessionId joins the summarize.ts inline set, so snapshots get the same header without drift; META goes through jsonForScript (a hostile cwd can't close the script tag — regression-tested). Co-Authored-By: Claude Fable 5 <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.
What
The page never said which run you were looking at — with two live UIs open or a folder of snapshots, telling them apart meant reading URLs out of pair rows. The header now carries the run identity:
PageMetaby the live server and the exit-snapshot writer;cctrace viewrebuilds pass no meta (the original cwd is not recorded in the trace) and degrade to session-only.<project> · cctraceso multiple live UIs are tellable apart in the tab bar.How
extractSessionIdjoins thesummarize.tsinline set (sametoString()pattern as the rest — unit-tested once, identical live and in snapshots).METAgoes throughjsonForScript, so a hostile cwd (</script>in a path) cannot break out of the script tag — regression-tested.getLiveHtml(port, meta)/renderSnapshot(pairs, meta)— both optional,{}keeps old behavior.Tests
{}default, script-tag escape, inline presence): 146/146 pass.extractSessionIdinlining survivesbun build --compile; a stubbed-DOM run of the emitted page script renderscctrace · 365ad98dwith the live pair winning over prior-run pairs.🤖 Generated with Claude Code