Skip to content

fix: clean up camera-preview types and deprecations#1996

Merged
willeastcott merged 2 commits intomainfrom
fix/camera-preview-types
Apr 12, 2026
Merged

fix: clean up camera-preview types and deprecations#1996
willeastcott merged 2 commits intomainfrom
fix/camera-preview-types

Conversation

@willeastcott
Copy link
Copy Markdown
Contributor

@willeastcott willeastcott commented Apr 12, 2026

Summary

  • Remove non-existent FogType import from playcanvas and replace cast with string
  • Type app variable as Application | null instead of inferred null
  • Use top-level import type { EntityObserver } instead of inline import() syntax
  • Replace deprecated PCUI .element accessor with .dom
  • Convert function expressions to arrow functions for consistency
  • Remove redundant lastCamera && null checks already guarded by outer if (lastCamera)

Test plan

  • Verify camera preview renders correctly when selecting an entity with a camera component
  • Verify pin button works to lock/unlock the preview camera
  • Verify fog settings apply correctly in the preview

Remove non-existent FogType import, type app variable, use top-level
import for EntityObserver, replace deprecated .element with .dom,
convert function expressions to arrow functions, and remove redundant
null checks.

Made-with: Cursor
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
editor Ready Ready Preview, Comment Apr 12, 2026 9:50pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR cleans up typings and deprecated API usage in the viewport camera preview feature, aligning the implementation with current PlayCanvas/PCUI types and patterns.

Changes:

  • Removes invalid FogType import/cast and refines local typing (e.g., app).
  • Updates PCUI usage from deprecated .element to .dom.
  • Refactors some callbacks to arrow functions and simplifies redundant null checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/editor/viewport/camera/camera-preview.ts
Comment thread src/editor/viewport/camera/camera-preview.ts
Comment thread src/editor/viewport/camera/camera-preview.ts Outdated
@willeastcott willeastcott merged commit 3669513 into main Apr 12, 2026
7 checks passed
@willeastcott willeastcott deleted the fix/camera-preview-types branch April 12, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: viewport bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants