Skip to content

Add session continuation detection and web preview security#179

Draft
jamesrochabrun wants to merge 1 commit intomainfrom
jroch-session-continuation
Draft

Add session continuation detection and web preview security#179
jamesrochabrun wants to merge 1 commit intomainfrom
jroch-session-continuation

Conversation

@jamesrochabrun
Copy link
Copy Markdown
Owner

Summary

  • Session continuation detection: When Claude Code creates a new session (e.g., "clear context and accept plan"), the app automatically detects the new .jsonl file via kqueue directory watching, transfers monitoring/terminal PTY/sidebar selection to the new session, and persists session backup to survive app relaunch.
  • Web preview security: Adds WebPreviewNavigationPolicy (loopback + project-root allowlisting for WKWebView) and DevServerReadinessProbe (polls dev server until reachable before loading preview).

Test plan

  • TransferMonitoringTests — 9 tests covering ID re-keying, terminal view, custom names, pending prompts, resolved continuations, state cleanup, no-op guards, backup-based session creation
  • InsertSessionIntoRepositoryTests — insertion, dedup, no-op (3 tests)
  • SyncMonitoredSessionBackupTests — timing guard, orphan cleanup, data freshness (3 tests)
  • ContinuationViaPublisherTests — end-to-end Combine flow (2 tests)
  • WebPreviewNavigationPolicyTests — allow/deny file URLs, loopback, external redirect (4 tests)
  • DevServerReadinessProbeTests — readiness, timeout, stale (3 tests)
  • Manual: monitor a Claude session, trigger "clear context and accept plan", verify the monitoring card and sidebar selection follow the new session
  • Manual: relaunch the app while monitoring a continuation session, verify it restores correctly
  • Manual: verify web preview only navigates to loopback/project-root URLs

Session continuation: detect when Claude Code creates a new session
(e.g., "clear context and accept plan") and seamlessly transfer
monitoring, terminal PTY, and sidebar selection to the new session.
Persists session backup to survive app relaunch.

Web preview: add WebPreviewNavigationPolicy for loopback/file URL
allowlisting and DevServerReadinessProbe for polling dev server
readiness before loading the preview.
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.

1 participant