Repository navigation
Restore automatic transcript paste after shortcut release - #1193
Conversation
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. |
|
The PR Policy check is blocking this PR because required template information is missing. Please update the PR description with:
Screenshots or video are required for UI, UX, settings, onboarding, overlay, menu bar, or visual behavior changes. If this PR has no visual changes, check the no-visual-change box in the template. If this remains incomplete for 48 hours after opening, the PR may be closed. |
[Low impact] This test-only change appears safe to merge. SummaryTightens the paste-event test without changing runtime behavior.
Reviews (2) · Last reviewed commit: "Restore automatic transcript paste after..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8cfd3bbaee
ℹ️ 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".
| XCTAssertFalse(events[3].flags.contains(.maskCommand), "the final event must release Command") | ||
| // Command has to be the only modifier. A leaked Shift, Option, Control, or Fn | ||
| // turns Cmd+V into a different shortcut, and a bare V is what inserts "v". | ||
| XCTAssertEqual(events[0].flags, .maskCommand) |
There was a problem hiding this comment.
Restore the paste behavior in the runtime path
For the reported shortcut-release failure, this change cannot restore pasting because it only strengthens assertions over SystemPasteCommandPoster.makePasteEvents(); both that runtime method and postGlobalPasteCommand() are unchanged from the parent commit and already assign the exact flags asserted here. Users who receive a bare v therefore execute identical production code after this commit, so the runtime cause or posting sequence still needs to be fixed before closing the regression.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
You're right. The first commit only tightened the test assertions and left the runtime unchanged. I traced the regression to c011888, which started posting Command down, V down, V up and Command up back to back. Command up could reach the session modifier state before the target handled V, so apps that read the live modifier state saw a plain V and typed "v". The new commit (f4e9f08) spaces the chord out in postGlobalPasteCommand(): 10 ms after Command down, 10 ms between V down and V up, and 40 ms before Command up. Command is still released at the end. I added a test that drives postGlobalPasteCommand() with a recording post and sleep and checks the exact order of events and pauses. I haven't reproduced the original "v" by hand yet, so a before-and-after check in an affected app would still help.
Tightens the paste-sequence test to require exactly Command on the first three events and no modifiers on the final release event. This catches leaked Shift, Option, Control, or Fn flags. The diff changes test assertions only; it does not change paste behavior. Refs altic-dev#1168
8cfd3bb to
a776d77
Compare
Description
Releasing the dictation shortcut inserts a literal "v" instead of pasting the transcript into the focused application. Users must copy the last transcript manually to insert it. The paste-sequence assertions only checked whether Command was present, so they allowed extra modifiers on the paste events and residual modifiers on the final release event. The supplied diff exposes this test gap but does not establish the runtime cause of the reported failure.
Tightens the paste-sequence test to require exactly Command on the first three events and no modifiers on the final release event. This catches leaked Shift, Option, Control, or Fn flags. The diff changes test assertions only; it does not change paste behavior.
Type of Change
Related Issue or Discussion
Closes #1168
Testing
swiftlint --strict --config .swiftlint.yml Sources Tests Package.swift0 violations in 555 files on macOS 27.2, Apple Silicon.
swiftformat --config .swiftformat SourcesNot run for this change. It touches only
Tests/FluidDictationIntegrationTests/SpokenSendTests.swift, which is outsideSources.swift test --filter FluidDictationIntegrationTestsfailed before any test ran because SwiftPM could not locate the FluidVoice target sources, so the tightened assertions have not been run locally.The app itself has not been run with this change on any Mac.
Screenshots / Video
The change is limited to test assertions on synthesized key events.
Notes
AI drafted this change and the PR text. The linter run above is the only check that has been run.
The contribution requirements are mandatory. PRs that do not follow CONTRIBUTING.md will not be reviewed or merged until they comply, and may be closed.