Skip to content

fix(#61): 🐛 Ensure potreeViewer is always enabled #62

Merged
merged 4 commits into from
Nov 10, 2025

Conversation

gautegf
Copy link
Member

@gautegf gautegf commented Nov 10, 2025

Issue number

Closes #61

Description

Ensure potreeViewer is always enabled

Testing steps

Try to make a camera animation, find it under scene, and play it

Summary by CodeRabbit

  • Bug Fixes
    • Improved viewer initialization reliability by adding local and global aliases for the viewer to aid integrations and debugging without changing runtime behavior.

@gautegf gautegf self-assigned this Nov 10, 2025
@gautegf gautegf linked an issue Nov 10, 2025 that may be closed by this pull request
@coderabbit
Copy link

coderabbit bot commented Nov 10, 2025

Walkthrough

Defines a local constant referencing window.potreeViewer and assigns that value to window.viewer immediately after the Potree viewer is created, introducing a global alias without changing existing control flow or render loop.

Changes

Cohort / File(s) Summary
Global alias assignment
src/main.js
Adds two lines after Potree viewer creation: const potreeViewer = window.potreeViewer and window.viewer = window.potreeViewer, creating a global alias. No other logic altered.

Sequence Diagram(s)

sequenceDiagram
    participant Potree as Potree Init
    participant Win as window
    participant Consumer as Downstream Code

    Potree->>Win: create `window.potreeViewer`
    Note right of Win `#f0f4c3`: Alias assignment (new)
    Win->>Win: const potreeViewer = window.potreeViewer\nwindow.viewer = window.potreeViewer
    Consumer->>Win: read `window.viewer` (uses alias)
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Review src/main.js to confirm alias timing relative to viewer creation and any potential global-name collisions.

Poem

🐰 I found a viewer, shiny and near,
I gave it a name that everyone hears.
A tiny alias, hopped into place,
Now all can find it, in global space. 🥕


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between a8f2d97 and e7f5de5.

📒 Files selected for processing (1)
  • src/main.js (1 hunks)

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

franmagn

This comment was marked as outdated.

@franmagn franmagn self-requested a review November 10, 2025 08:34
@franmagn franmagn dismissed their stale review November 10, 2025 08:35

outdated

Copy link
Member

@tobiaobr tobiaobr left a comment

Choose a reason for hiding this comment

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

looks good, the test worked as intended. 🔥

Copy link
Member

@franmagn franmagn left a comment

Choose a reason for hiding this comment

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

LGTM, now everything works fine!

@gautegf gautegf merged commit cfb22a9 into dev Nov 10, 2025
2 checks passed
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Small fix: Ensure camera animations show up
3 participants