Skip to content

15 show compass by default #49

Merged
merged 1 commit into from
Oct 29, 2025
Merged

15 show compass by default #49

merged 1 commit into from
Oct 29, 2025

Conversation

adriahso
Copy link
Member

@adriahso adriahso commented Oct 29, 2025

Issue number

Closes #15

Description

Initialise the compass to be visible by default.

Testing steps

Check that the compass is visible by default.

Summary by CodeRabbit

  • New Features
    • Compass is now visible in the Potree viewer.

@adriahso adriahso self-assigned this Oct 29, 2025
@adriahso adriahso linked an issue Oct 29, 2025 that may be closed by this pull request
@coderabbit
Copy link

coderabbit bot commented Oct 29, 2025

Walkthrough

Enables the Potree viewer compass by calling setVisible(true) during viewer initialization, making the on-screen compass UI visible to users without modifying control flow or error handling.

Changes

Cohort / File(s) Summary
Compass UI Enhancement
src/potreeViewer.js
Adds viewer.compass.setVisible(true) call within createPotreeViewer initialization, positioning it after globe background setup and before panel initialization

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Single-line addition that enables an existing UI component
  • No new logic, error handling, or control flow changes
  • No exported API modifications

Poem

🧭 A compass appears on the viewer's face,
Helping users navigate through space,
North stays true, the bearing's clear,
With just one line, direction's near,
The rabbit hops—true north is here! 🐰

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "15 show compass by default" clearly and concisely describes the main change: enabling the compass to be visible by default in the Potree viewer. The title is specific, directly related to the primary objective, and avoids vague terminology. It effectively communicates the key change to someone reviewing the commit history.
Linked Issues Check ✅ Passed The pull request successfully addresses the primary coding requirement from issue #15, which was to "add an on-screen compass." The implementation adds viewer.compass.setVisible(true) during initialization, enabling compass visibility by default. The secondary requirement of "consider including a reset north-up button" was phrased as optional ("maybe with"), and this pull request focuses on the primary objective of adding and displaying the compass functionality. The change directly fulfills the core requirement specified in the linked issue.
Out of Scope Changes Check ✅ Passed The pull request contains only one focused change: enabling compass visibility by adding viewer.compass.setVisible(true) in the createPotreeViewer function. This change is directly aligned with issue #15 and the stated PR objective. No exported or public signature changes were introduced, and no unrelated modifications are present. The implementation is minimal and scoped appropriately to the stated objective.
Description Check ✅ Passed The pull request description follows the required template and includes all essential sections: issue number (#15), a clear description of the change (initializing the compass to be visible by default), and practical testing steps (verifying the compass visibility). The description is complete and provides sufficient context for reviewers to understand the purpose and scope of the change. The optional screenshots section is not included, which is acceptable.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 15-compass

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1315491 and d2b1b58.

📒 Files selected for processing (1)
  • src/potreeViewer.js (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/potreeViewer.js (1)
src/cesiumViewer.js (1)
  • viewer (8-22)
🔇 Additional comments (1)
src/potreeViewer.js (1)

128-130: LGTM! The compass API is confirmed and correctly implemented.

The viewer.compass.setVisible() method exists in the Potree library and is already used elsewhere in the build. The change follows established patterns in the codebase—direct viewer property/method access without defensive guards is standard throughout src/potreeViewer.js (e.g., viewer.orbitControls, viewer.setEDLEnabled()). Placement inside the loadGUI() callback is appropriate for UI initialization.

Note: Issue #15 also mentioned a "reset north-up button" feature, which remains unaddressed—this can be tackled separately if desired.


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

Copy link
Member

@mariewah mariewah left a comment

Choose a reason for hiding this comment

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

LGTM :D

Copy link
Member

@kleinc kleinc left a comment

Choose a reason for hiding this comment

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

LGTM!

@adriahso adriahso merged commit b4a0e8c into dev Oct 29, 2025
2 checks passed
@adriahso adriahso deleted the 15-compass branch October 29, 2025 11:41
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compass
3 participants