Skip to content

Sync shared session after window document open#1091

Merged
SoundBlaster merged 3 commits intomainfrom
codex/follow-instructions-in-start.md
Mar 12, 2026
Merged

Sync shared session after window document open#1091
SoundBlaster merged 3 commits intomainfrom
codex/follow-instructions-in-start.md

Conversation

@SoundBlaster
Copy link
Owner

@SoundBlaster SoundBlaster commented Mar 12, 2026

Summary

  • sync the shared app session when a document is opened in a window
  • mirror the window parse tree, file URL, annotations, and selection into the app-level controller
  • add a regression test covering command-menu export and shared session persistence

Testing

  • swift test --disable-sandbox --filter DocumentSessionControllerTests
  • swift test --disable-sandbox --filter WindowSessionControllerTests

Notes

  • addresses the review feedback about registerRecent(recent) leaving the shared session unloaded

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 404c197451

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// Register with app controller's recent documents
appSessionController.openRecent(recent)
// Register with app controller's recent documents (without re-opening)
appSessionController.registerRecent(recent)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update shared session when registering an opened document

Calling appSessionController.registerRecent(recent) here updates only the recents list and skips the DocumentOpeningCoordinator path that sets DocumentSessionController.currentDocument and parse/export state. After opening a file in a window, the shared app controller can remain unloaded, so app-level flows that still rely on that shared controller (like command-menu export and workspace-scoped settings) act as if no document is open or export an empty tree.

Useful? React with 👍 / 👎.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 9aeca6f. The shared app session now mirrors the opened window session state instead of only updating recents, so command-menu export and workspace-scoped settings stay in sync without re-opening the document.

@SoundBlaster SoundBlaster changed the title Codex/follow instructions in start.md Sync shared session after window document open Mar 12, 2026
@SoundBlaster SoundBlaster force-pushed the codex/follow-instructions-in-start.md branch from 404c197 to 9aeca6f Compare March 12, 2026 21:26
@github-actions
Copy link

🔍 SwiftLint Code Quality Report

No violations found! Code quality check passed.

@github-actions
Copy link

📊 Coverage Gate Results

SUMMARY
================================================================================

Total Source LOC: 5,578
Total Test LOC:   4,962
Overall Test/Code Ratio: 89.0%

Layer                  Source LOC     Test LOC      Ratio
------------------------------------------------------------
Layer 0                        96          142     147.9%
Layer 1                       779          617      79.2%
Layer 2                     1,048          794      75.8%
Layer 3                     2,175        1,448      66.6%
Layer 4                       834        1,442     172.9%
Utilities                     646          519      80.3%

Threshold: 67%
Coverage: 89.0%
Status: ✅ PASS

@github-actions
Copy link

🔍 SwiftLint Code Quality Report

No violations found! Code quality check passed.

@github-actions
Copy link

📊 Coverage Gate Results

Threshold: 67%
Coverage:
Status: ❌ FAIL

@github-actions
Copy link

🔍 SwiftLint Code Quality Report

No violations found! Code quality check passed.

@github-actions
Copy link

📊 Coverage Gate Results

SUMMARY
================================================================================

Total Source LOC: 5,578
Total Test LOC:   4,962
Overall Test/Code Ratio: 89.0%

Layer                  Source LOC     Test LOC      Ratio
------------------------------------------------------------
Layer 0                        96          142     147.9%
Layer 1                       779          617      79.2%
Layer 2                     1,048          794      75.8%
Layer 3                     2,175        1,448      66.6%
Layer 4                       834        1,442     172.9%
Utilities                     646          519      80.3%

Threshold: 67%
Coverage: 89.0%
Status: ✅ PASS

@SoundBlaster SoundBlaster merged commit b9f8d84 into main Mar 12, 2026
17 checks passed
@SoundBlaster SoundBlaster deleted the codex/follow-instructions-in-start.md branch March 12, 2026 21:38
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