If a worshipper does a deed with the goal of having people see it, and he remains with this evil intention, then his deed is disgraced, and he commits minor shirk, and he runs the risk of it leading him to major shirk.
If the worshipper does a deed intending the Face of Allaah AND with that, he is also intending it for the sight of people - if he does not remove the riyaa' from his deed, then the texts are clear that this deed is also false.
When the worshipper does a deed for the Face of Allaah alone but riyaa' surfaces for an instant during the deed, if he wards it off and purifies his sincerity for Allaah, then there is no harm in that deed.
But if he settles for that - becoming tranquil with it - then the value of the deed diminishes, resulting in a weakening of his faith in proportion to the amount of riya' that survived in his heart. Still, the deed remains for Allaah, but whatever portion of it he mixed up and was confused about is riyaa'.
Riyaa is a dangerous disease which requires the soul to hasten to disciplining itself in sincerity, to wage war in defence against the destruction caused for riyaa', to oppose its assault, seeking Allaah's help to defend against it, so that perhaps Allaah will purify the worshipper's faith and complete his tawheed.