Conversation
WalkthroughThe PR refactors the ScriptEditor UI by removing the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@editor/script/script_editor_plugin.cpp`:
- Around line 2016-2017: Move the script_name_label update out of the list-click
path and into the centralized current-tab refresh flow: remove the set_text call
after _go_to_tab and instead update script_name_label inside the same code that
handles current-tab changes (e.g., _script_selected or the function that
_go_to_tab ultimately triggers), using script_list->get_item_text(p_idx) when a
tab is selected and explicitly clear script_name_label (set to empty) when no
tab is selected (e.g., after _update_script_names rebuilds the list and
selection is invalid); ensure any metadata-driven behavior still uses
script_list->get_item_metadata(p_idx) as before.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4d614f38-8d60-450f-8248-1ad466d91297
📒 Files selected for processing (2)
editor/script/script_editor_plugin.cppeditor/script/script_editor_plugin.h
💤 Files with no reviewable changes (1)
- editor/script/script_editor_plugin.h
| _go_to_tab(script_list->get_item_metadata(p_idx)); | ||
| script_name_label->set_text(script_list->get_item_text(p_idx)); |
There was a problem hiding this comment.
Keep script_name_label driven by the current-tab refresh path.
Line 2017 only updates the header for list-click selection. With the old centralized filename updates removed, the label can now drift stale in states that don't pass through _script_selected()—most visibly after the last tab is closed, since _update_script_names() rebuilds the list but never clears the label when it becomes empty. I'd keep this label update centralized in the same path that handles current-tab changes and explicitly reset it when no tab is selected.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@editor/script/script_editor_plugin.cpp` around lines 2016 - 2017, Move the
script_name_label update out of the list-click path and into the centralized
current-tab refresh flow: remove the set_text call after _go_to_tab and instead
update script_name_label inside the same code that handles current-tab changes
(e.g., _script_selected or the function that _go_to_tab ultimately triggers),
using script_list->get_item_text(p_idx) when a tab is selected and explicitly
clear script_name_label (set to empty) when no tab is selected (e.g., after
_update_script_names rebuilds the list and selection is invalid); ensure any
metadata-driven behavior still uses script_list->get_item_metadata(p_idx) as
before.
|
@AR-DEV-1 I apologize for the delay in testing this, but I think this might need some more modifications to work properly with Redot. |
Aight, I'll look into it later since I'm a bit busy. |



TL;DR
PR in work:

Note
Contributed by 2LazyDevs.
Summary by CodeRabbit