I try to match my calorie output on the bike with my calorie input during and before the ride. So if I ride in the morning, my breakfast counts towards my calorie total. Same if I ride after work, I count my afternoon snack towards the total.
Anything you eat during your ride and in the 3 hours before you ride should count, basically. If that matches the calories you expend, and you have a snack or shake to recover, you’ll be fine. You don’t bonk.
The other thing to note is that the intensity of the ride will make a big difference to what makes up those calories. For a race or a hard interval session, my pre-ride meal will be mostly carbs, and I’ll tend to have more energy drink mix and gels on the bike. For easier rides, I’ll have more balanced nutrition before, with more protein, fat, fruit etc, and eat more solid food on the bike like bananas or muesli bars or a sandwich or something.