diff --git a/tests/fur_pattern_validation.gd b/tests/fur_pattern_validation.gd index 135c507..2ba3c6e 100644 --- a/tests/fur_pattern_validation.gd +++ b/tests/fur_pattern_validation.gd @@ -384,6 +384,19 @@ func _validate_fur_color_ui(snapshot: Dictionary) -> void: "panel" ) as StyleBoxFlat assert(first_swatch_style.bg_color.is_equal_approx(live_custom_color)) + picker_popup.popup_centered() + for _frame: int in 2: + await process_frame + picker_popup.hide() + for _frame: int in 3: + await process_frame + assert(is_instance_valid(picker)) + assert(picker.is_inside_tree()) + assert( + profile_page.find_child( + "FurCustomColorPicker", true, false + ) == picker + ) profile_page.free() await process_frame diff --git a/ui/profile_page.gd b/ui/profile_page.gd index ebfdb99..e8d7257 100644 --- a/ui/profile_page.gd +++ b/ui/profile_page.gd @@ -1616,7 +1616,9 @@ func _build_fur_palette( custom_picker.color_changed.connect( _select_custom_fur_color.bind(category_id) ) - custom_picker.popup_closed.connect(_refresh_options) + # Custom colors update the channel, preview, and actions live. Rebuilding the + # option tree from popup_closed destroys this button and its native popup + # while Godot is still dispatching the hide operation, which can crash. UtilityPageStyle.apply_compact_ocean_button(custom_picker) _round_fur_color_picker_button(custom_picker) _theme_fur_color_picker_popup(custom_picker)