Lots of dispute about that. The Bible does not make it clear.
Today, a few centuries after the invention of privacy and indoor plumbing, it is easy for Westerners to assume that Bathsheba was bathing naked—and, because she was visible, some might argue that she was doing so inappropriately. But what “bathing” means in the world of the biblical story remains unknown. Some think she was taking a ritual bath (Hebrew, mikveh) after her menstrual period (citing 2Sam 11:4), but neither text nor archaeology offer clear support. The KJV more accurately conveys the range of meaning of the original Hebrew: she washed herself, which could mean only hands and feet. Or we might assume that the mention of her beauty implies her nakedness—but why should we assume that?
What does the Bible say? He saw a woman bathing, and she was beautiful.
That actually makes a lot of sense as a woman is going to be most fertile when she ovulates, shortly after her period is over.
I would expect that to be the most likely.
What makes David's betrayal of Uriah worse was that Uriah was one of David's closest, trusted warriors.
He is listed in 1 Chronicles 11 and 2 Samuel 23 with many other of David's mighty men, and the reading of the passages implies that Uriah was one of David's body guards.