Skip to content

Add presize API to <perspective-viewer>#3144

Merged
texodus merged 1 commit intomasterfrom
just-viewer-updates
Mar 23, 2026
Merged

Add presize API to <perspective-viewer>#3144
texodus merged 1 commit intomasterfrom
just-viewer-updates

Conversation

@texodus
Copy link
Member

@texodus texodus commented Mar 23, 2026

This PR adds an API which allows resize() to use a size hint to draw itself (potentially slow and async) with new dimensions, avoiding screen tearing/thrashing when a <perspective-viewer> is about to be moved/resized externally via CSS or layout changes.

  • resize() method now accepts an optional {dimensions: {width, height}} object, allowing callers to provide explicit size hints for the plugin container. This does not set the dimensions of the element to width, height; rather, it draws the plugin at these dimensions (including event-loop-boundary crossing async calls if the plugin must fetch) disregarding over/underflow of the <perspective-viewer> component itself, which presumably will be updated to these dimensions synchronously immediately by the caller when resize() resolves. The old force boolean parameter is removed.

  • Ancillary, the copy, export, column, filter, and function dropdown menus were previously implemented as standalone custom elements that created their own Shadow DOM hosts. They are now rendered inline as Yew components using a new PortalModal component that portals content to document.body with proper positioning and focus management. This removes ~500 lines of custom element boilerplate and deletes 4 files.

No tests were harmed in the making of this PR.

@texodus texodus force-pushed the just-viewer-updates branch 3 times, most recently from 8774e25 to 2a244f8 Compare March 23, 2026 15:58
Signed-off-by: Andrew Stein <steinlink@gmail.com>
@texodus texodus force-pushed the just-viewer-updates branch from 2a244f8 to ed53227 Compare March 23, 2026 16:27
@texodus texodus added enhancement Feature requests or improvements breaking labels Mar 23, 2026
@texodus texodus marked this pull request as ready for review March 23, 2026 18:42
@texodus texodus merged commit 31559ce into master Mar 23, 2026
16 checks passed
@texodus texodus deleted the just-viewer-updates branch March 23, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking enhancement Feature requests or improvements

Development

Successfully merging this pull request may close these issues.

1 participant