Repository navigation
Conversation
WhatsApp's Catalyst composer answers AXStringForRange and AXValue with kAXErrorNoValue while the field is empty, so the zero-length read before the caret failed the text window, the selection came back missing, and the field resolved as unsupported: no ghost and no field icon until the first keystroke. A zero-length range is the empty string, so it is no longer asked of the host. The window assembly moves into a pure helper with tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018npLpTfiXEGCLF2mg73tFu
An empty field's caret comes from a zero-length AXBoundsForRange, which hosts answer with a zero-width box (WhatsApp: w:0 h:16.5). The indicator rejected it with CGRect.isEmpty, true for any zero-width rect, so the icon stayed hidden in empty fields. It now checks height, as the overlay does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018npLpTfiXEGCLF2mg73tFu
inputFrameRect is widened to the parent container and a 500pt minimum for card placement; in WhatsApp that is the whole chat bar, so the icon sat left of the attachment button. Use the unwidened element frame, as the translation card already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018npLpTfiXEGCLF2mg73tFu
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Summary
Read an empty field as empty when its host has no value
WhatsApp's Catalyst composer answers AXStringForRange and AXValue with
kAXErrorNoValue while the field is empty, so the zero-length read before
the caret failed the text window, the selection came back missing, and the
field resolved as unsupported: no ghost and no field icon until the first
keystroke. A zero-length range is the empty string, so it is no longer
asked of the host. The window assembly moves into a pure helper with tests.
Show the field icon beside a zero-width caret
An empty field's caret comes from a zero-length AXBoundsForRange, which
hosts answer with a zero-width box (WhatsApp: w:0 h:16.5). The indicator
rejected it with CGRect.isEmpty, true for any zero-width rect, so the icon
stayed hidden in empty fields. It now checks height, as the overlay does.
Place the field icon beside the field's own frame
inputFrameRect is widened to the parent container and a 500pt minimum for
card placement; in WhatsApp that is the whole chat bar, so the icon sat
left of the attachment button. Use the unwidened element frame, as the
translation card already does.
Test plan
main; builds.AXTextGeometryResolverTests.test_resolveCaretRect_returnsRealGeometry_forNativeTextField, is flaky on this machine: it also fails on branches that do not touch geometry and passes on others.Summary by CodeRabbit
The PR appears safe to merge based on the reviewed changes.
Summary
The PR lets an empty native text field produce a text window without requesting zero-length AX strings, accepts zero-width caret bounds for the field icon, and anchors that icon to the field’s own frame.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[AX selection and document length] --> B[Windowed text selection] B --> C[Focus snapshot and caret geometry] C --> D[Indicator] D --> E[Field-frame horizontal anchor] D --> F[Caret vertical anchor]Reviews (1) · Last reviewed commit: "Place the field icon beside the field's ..."