Repository navigation
Conversation
A pane switch shows the new terminal at once, while the session registry moves focus only after it reattaches. In that window the composer targeted the registry's focused pane, so it showed the previous pane's draft under the new pane's terminal and would have sent there. The composer now targets the focused pane only while the workspace shows it. Otherwise it has no target: the field is empty and disabled with a "Switching panes…" placeholder until focus catches up. Drafts and sends stay keyed on the same pane. Fixes #538 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
A focused secondary pane remains targetable after portrait layout hides it.
Review effort: Balanced
Findings: 1
What changed in this PR
Prevents the iOS composer from targeting a previously shown pane while focus catches up.
Changes:
- Restricts composer targeting to focused, selected panes.
- Adds a disabled switching state and regression tests.
| File | Description |
|---|---|
PaneComposer.swift |
Adds target validation and switching placeholder. |
PaneComposerTests.swift |
Tests pane-switch targeting and send prevention. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| private var targetPaneID: String? { | ||
| PaneComposerModel.target( | ||
| focusedPaneID: registry.focusedPaneID, | ||
| shownPaneIDs: [store.primaryPaneID, store.secondaryPaneID] |
This branch was successfully deployed
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.

Fixes #538
Cause.
PaneComposertargetedregistry.focusedPaneID. A chip tap updatesstore.primaryPaneID(and the visible terminal) immediately, butTerminalSessionRegistry.show(...)moves focus only after it reattaches. Until then the composer showed, and would send to, a pane no longer on screen.Fix.
PaneComposerModel.target(focusedPaneID:shownPaneIDs:)returns the focused pane only while it is one of the workspace's shown panes (primaryPaneID,secondaryPaneID). Otherwise there is no target: the field is empty and disabled, with a "Switching panes…" placeholder. The draft binding, the send target andcanSendall use that one target, so a draft and its send can never point at different panes. No send path, persistence or registry behaviour changed.Evidence (local Xcode 26.6, iPhone 16 Pro simulator; CI pins 26.2):
xcodebuild test -scheme PsycheApp -only-testing:PsycheAppTests/PaneComposerTests: 17/17 pass, including two new tests:testComposerTargetsTheFocusedPaneOnlyWhileItIsShowntestPaneSwitchWindowHasNoTargetSoThePreviousDraftIsNeitherShownNorSent. During the switch window there is no target, nothing is sent and the previous draft is kept. Aftershow(...)the target is the shown pane.PsycheAppscheme: 117 unit tests pass. UI tests: 48 run, 8 skipped, and one test fails,testPullRequestReviewSupportsEditingAndRelatedFileNavigationatPsycheAppUITests.swift:741. It fails the same way on unmodifiedmain(97db32c) on this host, so it is environmental and unrelated to this change. CI is the authority.testADraftStaysWithItsOwnPane(hardened in test(ios): synchronize the two #510 flakes on explicit state transitions #537) passes.Risk R2 (iOS product behaviour). Rollback: revert this commit.
🤖 Generated with Claude Code