Conversation
|
Preview deployed: https://preview-1394.staging.documentcloud.org |
allanlasser
reviewed
Sep 9, 2026
| "svelte-octicons": "^18.20.0", | ||
| "svelte-preprocess": "^6.0.3", | ||
| "sveltekit-flash-message": "^2.4.6", | ||
| "virtua": "^0.50.2", |
Member
There was a problem hiding this comment.
@dnass any strong factors for why you picked this particular library?
Contributor
Author
There was a problem hiding this comment.
Virtua seems like the most mature option available for Svelte. It's under active development and has a framework agnostic core plus clients for several different frameworks. It estimates the content height effectively with no config, which I haven't seen in other virtualization libraries.
Other options I checked out:
- svelte-tiny-virtual-list: This is the runner up and would probably work for us too. It didn't get Svelte 5 support until last month, which seems like a bit of a red flag for the health of the project.
- @tanstack/svelte-virtual: Broken in Svelte 5 and seems semi-abandoned.
allanlasser
reviewed
Sep 9, 2026
Comment on lines
+208
to
+211
| // Trackpad pinch gestures arrive as wheel events with ctrlKey set; the browser | ||
| // would otherwise page-zoom, so claim them. Plain (non-ctrl) wheel stays a | ||
| // normal scroll. | ||
| async function onWheel(e: WheelEvent) { |
Member
There was a problem hiding this comment.
Love the scroll wheel support!
allanlasser
reviewed
Sep 9, 2026
Comment on lines
+21
to
+39
| export interface PinchZoomOptions { | ||
| /** Current numeric render scale (e.g. `viewer.scale`). */ | ||
| getScale: () => number; | ||
| /** | ||
| * Set the zoom value. Must apply synchronously and flush so the page layout | ||
| * reflects the new scale before we read the post-change geometry. | ||
| */ | ||
| setZoom: (scale: number) => void; | ||
| /** Whether pinch-zoom is currently allowed (e.g. only in reading mode). */ | ||
| enabled: () => boolean; | ||
| /** Minimum/maximum scale reachable via pinch. */ | ||
| min: number; | ||
| max: number; | ||
| /** Called when a pinch gesture begins (touch or trackpad). */ | ||
| onPinchStart?: () => void; | ||
| /** Called when a pinch gesture ends. */ | ||
| onPinchEnd?: () => void; | ||
| findItemByOffset: (offset: number) => Nullable<HTMLElement>; | ||
| } |
Member
There was a problem hiding this comment.
Wonderfully generic, using a Svelte attachment is a great choice here.
dnass
force-pushed
the
virtualize-viewer
branch
from
September 14, 2026 13:22
9dfedf3 to
4f22d86
Compare
dnass
force-pushed
the
virtualize-viewer
branch
from
September 14, 2026 13:35
4f22d86 to
f4ee3c7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIP. Opening a PR so that I can get a preview deploy.