On revert, fired-delay keys are kept only for layers the restored document has: a layer only the hover variant had is gone again, and its id may be issued anew by the next hover. Test a_hover_variants_own_layer_leaves_no_fired_key_after_the_revert (red before: a key for the missing NodeId(8) stayed); present 106 passed, clippy clean (CodeRabbit on #2362).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fired-delay key is (node, index), and inside an instance the index belongs to the variant shown. On revert, keys that fired during the temporary change inside an instance it changed the variant of are dropped (they name the hover variant's interactions); the snapshot's keys come back and the other new ones stay. Test a_delay_fired_on_a_hover_variant_does_not_block_the_restored_variants_delay (red before: A's runs left 0, right 1); present 105 passed, clippy clean (CodeRabbit on #2362).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The while-hovering / while-pressing snapshot also keeps the fired After delays, and the revert puts back the ones the temporary variant change cleared (keeping any that fired during it), so a delay that already ran on the variant doesn't run again. When an edit in the editor replaces the presented document, the run-time swap times are cleared with the rest of that state.
Tests: a_hover_variant_that_reverts_does_not_rerun_a_fired_delay (red before: count left 2, right 1) and an_edit_while_presenting_drops_the_swap_times (red before: left Some(0), right Some(1)); present 104 passed, clippy clean (CodeRabbit on #2362).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The swap times now travel with the while-hovering / while-pressing snapshot, so reverting a hover's variant change restores them and the variant shown again fires on its own deadline. Test a_hover_variant_that_reverts_keeps_the_after_delay_deadline (red before: left Some(0), right Some(2) at 1.3 s); present 102 passed, clippy clean (CodeRabbit on #2362).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change to swapped the instance's variant in place, so the next variant's After delay
kept the instance's node id and was already recorded as fired: the chain stopped
after one step. The swap now clears the fired keys inside the instance and records
when it happened; next_delay counts a timer from the later of the screen's arrival
and that swap.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium