-
Notifications
You must be signed in to change notification settings - Fork 7
Fix changelog display in About window #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughChanges fix the changelog display issue in the About window by switching the trigger signal from Changes
Sequence Diagram(s)sequenceDiagram
rect rgb(230, 240, 250)
Note over About: Old Flow (Broken)
About->>About: about_to_popup signal<br/>(not emitted)
About--xchange_log.gd: _on_about_about_to_popup()<br/>(never called)
end
rect rgb(240, 250, 240)
Note over About: New Flow (Fixed)
User->>About: Open About window
About->>About: visibility_changed signal
About->>change_log.gd: _on_about_visibility_changed()
change_log.gd->>change_log.gd: Read CHANGELOG.md
change_log.gd->>change_log.gd: Convert markdown to BBCode
change_log.gd->>TabContainer: Display in Changelog tab
end
Pre-merge checks and finishing touches✅ Passed checks (5 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
core/scripts/change_log.gd (1)
62-65: Consider adding a visibility check to avoid redundant processing.The
visibility_changedsignal fires when the About window is both shown and hidden. Currently, the markdown conversion runs in both cases, which wastes CPU cycles when closing the window (though the impact is minimal at ≤0.3ms).Apply this diff to skip conversion when the window is closing:
func _on_about_visibility_changed() -> void: + # Only convert when the About window becomes visible, not when it hides + var about_window = get_parent().get_parent() # Navigate to About window + if not about_window.visible: + return var markdown_text := FileAccess.get_file_as_string(S.globalize_path("res://CHANGELOG.md")) var bbcode_text := _convert_text_from_markdown_to_bbcode_style(markdown_text) text = bbcode_text
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
CHANGELOG.md(1 hunks)core/main.tscn(1 hunks)core/scripts/change_log.gd(1 hunks)
🔇 Additional comments (2)
CHANGELOG.md (1)
8-12: LGTM! Changelog entry correctly documents the fix.The unreleased section and Fixed entry follow the established format and properly reference PR #133.
core/main.tscn (1)
500-500: Correct fix:visibility_changedis the appropriate signal for Window nodes.The switch from
about_to_popuptovisibility_changedproperly addresses the root cause. Theabout_to_popupsignal is specific to Popup nodes and isn't available on Window nodes (whichAboutis, as defined on line 402). Thevisibility_changedsignal correctly fires when the About window's visibility changes.
Type of Change
Description
Fixes #132 with use
visibility_changedinstead ofabout_to_popupsignal.Testing
Works fine.
Impact
A small freeze during conversion, this is the same as the original implementation (less than 0.3ms) and is moved to the opening time of the window instead of app startup. (See #83 for more information)
Additional Information
Nothing
Checklist
Summary by CodeRabbit
Bug Fixes
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.