A locked/barricaded door translates to "do not enter" to most normal people.
Breaking out the window to circumvent the lock involves assuming the risk that something bad could happen to you for proceeding into an area where measures were taken to keep people out (yes, that means you too).
The firearm was visible for a lot longer than most here would have you believe. She could have indicated to the officer that she was backing down and ceased trying to breach that door by going through the window but I suspect that the officer was thinking the floodgates were really close to being opened up at which point there would be total chaos if that mob made its way in the Speak's Lobby. As it played out it, it was only necessary for them to shoot one person, after which no one else tried coming that window. Threat eliminated, as trained.
Ashley B had NO BUSINESS being there in the Capital that day. doing what she was doing. To you hear you all tell it, it was like she was sitting at a bus stop, minding her own business, when the cops rolled up on her and shot her without warning for no reason.
That officer was under no obligation to give a verbal warning considering the circumstances and what that mob was trying to do. which was make its way to the Congressional members who were sheltering in place in the Speaker's lobby where they had fled in fear for their very lives. THAT is why her shooting was determined to be lawful because those officers were defending those members of Congress who had retreated as far as they could and nowhere else left to go.