Without spoilers, there are several choices that can lead to the saving of the Nightsong while Shadowheart is in the group at the time.
And as for those complaining that Shadowheart left them because they left her behind when exploring a Shar Temple, complete Shar related tasks, and do the single most important decision to Shadowheart's entire story-line with her... What other outcome would you expect?
Choices have consequences. THis isn't the typ of game where you can make any choice you want, and it has no effect; I applaud Larian for making choices ACTUALLY MATTER.
In most cases you do get one final chance to change a companion's mind, but if you fail that - yes, they will leave (or sometimes even attack you).