If this is a summer research project, you don't have a lot of time left in which to change the situation.
Most likely, you'll end up having to accept that this research experience didn't turn out well. That happens! Try to look back and determine when you could have seen warning signs and what you could have done to change things. Use this learning to avoid or better manage similar situations in the future.
Charitably, learning to do research well is challenging, as is managing an undergrad, and maybe your PhD student has biffed one or both. With any luck they've learned something and won't do this again.
Beyond this, there are still several things you can walk away with:
Your lessons learned, as above. Any experience is valuable. At your level, the act of participating in research is, by itself, something of a differentiator and you are credited for having done it when applying to future endeavours. Also, interviewers for both grad school and industry are often interested in times when things went wrong
A letter of recommendation. These are key if you intend to pursue graduate study and are, I think, weighted much more heavily than a mere count of publications. If you're advised by a PhD student it's often the case that the professor will use their input (sometimes verbatim) to write an LoR. Note that this means your relationship with both the professor and PhD student is important.
A co-authorship. This is nice to have and you should pursue authorship within reason (don't pretend you can do much work during the semester). However, even if you were first author (it doesn't sound like it in this case), the LoR would still be much more important since it contextualizes you and your work.
All three of those take-aways seem very do-able from your description. Maybe the paper won't be as impactful, maybe you've learned less directly the things you wanted to, but you're not leaving empty-handed.
So what should you do with the time left?
Both the advisor and the PhD student know that you were not responsible for strategy on this project. Their opinion of you is based on the ideas you've brought to the table, how you've comported yourself, and the quality/quantity of your work. Even if the project itself has gone poorly, you may have been and should continue to be exemplary along all these axes.
If you have good relationships with the PhD student and advisor you might meet with them, separately or together, to try to do a post-mortem. If you do this, do not blame the PhD student or harp too much on what might have been. The only reason to have this conversation is for you to learn, not to confront anyone, so be sure to figure out ahead of time what you're interested in knowing. Perhaps the ideas you see as exciting and achievable are, in their estimation, too big/hard to accomplish in the timeframe available? Perhaps they prefer an incrementalist approach? I wouldn't suggest asking these questions directly, but they're ways of thinking about the problem.
EDIT
You say you know what you're doing. This provides an additional avenue you can explore.
Many universities have programs which pay undergraduates to do research they propose.
- At University of Minnesota this is called UROP and provides a stipend of $1,500 for 120 hours of research, paid through financial aid.
- At MIT it's also called UROP with a maximum funding award for fall and spring of $1,995 (140 total hours) and $6,840 (480 total hours) for the summer.
Typically the applications for these programs are easy: a page or two of writing covering the background, what you plan to do, maybe a timeline of milestones, and what faculty you plan to work with.
Since you say you have good ideas and have brought them up, you could try to arrange a UROP to work with your professor independently (not under the PhD student). Alternatively, you could bring your ideas to another professor and work with them (this lets you see another lab in action and sets you up for another recommendation). The only tricky point is if the PhD student feels like they somehow own the ideas you've brought up.