Place the flour and salt in the bowl of a mixer fitted with the paddle attachment. Mix on medium for a few seconds. Begin adding the butter one cube at a time. Continue until the flour is speckled and crumbly, about 4 minutes. With the mixer still running, add sun gold tomatoes and vinegar until just combined. Do not overmix. Press the dough into a 6-inch disk, wrap tightly in plastic wrap, and chill in the refrigerator overnight (Or the freeze for a few hours).
Bring the crust to room temperature and lightly butter a 10-inch metal pie pan. Preheat the oven to 400°.
Dust your counter and rolling pin lightly with flour and roll the crust slightly larger than your pan. Lay the crust in the pan and press gently into its edges. Cut off the edges that hang over and discard. Freeze for at least 15 minutes or until you're ready to blind-bake.
Lay foil or parchment paper on top of the crust and weigh that down with dried beans or rice. Blind-bake the shell for 30 minutes. Remove the pie weights and foil or parchment and bake 5 minutes more. Set the cooked crust aside as you prepare the filling.
Filling
Toss half of the diced tomatoes with 1⁄2 teaspoon salt and 1⁄2 teaspoon sugar. Set them over a colander to drain while you get everything else ready, at least an hour.
Lower your oven to 375°. In a medium sauté pan or skillet, melt the butter and then add the onion and 1⁄2 teaspoon salt. Cook over medium-low heat until deeply caramelized. This will take about 45 minutes. If the onion gets away from you and burns a little, add 1⁄4 cup of water to the pan, scrape up the overbrowned bits, and keep going. In the end, you have a scant 2⁄3 cup caramelized onion.
Toss the remaining diced tomatoes with 1⁄2 teaspoon salt, thyme, and olive oil. Spread in a single layer on a sheet tray with as much room separating the individual pieces as possible. Slide the tray onto the middle rack of your oven and roast for 30-35 minutes. You're looking for the tomatoes to dry out and brown slightly.
Once all the individual components are done, stir together the onion, garlic, the fresh and roasted diced tomatoes, the remaining salt, sugar, black pepper, and basil.
Topping
In a separate, smaller bowl, stir together the mayonnaise, fontina, and Parmigiano. Spoon the filling into your blind-baked crust. Top with the cheese mixture and tomato slices. Bake in the middle of your oven for 30 minutes. You can serve this warm or at room temperature.