-
Notifications
You must be signed in to change notification settings - Fork 1
Release 0.12.0 #21
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
Release 0.12.0 #21
Conversation
- Added *InteractableTextView* script to allow linking text code execution, e.g open URLs in the broser **Changed**: - Renamed *AdjustScreenSizeFitter* to *AdjustScreenSizeFitterView* to mark it as a View in the architecture conventions - Moved *AdjustScreenSizeFitterView* and *NonDrawingView*, *SafeAreaHelperView* to the Views folder and namespace to organize the codebase accordingly
📝 WalkthroughWalkthroughThis pull request introduces version 0.12.0 of the UiService package, focusing on code organization and adding a new interactive text functionality. The changes include relocating several view-related classes to a dedicated Views namespace, renaming Changes
Sequence DiagramsequenceDiagram
participant User
participant InteractableTextView
participant TMP_Text
participant UnityEvent
User->>InteractableTextView: Click on text
InteractableTextView->>TMP_Text: Find link info
TMP_Text-->>InteractableTextView: Return link details
InteractableTextView->>UnityEvent: Trigger OnLinkedInfoClicked
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 0
🧹 Nitpick comments (3)
Runtime/Views/InteractableTextView.cs (2)
15-25: Consider adding XML documentation for enum values.While the class has documentation, the InteractableTextType enum values could benefit from XML documentation explaining when to use each mode.
public enum InteractableTextType { + /// <summary> + /// Detects links that directly intersect with the click position + /// </summary> IntersectingLink, + /// <summary> + /// Detects the closest link to the click position + /// </summary> NearestLink }
33-51: Consider null checks and camera handling for world space canvas.The click handling logic looks good, but there are two potential improvements:
- The comment about Canvas Camera suggests world space support, but the camera parameter is always null
- Consider adding null checks for the _text field
public void OnPointerClick(PointerEventData eventData) { - // Get Canvas Camera if using WorldCamera view + if (_text == null) return; + + var camera = _text.canvas.renderMode == RenderMode.WorldSpace + ? _text.canvas.worldCamera + : null; + var linkedText = -1; if (InteractableType == InteractableTextType.IntersectingLink) { - linkedText = TMP_TextUtilities.FindIntersectingLink(_text, eventData.position, null); + linkedText = TMP_TextUtilities.FindIntersectingLink(_text, eventData.position, camera); } else { - linkedText = TMP_TextUtilities.FindNearestLink(_text, eventData.position, null); + linkedText = TMP_TextUtilities.FindNearestLink(_text, eventData.position, camera); }CHANGELOG.md (1)
9-14: Fix formatting in changelog entry.There are a few minor issues to address:
- Line 10: "broser" is misspelled and "e.g" should be "e.g.,"
- Line 14: Consider adding a period at the end for consistency
-Added *InteractableTextView* script to allow linking text code execution, e.g open URLs in the broser +Added *InteractableTextView* script to allow linking text code execution, e.g., open URLs in the browser **Changed**: - Renamed *AdjustScreenSizeFitter* to *AdjustScreenSizeFitterView* to mark it as a View in the architecture conventions -- Moved *AdjustScreenSizeFitterView* and *NonDrawingView*, *SafeAreaHelperView* to the Views folder and namespace to organize the codebase accordingly +- Moved *AdjustScreenSizeFitterView* and *NonDrawingView*, *SafeAreaHelperView* to the Views folder and namespace to organize the codebase accordingly.🧰 Tools
🪛 LanguageTool
[uncategorized] ~10-~10: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...t to allow linking text code execution, e.g open URLs in the broserChanged:...
(E_G)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
CHANGELOG.md(1 hunks)Editor/NonDrawingViewEditor.cs(1 hunks)Runtime/GameLovers.UiService.asmdef(1 hunks)Runtime/Views.meta(1 hunks)Runtime/Views/AdjustScreenSizeFitterView.cs(2 hunks)Runtime/Views/AdjustScreenSizeFitterView.cs.meta(1 hunks)Runtime/Views/InteractableTextView.cs(1 hunks)Runtime/Views/InteractableTextView.cs.meta(1 hunks)Runtime/Views/NonDrawingView.cs(1 hunks)Runtime/Views/SafeAreaHelperView.cs(1 hunks)package.json(1 hunks)
✅ Files skipped from review due to trivial changes (7)
- Runtime/Views/NonDrawingView.cs
- Editor/NonDrawingViewEditor.cs
- Runtime/Views/InteractableTextView.cs.meta
- Runtime/Views.meta
- Runtime/Views/AdjustScreenSizeFitterView.cs.meta
- Runtime/Views/AdjustScreenSizeFitterView.cs
- Runtime/Views/SafeAreaHelperView.cs
🧰 Additional context used
🪛 LanguageTool
CHANGELOG.md
[uncategorized] ~10-~10: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...t to allow linking text code execution, e.g open URLs in the broser
Changed:...
(E_G)
🔇 Additional comments (3)
Runtime/GameLovers.UiService.asmdef (1)
7-7: LGTM! TextMeshPro dependency correctly added.The addition of the TextMeshPro reference is necessary for the new InteractableTextView feature.
Runtime/Views/InteractableTextView.cs (1)
1-14: LGTM! Well-structured class with appropriate dependencies.The class is properly organized with necessary imports and implements IPointerClickHandler for click detection. The RequireComponent attribute ensures the TMP_Text dependency is met.
package.json (1)
5-5: LGTM! Version bump and dependencies are correct.The version bump to 0.12.0 is appropriate for the new feature additions, and the TextMeshPro dependency is correctly specified.
Also applies to: 11-12
New:
Changed:
Summary by CodeRabbit
Release Notes for Version 0.12.0
New Features
InteractableTextViewfor linking text to interactive actions like opening URLsImprovements
AdjustScreenSizeFittertoAdjustScreenSizeFitterViewfor clarityDependencies