Clean up naming & optimize theme#1288
Conversation
…ror on changing theme)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughReplaces hardcoded text editor theme names and interface/spacing preset ChangesEditor theme table-driven refactor and partial regeneration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ 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: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@editor/settings/editor_settings.cpp`:
- Around line 1795-1809: The reserved-name validation message is outdated
relative to is_default_text_editor_theme() and the BUILTIN_TEXT_EDITOR_THEMES
list, which now also treats “Godot” as reserved. Update the error text in
editor/script/script_editor_plugin.cpp to list all current builtin text editor
theme names that cannot be used, so saving or importing Godot.tet shows the
correct restriction.
In `@editor/themes/editor_theme_manager.cpp`:
- Around line 223-253: Broaden the text-editor theme regeneration check so
_populate_text_editor_styles() runs whenever its inputs change, not only when
outdated_subsystems.text_editor_styles is set. Update regen_text_editor in
EditorThemeManager::generate_theme (or the surrounding regeneration logic) to
also consider interface-theme-derived p_config changes such as UI theme, font,
and icon updates, since this method is responsible for rebinding CodeEdit fonts
and icons and can otherwise leave stale merged editor references behind.
🪄 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: 17bfc1f6-e8dc-4ba4-9c44-3780fae8c29a
📒 Files selected for processing (4)
editor/settings/editor_settings.cppeditor/settings/editor_settings.heditor/themes/editor_theme_manager.cppeditor/themes/editor_theme_manager.h
|
@Shakai-Dev This is a bug fix for that error message, and the one CodeRabbit actually called out 😋 that might solve the issue I referred to. I'll fix that as soon as I can and squash it in here. |
text to outdated interface theme.
|
Ok, this is updated to address the hare's rather good points. If this is good to merge, I'd recommend we ask the OP of #668 to test for the behavior whenever it gets into a release. |
This is sorta basic, but when switching to at least one of the themes, we'd get this error:
This is because one of the theme names was left out of the logic, and they were just hard-coded strings.
This PR fixes that bug and puts them in objects so it's not so fragile (basically, puts the actual theme names in 1 place), and addresses a couple of the todos that were in there.
#668 - I'm not sure if this issue is caused by the same thing, perhaps the text theme not switching correctly if the error was thrown, but I'm mentioning it here since it's in the same ballpark.
Summary by CodeRabbit
.tetthemes.