Repository navigation
Apply Caps Lock rules to all connected keyboards by default - #1339
Conversation
|
Review of PR #1339 (the diff was truncated after 60 KB, so the rest of
|
|
Review of the supplied diff. The diff was truncated at 60KB, so Findings
Tests: |
|
Review (diff truncated at 60KB; SettingsView, KanataViewModel, SessionRuntimeReport, tests and docs were not reviewed) Findings:
No security issues found in the reviewed portion; the root-lock guard and directory ownership/mode checks look sound. |
|
Review of PR #1339. The diff was truncated at 60KB, so the Settings view, No blocking bugs found in the reviewed portion. Points worth checking:
|
|
Review (diff truncated at 60 KB, so the rest of I found no blocking correctness bugs in the reviewed portion. The fleet lease design looks sound: root termination guard, per-device recovery that keeps the first failure, and fail-closed restore. Notes:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ecb0852a03
ℹ️ 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".
| self.capsFleetRecords = coverage.records | ||
| self.capsRecord = coverage.records.first | ||
| if current.isEmpty { self.capsInput.revoke() } |
There was a problem hiding this comment.
Release admitted Caps input before retiring its lease
If reconciliation retires the last keyboard lease while Caps Lock is held, this revokes admission without releasing logical usage 57 from Kanata or clearing its held output. This can happen after a transient verification read failure: reconcile restores the keyboard's original mapping and returns no records, so the eventual physical release no longer arrives as the reserved intermediate and cannot release the admitted Caps press. A Caps-to-Control rule can therefore leave Control stuck while the worker continues running. Release the admitted runtime input and reconcile its output ledger before revoking or replacing coverage, or use the existing shutdown cleanup path.
Useful? React with 👍 / 👎.
| if needsCaps, !SessionCapsRuntimeSupport.selectedKeyboardOnly() { | ||
| let fleet = SessionCapsMappingFleet(directory: SessionCapsRuntimeSupport.journalDirectory(), | ||
| backend: SessionCapsHIDUtilTransport.backend()) | ||
| let active = (try? fleet.activeDeviceIDs(bootSessionUUID: boot)) ?? [] |
There was a problem hiding this comment.
Suppress the legacy conflict warning for verified fleet mappings
With one connected keyboard in the new default all-keyboards mode, the fleet can be fully active yet Settings still tells the user that another app is remapping Caps Lock and must be turned off. This new branch correctly excludes active devices from uncovered, but refreshKeyboards subsequently still calls Self.conflict(on: device, intermediate: saved?.intermediateUsage). All-keyboards mode has no saved selection, so the intermediate is nil and ownRow cannot recognize KeyPath's own mapping. Skip that legacy single-device conflict check in fleet mode or use the verified fleet ownership when suppressing its own row.
Useful? React with 👍 / 👎.
Caps Lock rules currently pause when more than one keyboard is connected, even though ordinary mappings apply globally. This change gives each eligible keyboard its own crash-recoverable Caps Lock mapping, applies the same rules on all of them by default, and provides per-keyboard exclusions in General settings. An existing saved single-keyboard choice keeps its scope on upgrade; Settings offers an explicit switch to all keyboards. The cramped Connected Keyboard card and contradictory Caps status are also fixed.
Validation: the bridge-backed full Swift suite passed after the main review fixes; focused fleet and migration tests passed after the final status refinement; Swift build and accessibility checks passed. An opt-in live test on the mini mapped Caps on all three attached USB keyboard services (cl80, X2A, and the KeyPath physical HID fixture), read each mapping back, restored the originals, and verified each restore. The settings and Vim image snapshots still differ from their existing references (the same two mismatches were observed before this change).
Review: local Claude CLI review could not complete because its OAuth session expired. GitHub
claude-reviewfound scope migration, picker, recovery, retry, and warning issues, which were addressed in follow-up commits. The worker isolates a device failure when its original mapping can be restored; an unknown owner or failed restore still stops the session because the mapping state cannot be trusted.Remaining qualification: hot-plug timing has not been measured. The worker checks arrivals every two seconds, so an immediate Caps press after plugging in can precede mapping. Keep this PR unmerged until the final checks pass and that limitation is accepted.