Repository navigation
fix(navigation): keep this device's own split its pick when following herdr's focus - #1887
Conversation
… herdr's focus With Follow herdr's focus on, herdr's pane-focused frame for a split this device opened could arrive before the split's answer and open the new pane as an automatic pick: no keyboard, no Back entry, and the answer then found the selection moved. While this device's own focus-moving request is out (movingHerdrFocus), that PC's frames are left to the request's caller. The setting's description says a PC on Ovis older than 0.4.13 does not report herdr's focus. Fixes #1470
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
| Layer / File(s) | Summary |
|---|---|
Track and suppress own focus moves src/lib/followFocus.ts, src/lib/api.ts, src/lib/useMachineRoster.ts, src/lib/followFocus.test.ts |
Focused split requests are tracked per machine until they resolve or reject. Pane-focus events pass the pending-move state to the focus-follow decision, and tests cover own moves and overlapping requests. |
Verify split behavior and document compatibility scripts/follow-focus-regression.ts, DESIGN.md, changelog.d/follow-focus-own-split.md, src/components/SettingsDialog.tsx, src/lib/i18n/settings.*.ts |
The regression script checks selection, keyboard focus, and Back behavior when a focus frame arrives before the split response. Documentation and setting descriptions note that Ovis versions before 0.4.13 do not report focus. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Low
Possibly related PRs
- devswha/ovis#1803: Adds the
busyinput to the same focus-follow decision function and call site.
Merge Risk: 
Minimal · up to 34659
-
The split behavior and compatibility notes are ready for normal merge checks; no demonstrated issue requires a pre-merge fix.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description explains the problem, resulting behavior, implementation, issue references, and extensive validation results. It uses "How it was verified" instead of the template's "Validation" heading, but the required validation information is present.
Full details: Linked Issues check
-
Explanation
#1470coding requirements are met.splitPanewraps focused split requests withmovingHerdrFocus.useRosterEventsignores matching PC focus frames until all overlapping requests settle, including refusals. The caller then selects the new pane, which preserves keyboard focus and Back behavior. Tests cover this behavior, per-PC isolation, overlap, and refusal. The regression script checks the end-to-end ordering and resets the setting infinally. The English, Korean, Japanese, and Chinese descriptions state the Ovis 0.4.13 limit. The existing focus-follow guards and tests cover the local-interaction requirement.
Full details: Out of Scope Changes check
-
Explanation
All changed files support
#1470. The implementation changes focus handling, the regression test verifies the split race, and the unit tests cover request lifecycle behavior. DESIGN.md, the changelog, and four setting translations document the same behavior. No unrelated change is demonstrated.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 9 files. (2 skipped: 2 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
Merge pass gate review of 34659ac: one blocker. An unanswered split request can switch off following herdr's focus with no end. Blocker
Fix: bound the request, including reading the response body, for example with an Holds
The browser lanes are left to this PR's CI. The merge pass checks the fix commit (the changed range only) and then queues the PR. |
…PC never answers The merge pass found that a split request the PC never answers (a stalled connection, neither refused nor closed) kept that PC's pane-focused frames unfollowed until a reload. The hold now ends when the request settles or after OWN_MOVE_HOLD_MS, whichever comes first, and a late answer does not release a newer request's hold.
|
Fixed the blocker in a4072c6: an unanswered split request no longer turns following off for that PC.
|
|
Merge pass review-work report. Overall: PASSED.
The fix in a4072c6
Held from the gate
Follow-up (LOW): the hold is bounded, but the stalled request itself is not. It stays pending in the browser until the connection gives up. All required checks are green and no review thread is open. CodeRabbit did not review this PR (rate-limited or skipped). The reviews above stand in for it. |
What it does for the user
With Settings → Terminal → Follow herdr's focus on, opening a split from this device (Split pane right and open it, Split pane down and open it, or a pane's own Split right / Split down menu) always gives the new pane the keyboard and a Back entry to the pane it was split from. Before this, herdr's focus moving to the new pane could reach this device before the split's answer. This device then opened the new pane as an automatic pick, with no keyboard and no Back entry, and the split's answer, finding the selection already moved, did nothing.
The setting's description now also says that a PC on Ovis older than 0.4.13 does not report herdr's focus, instead of the setting silently doing nothing for such a PC.
Fixes #1470. #1803 already fixed the MEDIUM item and the regression-script cleanup; this fixes the two LOW items left.
Change
src/lib/followFocus.ts:movingHerdrFocus(machineId, request)marks a request from this device that moves herdr's focus on that PC, until the request settles (finally, which runs before the caller's ownthen).followsHerdrFocusgainsownMove: while such a request is out, that PC'spane-focusedframes are not followed, and the caller opens the pane itself. Refusals end the hold too, and two overlapping requests hold until both are answered.src/lib/api.ts:splitPanewraps the request whenfocusis set. It is the one path both split callers (App.tsxactions andPaneCanvas.tsx's menu) take, so neither caller changes. Other PCs' frames and other devices are unaffected.src/lib/useMachineRoster.ts: passesownMovewith the frame's PC.Design precedent: none; the coding-agent apps have no outside focus to follow. It follows the rule
followsHerdrFocusalready has for a link still landing: an explicit action on this device wins over herdr's focus.How it was verified
scripts/follow-focus-regression.ts(run byui-regression.tsagainst an isolated herdr) has a new case. With the setting on, it opens Split pane right and open it from the command palette and holds the split's HTTP answer withpage.routeuntil herdr's frame for the new pane has been handled. The check for that is a tab created afterwards being listed. It then checks that the selection did not move, that the answer opens the new pane with the keyboard in it, and that Back returns to the pane it was split from.herdr's frame for this device's own split is left to the split's answer('w3:pA' !== 'w3:p7'). The frame took the view first.bun run check run --build bun scripts/ui-regression.tspasses, 72 PASS, including the existing follow-focus cases (off, on, typing, a dialog open).src/lib/followFocus.test.ts:ownMovekeeps the pane; the hold is per PC, is over inside the caller'sthen, ends on a refusal, and lasts until every overlapping request is answered (17 pass).bun run check fastpasses on this commit (typecheck, build, unit tests).