Skip to content

Enhance SplatViewer and documentation updates #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 13, 2025
Merged

Conversation

marklundin
Copy link
Member

  • Introduced new Check and Dash components for improved UI feedback in the SplatViewer documentation.
  • Updated registry-mdx-components to include new components and adjusted imports for better organization.
  • Enhanced the SplatViewer component with new controls and improved camera functionality.
  • Updated package.json to streamline the build process by chaining the postbuild command with registry:build.
  • Revised documentation to reflect the latest features and improvements, including new API references and usage examples.

These changes enhance the user experience and provide clearer guidance for developers using the SplatViewer component.

- Introduced new `Check` and `Dash` components for improved UI feedback in the SplatViewer documentation.
- Updated `registry-mdx-components` to include new components and adjusted imports for better organization.
- Enhanced the `SplatViewer` component with new controls and improved camera functionality.
- Updated `package.json` to streamline the build process by chaining the `postbuild` command with `registry:build`.
- Revised documentation to reflect the latest features and improvements, including new API references and usage examples.

These changes enhance the user experience and provide clearer guidance for developers using the SplatViewer component.
@marklundin marklundin requested a review from Copilot May 13, 2025 14:58
@marklundin marklundin self-assigned this May 13, 2025
@marklundin marklundin added the documentation Improvements or additions to documentation label May 13, 2025
Copy link

pkg-pr-new bot commented May 13, 2025

Open in StackBlitz

npm i https://pkg.pr.new/playcanvas/react/@playcanvas/react@135

commit: eed4447

@marklundin marklundin review requested due to automatic review settings May 13, 2025 14:58
Copy link
Contributor

@Copilot 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 enhances the SplatViewer component and its documentation by adding new features, components, and improvements to the underlying animation and camera controls while updating registry metadata and MDX components. Key changes include:

  • The introduction of new Check and Dash UI components for documentation.
  • Updates to SplatViewer and SmartCamera components, including the new autoPlay and onTypeChange options as well as improved styling and animation functionality.
  • Adjustments to registry and MDX components for better organization and clearer API references.

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/docs/registry/splat-viewer/utils/style.ts Added a centralized style configuration (paris) for the viewer.
packages/docs/registry/splat-viewer/utils/animation.ts Introduced a new rotation track creator and its associated type definitions.
packages/docs/registry/splat-viewer/splat-viewer.tsx Updated the SplatViewer component to integrate SmartCamera, add autoPlay support, and clean up camera control props.
packages/docs/registry/splat-viewer/splat-viewer-context.tsx Enhanced context provider with autoPlay defaults and expanded API documentation comments.
packages/docs/registry/splat-viewer/smart-camera.tsx Added the SmartCamera component to handle interactive and animation modes using timeline subscriptions.
packages/docs/registry/splat-viewer/index.tsx Reorganized exports to include new controls and timeline modules.
packages/docs/registry/splat-viewer/controls.tsx Created a new Controls component with auto-hide functionality based on interaction state.
packages/docs/registry.json & packages/docs/public/r/*.json Updated registry metadata to reflect new component names, homepage links, and versioning.
packages/docs/registry-mdx-components.tsx & packages/docs/mdx-components.js Updated MDX component registrations to include the new Controls component and adjust import paths.
packages/docs/content/blocks.mdx Refined demo content to showcase new features, autoPlay behavior, and Check/Dash component usage.
packages/docs/components/Check.tsx Introduced Check and Dash components to visually indicate features in documentation.
packages/docs/package.json Modified postbuild script to chain registry:build after pagefind processing.

Comment on lines 172 to 173

console.log('interactive camera', initialPose);
Copy link
Preview

Copilot AI May 13, 2025

Choose a reason for hiding this comment

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

Remove or disable the debug log 'console.log('interactive camera', initialPose);' to avoid unintended console output in production.

Suggested change
console.log('interactive camera', initialPose);
if (process.env.NODE_ENV !== 'production') {
console.log('interactive camera', initialPose);
}

Copilot uses AI. Check for mistakes.

Comment on lines 71 to 74
/**
* Whether to automatically play the animation
*/
autoPlay?: boolean,
Copy link
Preview

Copilot AI May 13, 2025

Choose a reason for hiding this comment

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

The 'autoPlay' property is declared in both SplatViewerComponentProps and in the combined SplatViewerProps; please consolidate these definitions to avoid redundancy and potential ambiguity.

Suggested change
/**
* Whether to automatically play the animation
*/
autoPlay?: boolean,
// Removed redundant autoPlay property from SplatViewerProps

Copilot uses AI. Check for mistakes.

}) {
const entityRef = useRef<PcEntity>(null);
const { subscribe, isPlaying } = useTimeline();
console.log('isPlaying', isPlaying);
Copy link
Preview

Copilot AI May 13, 2025

Choose a reason for hiding this comment

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

Consider removing the debug log 'console.log('isPlaying', isPlaying);' to prevent unnecessary logging in production builds.

Suggested change
console.log('isPlaying', isPlaying);

Copilot uses AI. Check for mistakes.

@marklundin marklundin marked this pull request as draft May 13, 2025 15:00
@marklundin marklundin marked this pull request as ready for review May 13, 2025 16:10
@marklundin marklundin merged commit b9adbe0 into main May 13, 2025
5 checks passed
@marklundin marklundin deleted the fix-blocks-updates branch May 13, 2025 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant