Closed allanlasser closed 4 weeks ago
Status | Category | Percentage | Covered / Total |
---|---|---|---|
π΅ | Lines | 23.65% | 7454 / 31514 |
π΅ | Statements | 23.65% | 7454 / 31514 |
π΅ | Functions | 41.14% | 151 / 367 |
π΅ | Branches | 60.66% | 418 / 689 |
Name | Link |
---|---|
Latest commit | 2e51a01ec87c1996d9f15528a91ff4f0ed1e6dc8 |
Latest deploy log | https://app.netlify.com/sites/documentcloud-frontend/deploys/67190d728d0c130008f8de2c |
Deploy Preview | https://deploy-preview-777.muckcloud.com |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
Lighthouse |
1 paths audited Performance: 39 Accessibility: 79 Best Practices: 92 SEO: 85 PWA: - View the detailed breakdown and full score reports |
To edit notification comments on pull requests, go to your Netlify site configuration.
Refactors the viewer to make its logic easier to reason about and its code more adaptable to change. Goals are cleaning up code, consolidating redundancies, and extracting pure functions.
Some of the advantages:
ViewerContext
, then accessing this context from its subcomponents (with the exception of optimistic updates, but it's possible we could improve our approach and optimistically update the$page.data
store inside an action instead of returning an updated value from it).$lib/load/document.ts
and navigation handling inViewerContext
deduplicates functionality between app and embed routes.ViewerContext
prevents re-loading the PDF between different viewer modes, potentially resolving #565Changes include:
ViewerContext
that makes it easier to set and access data for variety of sub-componentsViewerContext
directlyText
andTextPage
*Pane
into*Layer
NotesPane
withAnnotationsPane
to deduplicate rendering logicViewerContext
, instead of the conditionally-renderedPDF
afterNavigate
andonHashChange
intoViewerContext
fromsrc/routes/(app)/documents/[id]-[slug]/+page.svelte
andsrc/routes/embed/documents/[id]-[slug]/+page.svelte
viewer
directory as flat as possible. Toolbars are now alongside their layers, e.g.AnnotationLayer
andAnnotationToolbar
are siblings.zoom
state intoViewerContext
and scale/size conversion logic intolib/utils/viewer
lib/utils/viewer
src/lib/components/viewer/README.md
with a high-level overview of how it works (yay documentation)Not doing:
lib/components/viewer
PDFPage.svelte
andNote.svelte
βthere's a duplication of logic there. The render functions could also be made pure and assume it's operating on acanvas
node that's passed as an argument. (This is complex and risky enough that it should be its own issue/PR).