Line a 22 x 28cm rectangular cake tin with baking parchment. Heat the oven to 180C/160C fan/gas 4.
First, prepare the topping. Put the milk or dark chocolate pieces in a large heatproof bowl. Heat the double cream in a medium pan until just steaming, then slowly pour over the chocolate, whisking until the chocolate has melted and the mix is smooth. Leave to cool slightly, then chill for 1 hr 30 mins until soft, but still spoonable.
Beat the butter, sugars and ¼ tsp salt together in a stand mixer or using an electric whisk for 5 mins, or until light and fluffy. Add the eggs one at a time, beating well after each addition. Add the desiccated coconut, flour, yogurt and coconut flavouring, if using, and briefly beat until just combined. Spoon the mix into the tin, smooth the surface using the back of a spoon, then bake for 30 mins until golden and firm to the touch. Leave in the tin to cool completely.
When fully cool, spread over the chocolate topping, then drizzle with the white chocolate and scatter over the toasted coconut flakes. Chill for around 15 mins until the topping is set. Cut into 12 squares, then serve.