Skip to content

fix: disable globe rotation while it is loading#34

Merged
dastarruer merged 1 commit intomasterfrom
fix/disable-rotation-on-loading
Mar 31, 2026
Merged

fix: disable globe rotation while it is loading#34
dastarruer merged 1 commit intomasterfrom
fix/disable-rotation-on-loading

Conversation

@dastarruer
Copy link
Copy Markdown
Owner

@dastarruer dastarruer commented Mar 31, 2026

Closes #32

Summary by CodeRabbit

Release Notes

Bug Fixes

  • Enhanced the globe's interaction behavior. User-controlled rotation is now available only after texture resources finish loading, preventing premature interactions with incomplete assets. The automatic rotation functionality continues to operate normally during the asset-loading phase.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 31, 2026

📝 Walkthrough

Walkthrough

Updated the Globe.svelte component to conditionally gate user-controlled rotation on the OrbitControls element, binding the enableRotate property to the isLoaded state to prevent rotation while the normal map texture is loading.

Changes

Cohort / File(s) Summary
Globe OrbitControls Behavior
app/src/lib/components/globe/Globe.svelte
Tied user rotation capability to texture load state by setting enableRotate to isLoaded, preventing interactive rotation until the normal map finishes loading.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • world-tracker#18: Modifies the same Globe.svelte OrbitControls behavior and user rotation control logic based on load state.

Poem

🌍 Spin, spin, the globe wants to turn,
But first let the textures finish and learn!
Loading maps need their quiet rest,
No rotation—until we're dressed! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main change: disabling globe rotation during the loading state, which is the primary objective of this PR.
Linked Issues check ✅ Passed The code change implements the core requirement from issue #32 by setting enableRotate to isLoaded, preventing user rotation while the normal map loads.
Out of Scope Changes check ✅ Passed The change is narrowly focused on the stated objective: gating rotation based on load state. No unrelated modifications were introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/disable-rotation-on-loading

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
Copy Markdown

@coderabbitai coderabbitai Bot left a 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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/src/lib/components/globe/Globe.svelte`:
- Around line 51-52: The globe's rotation is permanently disabled because
enableRotate depends only on isLoaded and the texture-loading promise (the code
that sets isLoaded inside the texture load) can reject or hang; wrap the async
texture/load logic in a try/catch/finally (or attach .catch and .finally) so
that isLoaded is always set in finally to release the rotation lock, and in the
catch set a load failure flag or apply a fallback texture (e.g., set loadFailed
= true or use a default texture) so the UI can still enable rotation via
enableRotate={isLoaded || loadFailed} (reference isLoaded, enableRotate and the
texture-loading block to locate the changes).
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 66c6e60f-1be8-4e57-b680-05eb1b274729

📥 Commits

Reviewing files that changed from the base of the PR and between 2760b3c and afd5a16.

📒 Files selected for processing (1)
  • app/src/lib/components/globe/Globe.svelte

Comment thread app/src/lib/components/globe/Globe.svelte
@dastarruer dastarruer merged commit 8374585 into master Mar 31, 2026
5 checks passed
@dastarruer dastarruer deleted the fix/disable-rotation-on-loading branch March 31, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent user from rotating globe while it is loading

1 participant