pf_app
The WASM engine has no notion of focus or tab visibility. It re-renders because IntersectionObserver or ResizeObserver told it the element is visible again at some size, and that re-render discards the view -- taking set_depth() and per-node expansion with it, since neither lives in ViewConfig. Listening for window 'focus' was only a guess at when that happened, which is why the re-apply kept landing while the viewer was still detached from its table. Perspective's viewer captures the constructors at module-evaluation time (`var it=window.ResizeObserver; var st=window.IntersectionObserver`), so replacing them on window before that import puts us in front of every callback it gets. observerShim.js does exactly that and nothing else: the original callback runs first and unchanged, and we re-emit as a CustomEvent only when an entry's target is or contains a perspective-viewer. That has to be the first import in main.jsx or there is nothing left to intercept. focus/visibilitychange/pageshow stay as a backstop for the case where the shim could not be installed. ResizeObserver fires on every frame of a panel drag, so observer events trail by 150ms and act once the burst settles. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| lib | ||
| public | ||
| routes | ||
| setup_sql | ||
| ui | ||
| .env.example | ||
| .gitignore | ||
| CLAUDE.md | ||
| install.sh | ||
| package-lock.json | ||
| package.json | ||
| PERSPECTIVE.md | ||
| pf_perspective_options.md | ||
| pf_spec.md | ||
| pf.sh | ||
| server.js | ||