cotabby icon indicating copy to clipboard operation
cotabby copied to clipboard

Text mirror caret fallback

Open Jam-Cai opened this issue 7 months ago • 1 comments

Some fields don't expose AX caret bounds (AXBoundsForRange returns nothing), which means we can't place the overlay. Mirror the field in a hidden NSTextView and use NSLayoutManager to compute caret position in field-local coordinates; transform to screen coordinates via the field's AXFrame.

Acceptance

  • [ ] When AXBoundsForRange returns nothing but the key-event prefix tracker has state for the field, the overlay appears at the mirror-computed position.
  • [ ] Mirror honors the field's font and line-height when discoverable via AX.
  • [ ] Falls back to anchoring against AXFrame bottom-right when mirror can't be built.
  • [ ] No regression for fields that already provide AX caret bounds.

Parent: #16

Jam-Cai avatar Apr 22 '26 17:04 Jam-Cai

Closing for OSS launch cleanup. Complex workaround (hidden NSTextView mirror) without evidence of how many apps actually need it. Can reopen with specific app data.

FuJacob avatar May 21 '26 06:05 FuJacob