Merge remote-tracking branch 'origin/main' into ochafik/readme-mcp-config

This commit is contained in:
Olivier Chafik 2026-01-20 10:17:45 +00:00
commit 5ef3120e0c
No known key found for this signature in database

View file

@ -129,3 +129,31 @@ React component that:
- Displays streaming preview from `toolInputsPartial.code` as code arrives
- Executes final code from `toolInputs.code` when complete
- Renders to a pre-created canvas with configurable height
## Performance
### Visibility-Based Pause
Animation automatically pauses when the widget scrolls out of view:
- Uses `IntersectionObserver` to track visibility (browser-native, no polling)
- Wraps `requestAnimationFrame` to skip frames when not visible
- Animation loop stops completely → zero CPU usage while hidden
- Queued callbacks resume instantly when scrolled back into view
This is transparent to user code - just use `requestAnimationFrame` normally.
### Transparent Background
Supports alpha transparency for seamless host UI integration:
```javascript
const renderer = new THREE.WebGLRenderer({
canvas,
antialias: true,
alpha: true,
});
renderer.setClearColor(0x000000, 0); // Fully transparent
```
This is the default - 3D objects composite directly over the host background.