add preview to pattern edit