A lot was happening at 49ers headquarters Friday – and not all of it revolved around finding college prospects in the NFL draft.

The day began with the consummation of the Trent Brown trade with the Patriots, then came Jaquiski Tartt’s two-year contract extension – then moving up to draft a dynamic receiver before adding two versatile players on defense.

Let’s break it all down in five takeaways from Santa Clara on Friday.

Trading Trent Brown to make way for Mike McGlinchey

General manager John Lynch admitted Friday he crossed his fingers underneath his interview table Thursday night when talking about the uncertain future of Trent Brown, the incumbent starting right tackle. The 49ers had just selected Notre Dame tackle Mike McGlinchey presumably to take Brown’s spot.

Brown was already on a plane to New England to take a physical after the 49ers added McGlinchey. But that had to be kept secret. The deal could only get done after Brown passed a physical Friday morning to ensure his shoulder was on the mend. He had surgery to repair a torn labrum after the season.

The 49ers attached a fifth-round pick to Brown, entering the final year of his contract, with New England returning a third rounder in the trade. It was a good haul for a player San Francisco no longer wanted.

“I did say, ‘Never say never.’ We had agreed in principle (to the trade),” Lynch said. “Part of these deals, you got to see them through. … I had spoken to Trent last night, we talked to him, he got on a plane, went out to New England, passed a physical and there we were.”

The 49ers began the day among the league leaders in cap space, with some $47 million available (not accounting for the incoming draft class) to roll over into 2019. The team would love to have room going into next spring to dole out lucrative contract extensions to players like DeForest Buckner and maintain flexibility in free agency.

Adding McGlinchey ultimately saved the 49ers from giving Brown a lucrative second contract, which could be near the top of the market in the $13- to $15-million range annually. Given the concerns about Brown’s conditioning and overall commitment to the program, it was clear the team was hesitant to reward him with a deal making him one of its highest paid players.

“It’s all part of the puzzle,” Lynch said. “You look at all these things. Is this a guy that we’re going to want to pay the next contract to? Along those same lines, we talked at great length about what we appreciated about Mike McGlinchey. … We’re by no means a finished product. We still have some areas that we need to address, other pieces to the puzzle.”

Trading Brown gave the 49ers chances to add more pieces. They used their third-round pick from New England on uber-athletic defensive back Tarvarius Moore (more on him later). They used their third-round pick they acquired in the trade with the Bears atop the 2017 draft to move up for receiver Dante Pettis in Round 2.

So moving away from Brown, the more seasoned player than the rookie McGlinchey, gave the 49ers more financial flexibility beyond this season and the draft capital to help land the receiver they wanted. Speaking of which…