Skip to content

i#17

Merged
maker-or merged 2 commits into
mainfrom
oz
Mar 22, 2026
Merged

i#17
maker-or merged 2 commits into
mainfrom
oz

Conversation

@maker-or

@maker-or maker-or commented Mar 22, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Improvements

    • Enhanced auto-paste reliability with intelligent retry logic that monitors accessibility focus and pastes only when a valid target is ready.
    • Better detection of editable text locations across app components.
    • Made auto-paste retry timing and max attempts configurable.
    • Added diagnostic logging for paste readiness, cancellations, and outcomes.
  • Refactor

    • Public focus-checking API and paste scheduling behavior were replaced; auto-paste is now conditional retry-based (may alter integration behavior).

@coderabbitai

coderabbitai Bot commented Mar 22, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough
🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The pull request title is a single character 'i' which is completely uninformative and does not describe the actual changes made to the codebase. Replace the title with a descriptive summary of the main change, such as 'Implement retry-based auto-paste with focus validation' to clearly communicate the purpose of these significant refactoring changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch oz

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can get early access to new features in CodeRabbit.

Enable the early_access setting to enable early access features such as new models, tools, and more.

@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: a03620f9c1

ℹ️ 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".

Comment on lines +24 to +29
case "AXTextField", "AXTextArea", "AXComboBox", "AXSearchField":
return true
case "AXWebArea", "AXGroup", "AXScrollArea":
return isEditable
default:
return false

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 Preserve AXStaticText as a valid paste target

This whitelist drops AXStaticText, even though the previous implementation in this file explicitly accepted that role to support VS Code/Chrome-style editors. Because copyAndPasteIfPossible() now waits for isValidPasteTarget before sending ⌘V, any app whose focused editable control is exposed as AXStaticText will never auto-paste and will fall back to clipboard-only behavior instead.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
dhavnii/Features/Clipboard/ClipboardManager.swift (1)

41-44: Rename this helper to match the broader predicate.

isTextFieldFocused() now returns true for editable AXWebArea / AXGroup / AXScrollArea too, so the name no longer describes what callers are actually checking. Something like isValidPasteTargetFocused() would be less surprising.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@dhavnii/Features/Clipboard/ClipboardManager.swift` around lines 41 - 44, The
helper is misnamed: isTextFieldFocused() actually checks for any editable paste
target (AXWebArea/AXGroup/AXScrollArea), so rename the function to
isValidPasteTargetFocused() and update its doc comment accordingly; change the
function declaration (isTextFieldFocused -> isValidPasteTargetFocused) and
replace all call sites that reference isTextFieldFocused() with the new name to
avoid breaking behavior, keeping the implementation
(focusedElementState()?.isValidPasteTarget ?? false) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@dhavnii/Features/Clipboard/ClipboardManager.swift`:
- Around line 83-110: The retry poller in attemptPasteWhenReady can paste into
whatever app is frontmost during retries and can overlap multiple chains; fix it
by introducing a per-request token (e.g., an autoPasteToken UUID stored on the
ClipboardManager when copyAndPasteIfPossible starts) that is captured by
attemptPasteWhenReady and checked on each retry and before simulatePaste(), and
ensure starting a new copyAndPasteIfPossible replaces/invalidates the stored
token so any previous retry chains bail out if their token no longer matches;
update copyAndPasteIfPossible, attemptPasteWhenReady, and where simulatePaste()
is called to compare the captured token against the current manager token and
abort stale chains.

---

Nitpick comments:
In `@dhavnii/Features/Clipboard/ClipboardManager.swift`:
- Around line 41-44: The helper is misnamed: isTextFieldFocused() actually
checks for any editable paste target (AXWebArea/AXGroup/AXScrollArea), so rename
the function to isValidPasteTargetFocused() and update its doc comment
accordingly; change the function declaration (isTextFieldFocused ->
isValidPasteTargetFocused) and replace all call sites that reference
isTextFieldFocused() with the new name to avoid breaking behavior, keeping the
implementation (focusedElementState()?.isValidPasteTarget ?? false) unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e041eebf-7b49-4cae-a2cb-561aabfb1d19

📥 Commits

Reviewing files that changed from the base of the PR and between 483ea53 and a03620f.

📒 Files selected for processing (1)
  • dhavnii/Features/Clipboard/ClipboardManager.swift

Comment thread dhavnii/Features/Clipboard/ClipboardManager.swift Outdated
@maker-or maker-or merged commit 5a5a126 into main Mar 22, 2026
1 of 2 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.

1 participant