I think your grammar book is a bit mixed up.
"Sa" is a shortened form of "insan" which is formed from "ins" + "an". Compare this with "leis an". "San" is used instead of "sa" when a vowel sound follows. So "san árasán", but also "san fhuinneog" since "fh" is silent.
In Ulster, preposition + "an" always lenites, therefore "sa" lenites.
In Connacht, preposition + "an" eclipses, except in the case of "i" (i.e. "sa"), "do" and "de", in which case the following noun is lenited.
In Munster, preposition + "an" eclipses.
Normally, when "s" is lenited it becomes "sh", but after the article lenited "s" is always "ts".
"D" and "t" are never lenited after the article.
I think there is a rule in some dialect that "s" becomes "ts" in feminine nouns only, but I'm not sure where exactly. I'm most familiar with the Ulster dialect where this happens irrespective of gender.
All your phrases are correct, apart from "in the window", which I mentioned above.