refactor ensure visible + control popup by code + validate add style popup