There is, absent environmental or status effects, only one way to lose or gain line of effect on a target: Moving. If you can't see your target in your current spot, you have to Move out of it. The rules in that case are once again unambiguous. Move happened before Attack, so when you make your attack, you're not hidden.
I think much if this argument comes down to how we conceptualize the rules. Personally, I started with 4e, where everything is expressed clearly in terms of pure mechanics. You can make up your own in-fiction explanation for Daily Powers, healing surges, or Minor Actions, but it doesn't really matter. I instinctively read 5e the same way, particularly in combat, which reads a lot like 4e. So when I read, "when you make an attack," I read, more or less, "when you declare you are taking the Attack Action against a valid target," and if there's any question about status effects that affect the d20 rolls, any status in effect when you declare the action applies to the roll unless the rules explicitly state otherwise, as in they literally say, "before you roll the attack."
Seems like others conceptualize things in terms of the in-fiction world, then try to adjudicate how the mechanics apply. We all agree something like this can happen:
The rogue is hidden behind the shrubbery. He spies a Knight of Ni. He draws a bolt from his quiver, slips it into his hand crossbow, and pulls back the cord. There is a click as it notches into place. He peeks out, extends an arm, takes careful aim and pulls the trigger. The crossbow twangs. A bolt flies through the air.
We likewise all agree this causes the rogue to lose his hiding spot. But what causes him to lose his hiding spot? The click? The peek? The aim? The twang? The bolt? And when is the d20 rolled? At the beginning of the sequence? The middle? The end? The fiction-first approach makes this totally ambiguous, because how you narrate affects the mechanics, which is why there's so much argument from that camp.
I argue the fiction-first reading is fundamentally misunderstanding the way mechanics are supposed to apply, and the whole point of the "Unseen attackers" rule is to eliminate precisely this kind of ambiguity (and the writers back me up on this in the podcast). The in-fiction reason the knight notices mechanically irrelevant. You can narrate this however you like. The mechanical reason he notices is the Attack Action. An Attack Action always spoils Hide, and the effect is always applied after a hit or miss is resolved. No need to argue over sufficient degrees of peeking; they don't matter. This is in line with pretty much how every other 5e rule is written, and the general approach taken by Crawford when answering questions.