Tell her immediately. There has never been a better time for a nanny to find a new job. It’s crazy!
Let her work for as long as you need her but give her time off for interviews. Talk to your kids together and make it a positive - make plans for how and when nanny will see them and how much fun it’s going to be.
At the end of her time, giver her a parting bonus and answer her potential employers reference calls immediately. Let her tell your kids how much she loves them and a specific time (Like Saturday at two) that she’ll see them again.
All nannies and employers of nannies know that nanny jobs don’t last forever - but your children don’t know that. Let their relationship with her continue.