snapshotRememberedKeys method

Set<TKey> snapshotRememberedKeys()

Returns the set of keys currently held in expansion memory, plus parents whose child list was emptied by a sync while they survived collapsed.

A key is present here only if it was previously removed by syncRoots/syncChildren and its expansion state was recorded for restoration on re-add, or if it is a retained parent whose deliberate collapse must not be overridden when its children return. Intended for callers (e.g. the auto-expand heuristic in SyncedSliverTree) that need to distinguish a genuinely new key from one that is being re-added after having been filtered out.

Implementation

Set<TKey> snapshotRememberedKeys() {
  return {..._rememberedExpansion.keys, ..._emptiedWhileCollapsed};
}