Skip to content

fix: clean up keyboard overlay preview badges#813

Merged
hatayama merged 2 commits intomainfrom
feature/hatayama/fix-visualize-keyboard-input
Mar 21, 2026
Merged

fix: clean up keyboard overlay preview badges#813
hatayama merged 2 commits intomainfrom
feature/hatayama/fix-visualize-keyboard-input

Conversation

@hatayama
Copy link
Owner

@hatayama hatayama commented Mar 21, 2026

Summary

  • clean up preview badge objects from the keyboard overlay prefab setup
  • make the runtime keyboard overlay start with an empty badge container
  • include the prefab update that removes the baked preview badge content

Testing

  • uloop compile

Summary by cubic

Make the keyboard overlay start empty at runtime and remove baked preview badges from the prefab to prevent stray badge UI.

  • Bug Fixes
    • Clear overlay container children in Awake using DestroyImmediate so no preview badges appear at runtime.
    • Remove preview badge GameObjects from SimulateKeyboardOverlay.prefab and anchor the container to bottom-left for consistent positioning.

Written for commit 0f0c535. Summary will update on new commits.

Summary

This pull request cleans up the keyboard overlay prefab by removing baked preview badge objects from the editor view and adjusting the runtime initialization to use immediate destruction timing.

Changes

Files Modified:

  • Packages/src/Runtime/SimulateKeyboard/SimulateKeyboardOverlay.cs
  • Packages/src/Runtime/SimulateKeyboard/SimulateKeyboardOverlay.prefab

Code Changes

In SimulateKeyboardOverlay.cs:

  • Replaced Destroy() with DestroyImmediate() in the Awake() method for immediate cleanup of preview badge children
  • Updated the comment to clarify that the prefab retains preview badges for editor inspection purposes, but runtime initialization starts with an empty badge container

Prefab Changes

In SimulateKeyboardOverlay.prefab:

  • Removed 2 baked preview badge GameObject instances that were used for editor visualization
  • Removed associated nested KeyText elements for each preview badge
  • Adjusted RectTransform anchor settings from centered {x: 0.5, y: 0.5} to origin-based {x: 0, y: 0} for the badge container

Impact

  • Timing of cleanup: Changed from deferred destruction (end of frame) to immediate destruction during prefab initialization
  • Prefab size: Reduced by removing preview badge instances
  • Runtime behavior: Badge container starts empty as intended
  • Public API changes: None
  • Code review effort: Medium

Testing

Changes have been verified with the "uloop compile" test.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 21, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

A method in SimulateKeyboardOverlay.cs was modified to use DestroyImmediate() instead of Destroy() for removing prefab child GameObjects during the Awake() initialization, changing destruction timing from deferred to immediate.

Changes

Cohort / File(s) Summary
Destruction Timing
Packages/src/Runtime/SimulateKeyboard/SimulateKeyboardOverlay.cs
Replaced Destroy() with DestroyImmediate() in Awake() method for immediate removal of prefab preview badge children during initialization.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: clean up keyboard overlay preview badges' is clear and directly related to the main change: replacing Destroy() with DestroyImmediate() to improve cleanup of preview badge GameObjects in the keyboard overlay prefab.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/hatayama/fix-visualize-keyboard-input

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@hatayama hatayama merged commit 4caf06a into main Mar 21, 2026
10 of 11 checks passed
@hatayama hatayama deleted the feature/hatayama/fix-visualize-keyboard-input branch March 21, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant