10 Commits
Author SHA1 Message Date
Martín Lucas Golini c59920c72c feat(a11y): expose basic HTML accessibility semantics
- Expose source text, heading levels, links, lists/items and image alt text
- Keep formatting wrappers transparent and nested controls accessible
- Route link activation through existing navigation and interception
- Project passive fragment focus to links while preserving control focus
- Notify clients of text, href, alt text and semantic role changes
- Map HTML semantics to AT-SPI, UIA and macOS accessibility APIs
- Avoid advertising selection capabilities for static HTML lists
- Preserve dormant allocation behavior without new per-widget caches
- Fix MinGW harness compatibility with both TreeScope enum spellings
- Add unit/native regression coverage and update accessibility docs
2026-10-12 23:33:46 -03:00
Martín Lucas Golini 925053484d Fixed all review items:
- Password-mode changes immediately clear/restore the Inspector preview and notify native clients.
- Added regression tests without artificial focus events.
- Verified full-value copying and password privacy using an in-memory clipboard.
- Updated incremental-index documentation.
2026-10-11 11:10:31 -03:00
Martín Lucas Golini cae7595773 Fix accessibility hierarchy invalidation and tree expansion events
- Refresh virtual children when column visibility or main column changes
- Notify semantic parents when widget roles change tree exposure
- Report expansion state changes for queried tree rows
- Use scalar native queries without building full node metadata
- Add Linux CI coverage for deferred policy changes
- Add hierarchy, expansion-event and UIA scalar-query regressions
- Fix multiline control-statement braces and update architecture docs
2026-10-10 21:21:36 -03:00
Martín Lucas Golini c27425887f Fix accessibility dispatch safety, selection reporting and tree updates
- Defer policy changes during native dispatch and guard re-entrant updates.
- Correct container hit testing and semantic subtree identities and indices.
- Avoid duplicate indexed-reparent events and skip no-op sibling moves.
- Keep child insertion linear and avoid registering unseen nodes unnecessarily.
- Add lightweight role/state queries and reduce node-info overhead.
- Implement AT-SPI selection queries, actions and event-maintained snapshots.
- Release AT-SPI session-bus resources and unify event-loop wakeups.
- Fix Windows harness executable discovery and expand regression coverage.
- Document lifecycle safeguards and selection snapshot requirements.
2026-10-10 20:52:02 -03:00
Martín Lucas Golini 67660d4c13 Add accessible text, relations and live regions; keep dormant a11y free
Text:
- Ranged text access in code points (length, range, line bounds) that
  never copies more than requested, plus a text revision (document UUID
  and modification) so UIA and macOS cache their UTF-16 copies.
- Report document edits as exact change records, up to four per widget
  and frame, then collapse to one whole-text change. Resets, loads and
  document swaps report a whole-text change.
- The removed text is available only while an edit is being notified
  (TextDocument::getNotifiedRemovedText()); DocumentContentChange stays
  { range, text }, so queued records (LSP) copy nothing extra.
- Suppressed text changes are keyed by node ref, so a document shared
  with another window still reports its edits.
- UITextView reports NameChanged; UITextInput overrides onTextChanged()
  to report ValueChanged.

Relations, live regions and shortcuts:
- aria-labelledby, aria-describedby and aria-live (API and CSS). Ids a
  client has read are remembered; renaming, adding or removing their
  widgets notifies the dependents. setId() copies the old id only when
  it is remembered.
- Live regions and UISceneNode::announceForAccessibility(). A newer
  change from the same widget replaces its pending announcement, and
  hidden sources are dropped.
- Menu item shortcuts (std::string text and key) exposed as AT-SPI key
  bindings, the UIA accelerator key and macOS command characters.
- ScrollTo for anything inside a scroll view
  (UIScrollView::scrollIntoView()). Icon-only buttons are named from
  their tooltip.

Dormant path (no client attached):
- Widget notifications are inline: one relaxed atomic load of a
  process-wide count of active root scenes, no call.
- Scene destruction and scene or host changes never create a manager.
  Without a client, notify() queues nothing and widget deletion does
  not register parents to announce it. While only the root has an
  identity, deletion skips the ancestor walk unless a remembered
  relation target may be affected.
- When the last client disconnects, model-view sources release their
  queried rows. Persistent handles count their registrations, so
  handles held elsewhere survive (PersistentModelIndex::release()).
- Spin boxes no longer hide their input explicitly, and
  AccessibilityProperties shrinks from 144 to 136 bytes.

Backends:
- AT-SPI: object:announcement, word and line granularity, ranged
  reads, SetTextContents reported as its minimal diff. Watch
  disconnects per client (NameOwnerChanged arg0 plus a non-blocking
  NameHasOwner check) instead of for every bus name. Without a scene
  thread pool, initialize on a detached thread that shares ownership,
  so teardown never waits on D-Bus timeouts.
- UIA: notification events (resolved at runtime, Windows 10 1709+),
  text ranges served from the revision cache, and a per-frame provider
  drain that skips the lock when nothing is queued.
- macOS: announcements, a UTF-16 text cache per revision, and command
  key attributes.
- EEPP_ACCESSIBILITY_TRACE=1 logs client activity transitions.

Fixes:
- UICodeEditor::isType() no longer dispatches to a subclass's
  getType(), so a UITextEdit is a code editor again.
- ecode: dropped files open only in document editors, not in other
  code editors such as a commit message box.

Tools, tests and docs:
- Widget inspector: role names, shortcut, relation and live rows, and
  an accessibility audit (unnamed controls, broken relations).
- Accessibility example: live status, an icon-only button, and edit and
  reset actions that test_atspi.py checks end to end.
- Regression tests for text records, relations, live regions,
  disconnect and reconnect, scene lifecycle and id changes.
- Add the AccessibilityDormant benchmark (C++ new/new[] counted on the
  measuring thread) and benchmark_accessibility_dormant.py, which fails
  on missing measurements and compares against other builds with
  --compare LABEL=PATH.
- Document the dormant-path rules, what survives a disconnection, and
  the remaining platform limitations.
2026-10-10 02:01:52 -03:00
Martín Lucas Golini d27eae5927 Harden accessibility lifecycle, events and native backends
Teardown and identity:
- Detach native backends before scene children are destroyed and clear
  mRoot afterwards, fixing a use-after-free when an AT-SPI client is
  connected while a window closes.
- Invalidate a deleted widget's subtree once, top-down, before OnClose
  handlers run (NODE_FLAG_DESTROYING). Descendants never walk into
  destroyed parents, and deleted identities cannot be re-registered.
- Closing scenes expose no accessibility manager through either accessor.
- Deleting widgets no client has seen allocates no identity and emits no
  events.
- Ignore events from widgets not yet attached to a scene.

Events:
- Keep the order of state and structural events; coalesce only adjacent
  query-again hints.
- Stop emitting per-widget BoundsChanged; bounds are queried on demand.
- Report the Focused state and keyboard focus only on the projected focus
  owner, through a shared helper used by both paths.

Model views:
- Lazy child count and child queries, cached sibling indexes, selection
  and hit testing without enumerating rows.
- Row identities follow inserted and removed rows; removed rows are
  pruned from native wrapper caches.
- Expose the active cell editor as the child of the row or cell it edits.

AT-SPI:
- Correct state bits (EXPANDABLE/EXPANDED, SENSITIVE, CHECKABLE,
  SELECTABLE, READ_ONLY, SINGLE/MULTI_LINE, SELECTABLE_TEXT) and the
  password-text and panel roles.
- Emit text-changed insert/delete, caret-moved and selection-changed
  events, diffed once per frame. Support line granularity,
  SetCaretOffset and selection editing.
- Track clients by bus name so the active flag clears on disconnect.
- Fix the I/O thread busy-spin and stranded dispatch backlog, flush
  queued signals, and type-check Properties.Set values.

UIA:
- Raise focus only for the focused element.
- Defer UiaDisconnectProvider out of widget destruction.
- Keep providers alive for in-flight cross-thread requests.
- Reject unknown interfaces without a UI-thread round trip.
- Require window-specific client activity.

macOS:
- Avoid repeated full node info builds.
- Use sibling indexes and lazy child access.
- Fix label/value deduplication for list items.

Tests and docs:
- Add regression tests for focus ownership, teardown, event ordering,
  lazy model identities, nested scenes and cell editors.
- Extend the AT-SPI validation scripts and document the current
  performance characteristics and limitations.
2026-10-09 00:06:36 -03:00
Martín Lucas Golini 51b1059996 Fix accessibility ownership and native backend lifecycle
- Prevent dense-map iterator invalidation during widget deletion.
- Invalidate widget and model references when scene ownership changes.
- Expose nested-scene controls through the host accessibility manager.
- Preserve identities when reparenting within the same host.
- Synchronize AT-SPI state access with asynchronous initialization.
- Wake the shared SDL event loop without retaining window-owned Input pointers.
- Add lifecycle regression tests and hidden multi-window AT-SPI validation.
- Ensure test-bus failures cannot skip child-process cleanup.
2026-10-08 21:20:14 -03:00
Martín Lucas Golini 5b2085616f Move accessibility initialization off the main thread
Add optional ThreadPool support to UISceneNode and UIApplication settings,
sharing the configured pool with secondary application windows.

Initialize the Linux AT-SPI transport asynchronously when a pool is
available, keeping D-Bus connection, registration, and I/O setup away
from the UI thread. Publish the initialized backend safely and retain
synchronous initialization as the compatibility fallback.

Defer accessibility manager creation to root scenes and make nested
UISceneNodes delegate accessibility state and manager access to their
host scene.

Cache active-client state on UISceneNode to make inactive widget
notifications a minimal fast-path check.

Exercise asynchronous initialization in the accessibility example and
verify thread-pool propagation and nested-scene delegation in tests.

Keep hidden AT-SPI benchmarks focused on timing, and validate component
hit-testing separately through the visible semantic test.
2026-09-11 19:25:29 -03:00
Martín Lucas Golini 3751e05df6 Improve native accessibility reliability and performance
Harden the AT-SPI protocol implementation, application discovery, multi-window routing, request handling, and model invalidation. Keep inactive accessibility effectively tax-free and update UIA structure notifications.

Add hidden AT-SPI performance and integration benchmarks, expand the accessibility example, and cover model replacement and multi-window behavior with regression tests.
2026-09-11 11:25:15 -03:00
Martín Lucas Golini a0de38a758 ui: improve native accessibility performance and event handling
- lazily activate AT-SPI work only when a real accessibility client connects
  - eliminate unused accessibility overhead during widget construction and startup
  - wake the SDL event loop for D-Bus traffic without blocking the UI thread
  - implement AT-SPI cache, structural events, and text/editable-text interfaces
  - improve UI Automation events, properties, runtime IDs, and window procedure safety
  - centralize widget semantics in the accessibility resolver
  - preserve accessible identity across model and widget lifecycle changes
  - optimize widget class storage with SmallVector
  - expand accessibility unit tests and add deterministic AT-SPI integration coverage
2026-09-06 18:10:40 -03:00