Custom hook that manages the full Controller lifecycle for a MAIDR plot instance.
Handles:
Controller creation on focus-in (deferred -- no throwaway Controller on mount)
Controller disposal on focus-out
Timer cleanup and stale-closure prevention
Unmount cleanup
Returning to a hidden tab deliberately does nothing. Disposing and
rebuilding the controller there put the cursor back on the first point,
reset every slice (text, braille, any open dialog) and aborted an in-flight
chat answer along with the conversation -- all without an announcement,
because focus never left the figure and so no focus-in followed. A suspended
AudioContext needs no rebuild: AudioService defers its cues behind
resume() already.
Custom hook that manages the full Controller lifecycle for a MAIDR plot instance.
Handles:
Returning to a hidden tab deliberately does nothing. Disposing and rebuilding the controller there put the cursor back on the first point, reset every slice (text, braille, any open dialog) and aborted an in-flight chat answer along with the conversation -- all without an announcement, because focus never left the figure and so no focus-in followed. A suspended AudioContext needs no rebuild:
AudioServicedefers its cues behindresume()already.