Skip to content

perf(editor): stabilize viewer stage mode sets - #673

Merged
Aymericr merged 1 commit into
mainfrom
fix/viewer-stage-stable-modes
Aug 17, 2026
Merged

perf(editor): stabilize viewer stage mode sets#673
Aymericr merged 1 commit into
mainfrom
fix/viewer-stage-stable-modes

Conversation

@Aymericr

Copy link
Copy Markdown
Contributor

What does this PR do?

Makes normalizeViewerStageModes return canonical, referentially stable mode combinations. This keeps documented inline arrays such as modes={['3d', '2d']} from rebuilding ViewerStage callbacks and media-query effects whenever a host rerenders.

How to test

  1. Run bun --cwd packages/editor check-types.
  2. Run bun test packages/editor/src/components/viewer/viewer-stage-modes.test.ts packages/editor/src/components/viewer/viewer-stage.test.tsx.
  3. Confirm equivalent mode arrays normalize to the same reference.

Screenshots / screen recording

Not applicable; this is a behavior-preserving performance cleanup.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

@Aymericr
Aymericr merged commit 5636a28 into main Aug 17, 2026
2 checks passed
@Aymericr
Aymericr deleted the fix/viewer-stage-stable-modes branch August 17, 2026 14:22
ovurrsl pushed a commit to ovurrsl/editor that referenced this pull request Aug 20, 2026
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.

1 participant