Adding records to History Subpanel?

So I’ve got what I thought might be a simple project. I have NOTES that are added to PROJECT TASKS. They show up in the history of the Project Tasks subpanel. Great! What I also want to do is add this to the history subpanel for the related Opportunity to the Project. I’ve got that figured out how to get it and how to add the relationship via an after_relationship_add hook to the Opportunity. However, it REPLACES the relationship to the Project Task. Not what I want. I want to have both! So I created another relationship field in the note (opportunities_notes_1) which I can now populate with my hook. So now the note is related to two records. Great! But it shows in an extra subpanel in the Opportunities module. I want it to show in the History Subpanel.

Is there a way to add notes based on this new relationship to the History subpanel in Opportunities, or am I going about this all wrong?

I am not sure, but I would start by trying changes here

the basic idea is to incorporate the new relationship into the aggregating “history” subpanel.

In other modules I see a file called ForHistory.php which I guess is what that 'subpanel_name' => 'ForHistory' is referencing. But I don’t find it for Opportunities, so you’ll have to look for some default ForHistory metadata somewhere…

Actually, you could do it the same way e-mails are added to the accounts history subpanel and write a function that fetches the records you want to display. In that case, you wouldn’t even need a custom relationship.