debounced visibility checks, removed global state