feat(): session and event identification#52
Merged
StuBehan merged 1 commit intoMay 20, 2026
Conversation
hiskudin
approved these changes
May 20, 2026
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
Sessions become first-class identities: renames persist, propagate into the Events tab live, and every row carries a stable color accent so the eye can link a nudge to its session.
Changes
panel/SessionPersistence.swift. Disk-backed store at~/.stack-nudge/sessions.json, keyed by(canonical-agent, projectPath). Atomic write, decode-failure-safe.Agent.canonical(_:)bridges wire names (claude-code,cursor→claude) so events and sessions agree on identity.customNamefrom persistence on every newly-discovered session (survives pid churn + restart). Writes on rename. BumpslastSeenAtonce per launch per named session, not per poll.@EnvironmentObject SessionPersistenceinjected at the panel root. The "· project" pill now showscustomNamewhen set, else project basename. Render-time lookup, so a rename in the Sessions tab updates matching event rows instantly.active · 14:23/ended 5m ago); terminalApp · tilde-abbreviated cwd. Selected cards expand withN nudges · last X agofor active events matching the session.SessionColordeterministic FNV-1a over the canonicalized join key → palette of 6 muted colors. Applied as a 3pt left-edge accent on bothSessionRowandEventRow. Active 0.85 opacity, finished 0.45.SessionPersistenceTests,AgentTests,SessionColorTests. Cover roundtrip, removal semantics, decode-failure recovery, canonicalization on read/write, determinism, palette membership.SessionPersistence.swiftto the explicit source list (SPM auto-discovers; build.sh doesn't).Testing
swift buildand./build.shclean.make reload, fired varied trial events: same-project events share a color, different projects get different colors, gemini gets its own, long titles still truncate, no-projectPath events render without a session chip.test-macosjob runs them; not run locally (CLI tools only, no Xcode).