I started my postdoc almost two years ago on a very interdisciplinary subject. Our team includes me, a phd student, a senior postdoc and the PI. The arrangement of our team is somehow unique. I and the phd student are based in the same institute which is the main lab; the other postdoc is in a different institute in the same city, and the PI is appointed at a different university overseas. However, she must visit the main institute for about six months each year.
I have an excellent relationship with the phd student; we share the same personality traits and research habits. We work well with each other and compensate for our weak spots. However, we both have massive issues when the PI is visiting. Unfortunately, we have to share the same office with her at the time of her visit, and she has a completely different, and most of the time intrusive, personality. We were both so annoyed during her last visit that we had to take about two weeks off to just not be with her in the same room.
I hesitated to share personal information with her in the past two years and have a strong "No" attitude regarding keeping the boundaries. Nevertheless, I always tried to tolerate her. But gradually I was worn down by the constant stressful daily moments with her during her visits, and I started to passively ignore her in daily routines such as lunch or asking to go out. I developed a conscious guard against her, especially some daily behaviors, whether about asking how I am doing or asking to do something related to work.
In addition to these personality issues, she has a very questionable (this is absolutely subjective; I have a bit strict ethical and behavioral codes) professional attitude. She does not acknowledge others' works properly, she has a mixed jealousy/envious reaction towards others' achievements, always thinking that she is right, and especially avoiding being held accountable for making difficult decisions on interventions. This resulted in a toxic working environment, preventing me from staying motivated to come to work and do my job. For example, I wrote a small grant proposal this year for her which was 99% my brainchild. I wrote everything from beginning to end, and she proofread the final version and added her profile information. She submitted the grant by putting herself as PI and including me as the team member in the proposal. The grant was accepted two months ago. She once told me thank you on the day she got accepted. After that, there were several internal and external public announcements in our institute and multiple high-level meetings with directors. However, she did not mention a single word to include me in any aspect.
Scientifically, she is mediocre. Unfortunately, she advanced in her career mainly by her soft skills rather than intellectual merits. I just mentioned this because I tend to tolerate harsh working conditions to some extent if I see that I learn something from my advisor, which is unfortunately not the case.
(EDIT regarding merits: This judgment was shaped in my mind over time. I don't question her superiors, but she is working on a hot topic that brings visibility and money to the institutes she is working with. So her bosses might not care if she is just talking about science).
I am now really at a crossroads. I am mentally stressed because of her attitude at work, but at the same time, I invested in the subject so much that I don't feel good if I leave without a publication. I am the only person on the team who can push this particular work forward, and I can't afford to leave it unfinished and move on since this was supposed to be my stepping stone in the interdisciplinary field that I got into in the first place.
My question is simple and also complicated: how can I deal with her for at least one more year until I finish what I have started?
Thanks for your thoughts.