ronantakizawa/codereview-bench huggingface dataset:
Repository: godotengine/godot
File: editor/scene/scene_tree_editor.cpp (C++)

Code before:
}

String SceneTreeEditor::get_filter() const {
	return filter;
}

String SceneTreeEditor::get_filter_term_warning() {
	return filter_term_warning;
}

void SceneTreeEditor::set_show_all_nodes(bool p_show_all_nodes) {
	show_all_nodes = p_show_all_nodes;
	_update_filter(nullptr, true);
}

void SceneTreeEditor::set_as_scene_tree_dock() {
	is_scene_tree_dock = true;
}

void SceneTreeEditor::set_display_foreign_nodes(bool p_display) {
	display_foreign = p_display;
	_update_tree();
}

void SceneTreeEditor::clear_cache() {
	set_valid_types({});
}

void SceneTreeEditor::set_valid_types(const Vector<StringName> &p_valid) {
	valid_types = p_valid;
	node_cache.force_update = true;
	callable_mp(this, &SceneTreeEditor::_update_tree).call_deferred(false);
	tree_dirty = true;
}

void SceneTreeEditor::set_editor_selection(EditorSelection *p_selection) {
	editor_selection = p_selection;
	tree->set_select_mode(Tree::SELECT_MULTI);
	tree->set_cursor_can_exit_tree(false);
	editor_selection->connect("selection_changed", callable_mp(this, &SceneTreeEditor::_selection_changed));
}

void SceneTreeEditor::_update_selection(TreeItem *item) {
	ERR_FAIL_NULL(item);

	NodePath np = item->get_metadata(0);

	if (!has_node(np)) {
		return;
	}


Review comment (bug):
That's wrong. It should be
```C++
node_cache.force_update = true;
callable_mp(this, &SceneTreeEditor::_update_tree).call_deferred(false);
tree_dirty = true;
```
And then you can call it in `set_valid_types()`.

Code after:
}

String SceneTreeEditor::get_filter() const {
	return filter;
}

String SceneTreeEditor::get_filter_term_warning() {
	return filter_term_warning;
}

void SceneTreeEditor::set_show_all_nodes(bool p_show_all_nodes) {
	show_all_nodes = p_show_all_nodes;
	_update_filter(nullptr, true);
}

void SceneTreeEditor::set_as_scene_tree_dock() {
	is_scene_tree_dock = true;
}

void SceneTreeEditor::set_display_foreign_nodes(bool p_display) {
	display_foreign = p_display;
	_update_tree();
}

void SceneTreeEditor::clear_cache() {
	node_cache.force_update = true;
	callable_mp(this, &SceneTreeEditor::_update_tree).call_deferred(false);
	tree_dirty = true;
}

void SceneTreeEditor::set_valid_types(const Vector<StringName> &p_valid) {
	valid_types = p_valid;
	clear_cache();
}

void SceneTreeEditor::set_editor_selection(EditorSelection *p_selection) {
	editor_selection = p_selection;
	tree->set_select_mode(Tree::SELECT_MULTI);
	tree->set_cursor_can_exit_tree(false);
	editor_selection->connect("selection_changed", callable_mp(this, &SceneTreeEditor::_selection_changed));
}

void SceneTreeEditor::_update_selection(TreeItem *item) {
	ERR_FAIL_NULL(item);

	NodePath np = item->get_metadata(0);

	if (!has_node(np)) {
		return;
	}
Repository: godotengine/godot
File: scene/gui/file_dialog.h (C/C++)

Code before:
		CUSTOMIZATION_CREATE_FOLDER,
		CUSTOMIZATION_FILE_FILTER,
		CUSTOMIZATION_FILE_SORT,
		CUSTOMIZATION_FAVORITES,
		CUSTOMIZATION_RECENT,
		CUSTOMIZATION_LAYOUT,
		CUSTOMIZATION_MAX
	};

	typedef void (*RegisterFunc)(FileDialog *);

	inline static Callable get_icon_callback;
	inline static Callable get_thumbnail_callback;

	inline static RegisterFunc register_func = nullptr;
	inline static RegisterFunc unregister_func = nullptr;

private:
	static inline PropertyListHelper base_property_helper;
	PropertyListHelper property_helper;

	inline static bool default_show_hidden_files = false;
	static inline DisplayMode default_display_mode = DISPLAY_THUMBNAILS;
	bool show_hidden_files = false;
	bool use_native_dialog = false;
	bool disable_overwrite_warning = false;
	bool customization_flags[CUSTOMIZATION_MAX]; // Initialized to true in the constructor.

	inline static LocalVector<String> global_favorites;
	inline static LocalVector<String> global_recents;

	Access access = ACCESS_RESOURCES;
	FileMode mode = FILE_MODE_SAVE_FILE;
	DisplayMode display_mode = DISPLAY_THUMBNAILS;
	FileSortOption file_sort = FileSortOption::NAME;
	Ref<DirAccess> dir_access;

	Vector<String> filters;
	Vector<String> processed_filters;

	Vector<Option> options;
	Dictionary selected_options;
	bool options_dirty = false;

	String file_name_filter;
	bool show_filename_filter = false;

	Vector<String> local_history;
	int local_history_pos = 0;

	bool mode_overrides_title = true;

Review comment (suggestion):
I wonder if this could be a positive instead? As in `show_overwrite_warning`. Just a nitpick, not a fan of negative booleans.

Code after:
		CUSTOMIZATION_CREATE_FOLDER,
		CUSTOMIZATION_FILE_FILTER,
		CUSTOMIZATION_FILE_SORT,
		CUSTOMIZATION_FAVORITES,
		CUSTOMIZATION_RECENT,
		CUSTOMIZATION_LAYOUT,
		CUSTOMIZATION_OVERWRITE_WARNING,
		CUSTOMIZATION_MAX
	};

	typedef void (*RegisterFunc)(FileDialog *);

	inline static Callable get_icon_callback;
	inline static Callable get_thumbnail_callback;

	inline static RegisterFunc register_func = nullptr;
	inline static RegisterFunc unregister_func = nullptr;

private:
	static inline PropertyListHelper base_property_helper;
	PropertyListHelper property_helper;

	inline static bool default_show_hidden_files = false;
	static inline DisplayMode default_display_mode = DISPLAY_THUMBNAILS;
	bool show_hidden_files = false;
	bool use_native_dialog = false;
	bool customization_flags[CUSTOMIZATION_MAX]; // Initialized to true in the constructor.

	inline static LocalVector<String> global_favorites;
	inline static LocalVector<String> global_recents;

	Access access = ACCESS_RESOURCES;
	FileMode mode = FILE_MODE_SAVE_FILE;
	DisplayMode display_mode = DISPLAY_THUMBNAILS;
	FileSortOption file_sort = FileSortOption::NAME;
	Ref<DirAccess> dir_access;

	Vector<String> filters;
	Vector<String> processed_filters;

	Vector<Option> options;
	Dictionary selected_options;
	bool options_dirty = false;

	String file_name_filter;
	bool show_filename_filter = false;

	Vector<String> local_history;
	int local_history_pos = 0;

	bool mode_overrides_title = true;
Repository: godotengine/godot
File: core/typedefs.h (C/C++)

Code before:
constexpr const T SIGN(const T m_v) {
	return m_v > 0 ? +1.0f : (m_v < 0 ? -1.0f : 0.0f);
}

template <typename T, typename T2>
constexpr auto MIN(const T m_a, const T2 m_b) {
	return m_a < m_b ? m_a : m_b;
}

template <typename T, typename T2>
constexpr auto MAX(const T m_a, const T2 m_b) {
	return m_a > m_b ? m_a : m_b;
}

template <typename T, typename T2, typename T3>
constexpr auto CLAMP(const T m_a, const T2 m_min, const T3 m_max) {
	return m_a < m_min ? m_min : (m_a > m_max ? m_max : m_a);
}

// Generic swap template.
#ifndef SWAP
#define SWAP(m_x, m_y) std::swap((m_x), (m_y))
#endif // SWAP

// Like std::size, but without requiring any additional includes.
template <class T, size_t SIZE>
constexpr size_t std_size(const T (&)[SIZE]) {
	return SIZE;
}

/* Functions to handle powers of 2 and shifting. */

// Returns `true` if a positive integer is a power of 2, `false` otherwise.
template <typename T>
inline bool is_power_of_2(const T x) {
	return x && ((x & (x - 1)) == 0);
}

// Function to find the next power of 2 to an integer.
constexpr uint64_t next_power_of_2(uint64_t p_number) {
	if (p_number == 0) {
		return 0;
	}

	--p_number;
	p_number |= p_number >> 1;
	p_number |= p_number >> 2;
	p_number |= p_number >> 4;
	p_number |= p_number >> 8;
	p_number |= p_number >> 16;
	p_number |= p_number >> 32;

Review comment (suggestion):
Something we need to get better at enforcing: use `typename` over `class`.
```suggestion
template <typename T, size_t SIZE>
```

Code after:
constexpr const T SIGN(const T m_v) {
	return m_v > 0 ? +1.0f : (m_v < 0 ? -1.0f : 0.0f);
}

template <typename T, typename T2>
constexpr auto MIN(const T m_a, const T2 m_b) {
	return m_a < m_b ? m_a : m_b;
}

template <typename T, typename T2>
constexpr auto MAX(const T m_a, const T2 m_b) {
	return m_a > m_b ? m_a : m_b;
}

template <typename T, typename T2, typename T3>
constexpr auto CLAMP(const T m_a, const T2 m_min, const T3 m_max) {
	return m_a < m_min ? m_min : (m_a > m_max ? m_max : m_a);
}

// Generic swap template.
#ifndef SWAP
#define SWAP(m_x, m_y) std::swap((m_x), (m_y))
#endif // SWAP

// Like std::size, but without requiring any additional includes.
template <typename T, size_t SIZE>
constexpr size_t std_size(const T (&)[SIZE]) {
	return SIZE;
}

/* Functions to handle powers of 2 and shifting. */

// Returns `true` if a positive integer is a power of 2, `false` otherwise.
template <typename T>
inline bool is_power_of_2(const T x) {
	return x && ((x & (x - 1)) == 0);
}

// Function to find the next power of 2 to an integer.
constexpr uint64_t next_power_of_2(uint64_t p_number) {
	if (p_number == 0) {
		return 0;
	}

	--p_number;
	p_number |= p_number >> 1;
	p_number |= p_number >> 2;
	p_number |= p_number >> 4;
	p_number |= p_number >> 8;
	p_number |= p_number >> 16;
	p_number |= p_number >> 32;
Repository: godotengine/godot
File: platform/android/java/editor/src/main/java/org/godotengine/editor/BaseGodotEditor.kt (Kotlin)

Code before:
	}

	override fun reset3DCamera() {
		godot?.runOnRenderThread {
			GameMenuUtils.resetCamera3DPosition()
		}
	}

	override fun manipulateCamera(mode: GameMenuFragment.GameMenuListener.CameraMode) {
		gameMenuState.putSerializable(GAME_MENU_ACTION_SET_CAMERA_MANIPULATE_MODE, mode)
		godot?.runOnRenderThread {
			GameMenuUtils.setCameraManipulateMode(mode.ordinal)
		}
	}

	override fun muteAudio(enabled: Boolean) {
		gameMenuState.putBoolean(GAME_MENU_ACTION_SET_DEBUG_MUTE_AUDIO, enabled)
		godot?.runOnRenderThread {
			GameMenuUtils.setDebugMuteAudio(enabled)
		}
	}

	override fun resetTimeScale() {
		godot?.runOnRenderThread {
			GameMenuUtils.resetTimeScale()
		}
	}

	override fun setTimeScale(scale: Double) {
		gameMenuState.putDouble(GAME_MENU_ACTION_SET_TIME_SCALE, scale)
		godot?.runOnRenderThread {
			GameMenuUtils.setTimeScale(scale)
		}
	}

	override fun embedGameOnPlay(embedded: Boolean) {
		gameMenuState.putBoolean(GAME_MENU_ACTION_EMBED_GAME_ON_PLAY, embedded)
		godot?.runOnRenderThread {
			val gameEmbedMode = if (embedded) GameEmbedMode.ENABLED else GameEmbedMode.DISABLED
			GameMenuUtils.saveGameEmbedMode(gameEmbedMode)
		}
	}

	override fun isGameEmbeddingSupported() = !isNativeXRDevice(applicationContext)
}


Review comment (suggestion):
The `gameMenuState` should also be updated:
```
gameMenuState.putDouble(GAME_MENU_ACTION_SET_TIME_SCALE, 1.0f)
```

Code after:
	}

	override fun reset3DCamera() {
		godot?.runOnRenderThread {
			GameMenuUtils.resetCamera3DPosition()
		}
	}

	override fun manipulateCamera(mode: GameMenuFragment.GameMenuListener.CameraMode) {
		gameMenuState.putSerializable(GAME_MENU_ACTION_SET_CAMERA_MANIPULATE_MODE, mode)
		godot?.runOnRenderThread {
			GameMenuUtils.setCameraManipulateMode(mode.ordinal)
		}
	}

	override fun muteAudio(enabled: Boolean) {
		gameMenuState.putBoolean(GAME_MENU_ACTION_SET_DEBUG_MUTE_AUDIO, enabled)
		godot?.runOnRenderThread {
			GameMenuUtils.setDebugMuteAudio(enabled)
		}
	}

	override fun resetTimeScale() {
		gameMenuState.putDouble(GAME_MENU_ACTION_SET_TIME_SCALE, 1.0)
		godot?.runOnRenderThread {
			GameMenuUtils.resetTimeScale()
		}
	}

	override fun setTimeScale(scale: Double) {
		gameMenuState.putDouble(GAME_MENU_ACTION_SET_TIME_SCALE, scale)
		godot?.runOnRenderThread {
			GameMenuUtils.setTimeScale(scale)
		}
	}

	override fun embedGameOnPlay(embedded: Boolean) {
		gameMenuState.putBoolean(GAME_MENU_ACTION_EMBED_GAME_ON_PLAY, embedded)
		godot?.runOnRenderThread {
			val gameEmbedMode = if (embedded) GameEmbedMode.ENABLED else GameEmbedMode.DISABLED
			GameMenuUtils.saveGameEmbedMode(gameEmbedMode)
		}
	}

	override fun isGameEmbeddingSupported() = !isNativeXRDevice(applicationContext)
}
Repository: godotengine/godot
File: editor/scene/canvas_item_editor_plugin.cpp (C++)

Code before:
			accepted = false;
		}
	}

	accepted = (_gui_input_zoom_or_pan(p_event, accepted) || accepted);

	if (accepted) {
		accept_event();
	}

	// Handles the mouse hovering
	_gui_input_hover(p_event);

	if (mb.is_valid()) {
		// Update the default cursor.
		_update_cursor();
	}

	// Grab focus
	if (!viewport->has_focus() && (!get_viewport()->gui_get_focus_owner() || !get_viewport()->gui_get_focus_owner()->is_text_field())) {
		callable_mp((Control *)viewport, &Control::grab_focus).call_deferred(false);
	}
}

void CanvasItemEditor::_commit_drag() {
	if (drag_selection.size() == 0) {
		return;
	}

	switch (drag_type) {
		// Confirm the pivot move.
		case DRAG_PIVOT: {
			_commit_canvas_item_state(
					drag_selection,
					vformat(
							TTR("Set CanvasItem \"%s\" Pivot Offset to (%d, %d)"),
							drag_selection.front()->get()->get_name(),
							drag_selection.front()->get()->_edit_get_pivot().x,
							drag_selection.front()->get()->_edit_get_pivot().y));
		} break;

		// Confirm the node rotation.
		case DRAG_ROTATE: {
			if (drag_selection.size() != 1) {
				_commit_canvas_item_state(
						drag_selection,
						vformat(TTR("Rotate %d CanvasItems"), drag_selection.size()),
						true);
			} else {
				_commit_canvas_item_state(
						drag_selection,

Review comment (suggestion):
```suggestion
	if (drag_selection.is_empty()) {
```

Code after:
			accepted = false;
		}
	}

	accepted = (_gui_input_zoom_or_pan(p_event, accepted) || accepted);

	if (accepted) {
		accept_event();
	}

	// Handles the mouse hovering
	_gui_input_hover(p_event);

	if (mb.is_valid()) {
		// Update the default cursor.
		_update_cursor();
	}

	// Grab focus
	if (!viewport->has_focus() && (!get_viewport()->gui_get_focus_owner() || !get_viewport()->gui_get_focus_owner()->is_text_field())) {
		callable_mp((Control *)viewport, &Control::grab_focus).call_deferred(false);
	}
}

void CanvasItemEditor::_commit_drag() {
	if (drag_selection.is_empty()) {
		return;
	}

	switch (drag_type) {
		// Confirm the pivot move.
		case DRAG_PIVOT: {
			_commit_canvas_item_state(
					drag_selection,
					vformat(
							TTR("Set CanvasItem \"%s\" Pivot Offset to (%d, %d)"),
							drag_selection.front()->get()->get_name(),
							drag_selection.front()->get()->_edit_get_pivot().x,
							drag_selection.front()->get()->_edit_get_pivot().y));
		} break;

		// Confirm the node rotation.
		case DRAG_ROTATE: {
			if (drag_selection.size() != 1) {
				_commit_canvas_item_state(
						drag_selection,
						vformat(TTR("Rotate %d CanvasItems"), drag_selection.size()),
						true);
			} else {
				_commit_canvas_item_state(
						drag_selection,
Repository: godotengine/godot
File: editor/inspector/editor_inspector.h (C/C++)

Code before:

public:
	virtual Size2 get_minimum_size() const override;
	virtual Control *make_custom_tooltip(const String &p_text) const override;

	void setup(const String &p_inspector_path, const String &p_section, const String &p_label, Object *p_object, const Color &p_bg_color, bool p_foldable, int p_indent_depth = 0, int p_level = 1);
	String get_section() const;
	String get_label() const { return label; }
	String get_inspector_path() const { return inspector_path; }
	VBoxContainer *get_vbox();
	void unfold();
	void fold();
	void set_bg_color(const Color &p_bg_color);
	void reset_timer();
	void set_checkable(const String &p_related_check_property, bool p_checkbox_only, bool p_checked);
	inline bool is_checkable() const { return checkable; }
	void set_checked(bool p_checked);
	void set_keying(bool p_keying);

	bool has_revertable_properties() const;
	void property_can_revert_changed(const String &p_path, bool p_can_revert);
	void _property_edited(const String &p_property);
	void update_property();

	void _update_popup();
	void _collect_properties(Vector<String> &p_properties) const;
	void menu_option(int p_option);

	EditorInspectorSection();
	~EditorInspectorSection();
};

class ArrayPanelContainer : public PanelContainer {
	GDCLASS(ArrayPanelContainer, PanelContainer);

protected:
	void _notification(int p_what);

	void _accessibility_action_menu(const Variant &p_data);

public:
	ArrayPanelContainer();
};

class EditorInspectorArray : public EditorInspectorSection {
	GDCLASS(EditorInspectorArray, EditorInspectorSection);

	enum Mode {
		MODE_NONE,
		MODE_USE_COUNT_PROPERTY,
		MODE_USE_MOVE_ARRAY_ELEMENT_FUNCTION,

Review comment (performance):
```suggestion
	void _collect_properties(LocalVector<String> &r_properties) const;
```
Better performance when sharing isn't necessary 

Code after:
	Rect2 keying_rect;
	bool keying_hover = false;
	bool header_hover = false;

	bool checkbox_only = false;

	PopupMenu *menu = nullptr;

	HashSet<StringName> revertable_properties;

	void _test_unfold();
	int _get_header_height();
	Ref<Texture2D> _get_arrow();
	Ref<Texture2D> _get_checkbox();

	EditorInspector *_get_parent_inspector() const;

	struct ThemeCache {
		int horizontal_separation = 0;
		int vertical_separation = 0;
		int inspector_margin = 0;
		int indent_size = 0;
		int key_padding_size = 0;

		Color warning_color;
		Color prop_subsection;
		Color font_color;
		Color font_disabled_color;
		Color font_hover_color;
		Color font_pressed_color;
		Color font_hover_pressed_color;
		Color font_hover_mono_color;

		Ref<Font> font;
		int font_size = 0;
		Ref<Font> bold_font;
		int bold_font_size = 0;
		Ref<Font> light_font;
		int light_font_size = 0;

		Ref<Texture2D> arrow;
		Ref<Texture2D> arrow_collapsed;
		Ref<Texture2D> arrow_collapsed_mirrored;
		Ref<Texture2D> icon_gui_checked;
		Ref<Texture2D> icon_gui_unchecked;
		Ref<Texture2D> icon_gui_animation_key;
		Ref<Texture2D> icon_copy;
		Ref<Texture2D> icon_paste;

		Ref<StyleBoxFlat> indent_box;
		Ref<StyleBoxFlat> key_hover;
Repository: godotengine/godot
File: editor/inspector/editor_inspector.cpp (C++)

Code before:
			if (current_category.ends_with(".gd")) {
				String section_path = inspector_path;
				section_path = section_path.replace(section_path.split("/")[0] + "/", "");
				if (!current_group.begins_with(section_path)) {
					continue;
				}
			} else {
				continue;
			}
		}

		p_properties.push_back(prop_info.name);
	}
}

void EditorInspectorSection::menu_option(int p_option) {
	switch (p_option) {
		case MENU_COPY_VALUE: {
			Vector<String> properties;
			Dictionary clipboard;
			_collect_properties(properties);

			print_line("Group path: " + get_inspector_path());

			clipboard["group_name"] = section;
			for (String property_name : properties) {
				clipboard[property_name] = object->get(property_name);
			}
			InspectorDock::get_inspector_singleton()->set_property_clipboard(clipboard);
		} break;
		case MENU_PASTE_VALUE: {
			Dictionary clipboard = InspectorDock::get_inspector_singleton()->get_property_clipboard();
			String group_name = clipboard["group_name"];
			String action_name = "Set group " + group_name;

			EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
			undo_redo->create_action(action_name);

			for (String property_name : clipboard.keys()) {
				Variant value = clipboard[property_name];
				undo_redo->add_do_property(object, property_name, value);
				undo_redo->add_undo_property(object, property_name, object->get(property_name));
			}

			undo_redo->commit_action();
		} break;
	}
}

void EditorInspectorSection::_bind_methods() {
	ClassDB::bind_method(D_METHOD("setup", "section", "label", "object", "bg_color", "foldable", "indent_depth", "level"), &EditorInspectorSection::setup, DEFVAL(0), DEFVAL(1));

Review comment (suggestion):
```suggestion
			for (const String &property_name : properties) {
```

Code after:
	} else if (mb.is_valid() && !mb->is_pressed()) {
		queue_redraw();
	}
}

String EditorInspectorSection::get_section() const {
	return section;
}

VBoxContainer *EditorInspectorSection::get_vbox() {
	return vbox;
}

void EditorInspectorSection::_accessibility_action_collapse(const Variant &p_data) {
	fold();
}

void EditorInspectorSection::_accessibility_action_expand(const Variant &p_data) {
	unfold();
}

void EditorInspectorSection::unfold() {
	if ((!foldable && !checkable) || (!checkbox_only && checkable && !checked)) {
		return;
	}

	_test_unfold();

	if (foldable) {
		object->editor_set_section_unfold(section, true);
	}

	vbox->show();
	queue_redraw();
}

void EditorInspectorSection::fold() {
	if (!foldable || !vbox_added) {
		return;
	}

	object->editor_set_section_unfold(section, false);
	vbox->hide();
	queue_redraw();
}

void EditorInspectorSection::set_bg_color(const Color &p_bg_color) {
	bg_color = p_bg_color;
	queue_redraw();
}
Repository: godotengine/godot
File: editor/inspector/editor_inspector.cpp (C++)

Code before:
}

void EditorInspectorSection::_collect_properties(Vector<String> &p_properties) const {
	List<PropertyInfo> property_list;
	object->get_property_list(&property_list, true);

	String current_category = "";
	String current_group = "";
	for (const PropertyInfo &prop_info : property_list) {
		if (prop_info.usage & PROPERTY_USAGE_GROUP) {
			current_group = prop_info.name;
			continue;
		}
		if (prop_info.usage & PROPERTY_USAGE_CATEGORY) {
			current_category = prop_info.name;
			current_group = "";

			continue;
		}
		if (!(prop_info.usage & PROPERTY_USAGE_EDITOR)) {
			continue;
		}
		if (!(current_category + "/" + current_group).begins_with(get_inspector_path())) {
			if (current_category.ends_with(".gd")) {
				String section_path = inspector_path;
				section_path = section_path.replace(section_path.split("/")[0] + "/", "");
				if (!current_group.begins_with(section_path)) {
					continue;
				}
			} else {
				continue;
			}
		}

		p_properties.push_back(prop_info.name);
	}
}

void EditorInspectorSection::menu_option(int p_option) {
	switch (p_option) {
		case MENU_COPY_VALUE: {
			Vector<String> properties;
			Dictionary clipboard;
			_collect_properties(properties);

			print_line("Group path: " + get_inspector_path());

			clipboard["group_name"] = section;
			for (String property_name : properties) {
				clipboard[property_name] = object->get(property_name);
			}

Review comment (suggestion):
```suggestion
				section_path = section_path.replace(section_path.get_slicec('/', 0) + "/", "");
```

Code after:
			checked = !checked;
			emit_signal(SNAME("section_toggled_by_user"), related_enable_property, checked);
			if (checked) {
				unfold();
			} else if (!checkbox_only) {
				vbox->hide();
			}
		} else if (keying && keying_rect.has_point(pos)) {
			emit_signal(SNAME("property_keyed"), related_enable_property, false);
		} else if (foldable) {
			bool should_unfold = can_click_unfold && !object->editor_is_section_unfolded(section);
			if (should_unfold) {
				unfold();
			} else {
				fold();
			}
		}
	} else if ((!checkable || checked) && !inspector_path.is_empty() && mb.is_valid() && mb->is_pressed() && mb->get_button_index() == MouseButton::RIGHT) {
		accept_event();
		_update_popup();
		menu->set_position(get_screen_position() + get_local_mouse_position());
		menu->reset_size();
		menu->popup();
	} else if (mb.is_valid() && !mb->is_pressed()) {
		queue_redraw();
	}
}

String EditorInspectorSection::get_section() const {
	return section;
}

VBoxContainer *EditorInspectorSection::get_vbox() {
	return vbox;
}

void EditorInspectorSection::_accessibility_action_collapse(const Variant &p_data) {
	fold();
}

void EditorInspectorSection::_accessibility_action_expand(const Variant &p_data) {
	unfold();
}

void EditorInspectorSection::unfold() {
	if ((!foldable && !checkable) || (!checkbox_only && checkable && !checked)) {
		return;
	}

	_test_unfold();