Yeah when I'm worried about the potential results of a swap (i.e. anything at all is ambiguous due to multiple types), I'll just do it manually, though this only really comes into play with processors, since you won't permanently lose other items in the same way (you can still recover from the occasional mistake/mis-swap).
I think it is not the algorithm that has greatest room for improvement here. Having the part to be removed flash red very briefly could be helpful in that regard.
Ooh that's a very interesting idea... However, when you are going to permanently destroy-replace a processor, doesn't the UI already warn you which item will be removed with a text message? Since I don't think you'd want to require double confirmation on
all swaps, I guess what you're saying is that in addition to the processor-specific message only
processors would flash in that case? (Because for any other items to flash first that would mean the swap couldn't take place immediately.)
I like the flashing processor idea, which also makes sense to apply when simply confirming a regular (processor) removal, not just swaps.