heh this is too long. tl;dr my project leader takes over my projects, changes my code without discussing it, and is non-communitive. WWYD?
I work for a small consulting company with about 15-20 employees. My team has 4 members and we all have slightly different backgrounds. My project leader, who I will call Chris, is getting to be difficult to work with. When I first started out, he was great to work with but as our team gained people and he gained more of a managerial role, we have had friction. It started small with him spending a couple of hours rewriting about 10 lines of my code to make it "more human readable" (his words). Which is fine but the way he changed it didn't work under certain conditions. I pointed out the issue and then he spent several more hours fixing it. I found out later that he asked his wife whose code was more intuitive and she said mine. I kind of laughed to myself because it started to look like a pissing contest and let it go.
But the last few months have been unbearable. We lost a major client (Covid bankruptcy) and had to start marketing ourselves. I made a suggestion that we put together a sample code portfolio on a project because we no longer had work product to point to. My suggestion was initially completely ignored. I suggested it a couple of more times, and at some point suggested we do it as much for personal development as for a code portfolio. That all 4 of us would contribute and gain experience as well as showcase our talents. That time I was heard and they thought it was a great idea. After a week of spitballing ideas, Chris took the lead and started on it. I was moved to another project and wasn't given the opportunity to work on it. I kept offering to help but then I was told that Chris and the other project lead decided to go a different direction and they didn't need my help.
Fast forward to a couple of months ago, the project that I had been working on all of a sudden ramped up in importance. I was out at the client's site when I found out that Chris demoed my work in progress internally without telling me until afterward. It wasn't ready to be demoed and it went poorly. (He knew it was a WIP but he claimed he thought that it would be OK to demo.) I was really angry and I told him so. All of our work has been in a cloud solution so it can be accessed at any time. Chris uses this to edit or critique my work before I tell him it is at a review point.
For the last 3 weeks we have both been working on the same piece of code involving some complicated data analysis. He went and changed the entire portion that I had initially written. This required me to spend a lot of time trying to figure out the changes that he made and the implications to the analysis. He created a monster pull request and the other lead approved it before I had a chance to review it. Problem is, it introduced some really obvious bugs and because he didn't document his changes very well, I could only really change the obvious errors and let it go. I did message him to ask about details but he only responded to the parts of my message that weren't details.
I am being moved to another project and he is demoing our work product to the client next week. I asked him if he needed some last minute data samples and he said "I am doing it but anything you can add with an explanation would be great." I told him that I felt like I was being brushed off in the project and he never responded.
Is there some way to improve our collaboration or should I dust off my CV? I have been feeling like a failure for the last several months after being constantly dismissed. I do like my coworkers as people so I would like to make this better if possible.