Along with her own flashbacks, I feel that Yamato has been getting a lot of connections to Oden's flashback beyond just him joining Roger. The most blatant ones are from the Roger vs Whitebeard chapter.
For there to be these thought bubbles basically telling you to compare these scenes, it's safe to say what the intent was. You can then see more when you look at basically everything with Oden in that chapter. He and Yamato both clashed with their soon-to-be captain, witnessed the sky split in action, considered family by the crew they were leaving, and were left speechless twice by Luffy and Roger respectively. The only thing not done yet is Yamato joining Luffy at the feast when the big fight is over.
It then becomes apparent when you consider how unnecessary some of these connections are. Yamato didn't gain anything from hearing Luffy's true dream. She was going to be excited for him regardless thanks to Ace telling her to look forward to him. There's also this small detail of only Franky meeting both Yamato and Oden. With that blatant tease with Yamato passing Brook, I don't see any other reason Franky had a few lines with her. She simply could've fell down the hole with no notice from him like with Brook and there be 0 impact on the story.