Skip to content

Restore automatic transcript paste after shortcut release - #1193

Merged
altic-dev merged 1 commit into
altic-dev:mainfrom
mvanhorn:fix/1168-automatic-paste-command-sequence
Oct 21, 2026
Merged

altic-dev merged 1 commit into
altic-dev:mainfrom
mvanhorn:fix/1168-automatic-paste-command-sequence

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

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

  • 🐞 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 🧹 Chore
  • 📝 Documentation update

Related Issue or Discussion

Closes #1168

Testing

  • Tested on Intel Mac
  • Tested on Apple Silicon Mac
  • Tested on macOS version:
  • Ran linter locally: swiftlint --strict --config .swiftlint.yml Sources Tests Package.swift
    0 violations in 555 files on macOS 27.2, Apple Silicon.
  • Ran formatter locally: swiftformat --config .swiftformat Sources
    Not run for this change. It touches only Tests/FluidDictationIntegrationTests/SpokenSendTests.swift, which is outside Sources.
  • Ran tests locally:
    swift test --filter FluidDictationIntegrationTests failed 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

  • No UI/visual changes; screenshots/video are not applicable.

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.

  • A human created this PR or reviewed and approved it before submission, understands the full diff, and takes responsibility for the change.

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T18:29:03.470350Z a776d77 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added needs PR template Pull request is missing required template content. needs screenshots Pull request needs screenshot or video evidence. labels Oct 20, 2026
@github-actions

Copy link
Copy Markdown

The PR Policy check is blocking this PR because required template information is missing.

Please update the PR description with:

  • Testing
  • Screenshots / Video

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.

@greptile-apps

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This test-only change appears safe to merge.

Summary

Tightens the paste-event test without changing runtime behavior.

  • The paste-sequence test checks every modifier exactly.

Reviews (2) · Last reviewed commit: "Restore automatic transcript paste after..." · Reviewed by Greptile

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

Copy link
Copy Markdown

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: 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@github-actions github-actions Bot removed needs PR template Pull request is missing required template content. needs screenshots Pull request needs screenshot or video evidence. labels Oct 20, 2026
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
@altic-dev
altic-dev force-pushed the fix/1168-automatic-paste-command-sequence branch from 8cfd3bb to a776d77 Compare October 21, 2026 18:27
@altic-dev
altic-dev merged commit 1bf38dc into altic-dev:main Oct 21, 2026
5 checks passed
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.

[BUG] Transcribed text no longer pastes automatically

2 participants