Interesting question - as the recent heat wave (which seems here to stay for the whole summer) has had an impact on what would otherwise be considered appropriate dress for restos in Rome.
Just back from Rome and it is a sauna. Since the pandemic, we were told by locals this was the busiest summer yet with more visitors expected throughout August. The city was certainly very busy with crowds of visitors of all ages from all corners of the world with different appreciation of appropriate wear.
Most venues have indoor and al fresco (outdoor) seating. There are also different categories of eateries with varied price points - osteria, trattoria, ristorante, pizzerias. I would say most non-locals were dressed for comfort, trying to manage not overheating, over-sweating, dehydrating while enjoying and taking advantage of the delicious and savory dining/wining the city center has to offer. Most of the restaurants in the city center are geared to accomodate tourists. We ate at a number of "nice" restaurants trying to avoid those that attract the first-time visitors. Unless the question is related to a Michelin-rated or 5* high-end venue, to which the comments offered above would apply, then I would recommend dressing according to your perspective of good taste in consideration of the heat.
Men were in t-shirts, shorts, and ladies on average in the least amount of clothing possible- short-sleeve, sleeveless short or maxi dresses, tops, tanks, some younger set in crop tops, bra tops, and almost all in sandals and summer foot attire.
During out stay, i noticed people everywhere were occupied with eating, drinking, making merry and hoping this would be the start to a return to normal travel rather than formalities & what everyone was wearing, even within the prevailing bella figura standards.