command/views: Announce individual refreshes only if they are slow
Previously we would proactively announce refreshing every individual object tracked in the state, which can get pretty noisy for larger configurations whose states are tracking lots of objects.
Now we'll try to emit only one line about the entire refresh operation, and show individual notifications only if one particular action takes a long time.
The idea here to strike a compromise where we're less chatty in the happy case but where users can still get some feedback if they are accessing something that is e.g. down and taking a long time to respond, or is just generally always slow.
For the moment this focuses only on managed resource refreshing notifications. Although there is some logic in here to handle data resources for robustness, in practice Terraform Core uses plan and apply events to describe reading from data resources, because we model those as plannable side-effects, and so those will continue to report through the existing PreApply/PostApply events which therefore remain chatty for now. A future commit might quiet those when they are fast too, depending on what we learn from trying this compromise for managed resources first.
I see that one of the tests for terraform refresh is relying on the noisy output as its only signal for exactly which resource instances got refreshed, so if we decide to move forward with this I'll need to rework that to instrument one layer deeper below the UI. I'll hold on that until it feels more certain that this is the best path forward though, since it looks like it'll be a relatively complex restructuring of that test.
It could perhaps also be argued that terraform refresh and refresh-only plans should still produce the old verbose output anyway because refreshing is the main point of those, inlike for normal planning. We'll see how that goes after some further discussion.
This PR has rotted, and so if someone wants to work on something like this in future then it might be useful as a starting reference but can't be merged as-is.