Skip to content

Move the preview workspace session and its cleanup into NativePreviewSession - #506

Merged
lynnswap merged 1 commit into
mainfrom
claude/native-preview-session
Nov 20, 2026
Merged

lynnswap merged 1 commit into
mainfrom
claude/native-preview-session

Conversation

@lynnswap

Copy link
Copy Markdown
Owner

Summary

Moves the per-workspace preview state and the operations that clean it up into a new NativePreviewSession class. Behavior does not change. This is the third of four PRs for #489.

Details

  • NativePreviewSession replaces the tool's private WorkspaceSession. It holds the session's staged renderers, retained plan, build certificate, metadata cache, temporary Simulator device, and installed apps.
  • The session also owns the operations that change that state: stop(_:process:), close(installation:), update(build:…), and prepareSimulator. resetStages and createSimulator are private to the session.
  • NativePreviewTool still owns the sessions dictionary, the per-workspace render queue, and the reuse decision. Every session change still happens inside renderQueue.withAccess(to:), so the reuse and cleanup guarantees in Docs/maintainer-architecture.md are unchanged.

Review focus

  • Whether any session change now happens outside the render queue access, or whether the cleanup order or error reporting changed.

Testing

  • swift build --build-tests
  • M6 mini, xcode-runner test --scheme XcodeMCPNativeRuntimeTests: 344 tests in 37 suites passed

Related

🤖 Generated with Claude Code

…Session

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lynnswap
lynnswap merged commit e648ef1 into main Nov 20, 2026
@lynnswap
lynnswap deleted the claude/native-preview-session branch November 20, 2026 06:05
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T06:06:13.876835Z f9c730c PR opened
🔒 Security Review ✅ Completed 2026-11-20T06:09:16.146180Z f9c730c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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