patches: fix discontiguous moves reading only first word

For discontiguous moves (teleports, org-agenda items separated by blank
lines, multi-line jumps), AXSelectedTextChanged was sent with
AXTextSelectionDirection=discontiguous.  VoiceOver interprets an
explicit discontiguous direction as 're-anchor only' and reads only the
word at the cursor, ignoring VoiceOver's own line-browse mode.

The pre-review code (51f5944) omitted direction/granularity for all
moves and let VoiceOver determine what to read from its navigation state.
This correctly reads the full line when the VoiceOver rotor is in line
mode, which is the typical setting for text navigation.

Fix: omit AXTextSelectionDirection and AXTextSelectionGranularity from
AXSelectedTextChanged when direction=discontiguous.  Include them only
for sequential moves (direction=next/previous), where the explicit hint
ensures VoiceOver reads the correct unit without an extra state query.

This fixes:
- org-agenda / org-super-agenda j/k: items separated by blank lines
  cause singleLineMove=NO (non-adjacent AX indices), so direction was
  discontiguous -> only first word read.
- Any other navigation that crosses blank or invisible lines.

Sequential moves (C-n/C-p, single adjacent j/k) still include
direction + granularity=line for reliable full-line reads.
This commit is contained in:
2026-03-02 21:30:42 +01:00
parent ce34c44c2f
commit b6a576a312
9 changed files with 56 additions and 42 deletions

View File

@@ -1,4 +1,4 @@
From 195c2d4ccc1d607984468fa7f9a8e41005463f04 Mon Sep 17 00:00:00 2001
From 9650910e7ac6e423ea9beaa75033d12693b93c89 Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz>
Date: Sat, 28 Feb 2026 12:58:11 +0100
Subject: [PATCH 1/8] ns: add accessibility base classes and text extraction