Raxol.Core.Accessibility.AnnouncementQueue (Raxol Core v2.4.0)

Copy Markdown View Source

Pure-functional helpers for announcement queue management, priority sorting, history tracking, and delivery. Used by AccessibilityServer.

Summary

Functions

Appends a high-priority focus announcement to both queue and history.

Returns history limited to limit entries (or all when nil).

Parses event dispatcher arguments into {old_focus, new_focus} tuples. Returns {nil, nil} when the event cannot be parsed.

Returns {next_message, updated_announcements_state} or {nil, state} when empty.

Returns the announcement state map after processing a new announcement. Does nothing if announcements should not be processed.

Functions

enqueue_focus(announcements_state, text, event_manager_pid)

Appends a high-priority focus announcement to both queue and history.

limited_history(history, limit)

Returns history limited to limit entries (or all when nil).

parse_focus_change_event_data(event_data)

Parses event dispatcher arguments into {old_focus, new_focus} tuples. Returns {nil, nil} when the event cannot be parsed.

pop(announcements_state)

Returns {next_message, updated_announcements_state} or {nil, state} when empty.

process(announcements_state, message, opts, callback, enabled?, screen_reader?, silenced?)

Returns the announcement state map after processing a new announcement. Does nothing if announcements should not be processed.