When #25780 was closed, the history navigator stopped re-ordering when adding an existing element.
Previously with ArraySet, the set method had:
set(element T): void {
this.unset(element);
this._elements.push(element);
}
since native Sets don't have this property, this needs to happen manually in the cases where we expect adding an item to the set to affect its order, like in history.ts.