The Bastila romance is built on completing her content thoroughly. Finish every one of her conversations, then work through her companion quest.
Kiss her aboard the Ebon Hawk once that quest is done. Finally, at the end of the game, redeem her from the dark side — that's the step that completes the romance and locks in the ending you're after.