Merge "Update popup and arrow positioning logic" into main