There are lots of examples of shelves going side to side. We didn't like those because they were over our head when sleeping and felt claustrophobic. Plus, they blocked the light fixture. We designed our shelf differently.
I had to drop the tv mount down in order to get the shelf over the window valence. I simply put a vertical metal plate(approximately 4"x6") on the inside of the wardrobe and ran the bolts through the tv mount, through the hollow wall and through the metal plate on the inside of the wardrobe. I then mounted a horizontal board( 1"x1" ledger) from the solid front corner of the wardrobe to the solid rear corner of the wardrobe cabinetry with screws. The cabinets have solid 1"x1" corners. The forward end support is cut at the appropriate angle of the roof so that the shelf is level over the window valence. I used short moly bolts and glued the support to the ceiling.
It is very sturdy with 3 points of contact/support. However, we unload the shelf for travel-all of the items are placed on the bed. We use various sized plastic bins to hold linens, towels, and clothes on the shelf. The wire shelf came from Home Depot and was cut from a 12" wide closet wire shelf.
Vann