MuckRock / documentcloud-frontend

DocumentCloud's front end source code - Please report bugs, issues and feature requests to info@documentcloud.org
https://www.documentcloud.org
GNU Affero General Public License v3.0
18 stars 5 forks source link

Refactor Viewer #777

Closed allanlasser closed 4 weeks ago

allanlasser commented 1 month ago

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:

Changes include:

Not doing:

github-actions[bot] commented 1 month ago

Coverage Report

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
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/lib/api/documents.ts 97.96% 88.88% 100% 97.96% 156-157, 174-180, 184-185, 484-486
src/lib/api/notes.ts 84.72% 78.57% 83.33% 84.72% 25-37, 43-60
src/lib/components/embeds/DocumentEmbed.svelte 0% 0% 0% 0% 1-97
src/lib/components/forms/ConfirmRedaction.svelte 0% 0% 0% 0% 1-88
src/lib/components/forms/EditNote.svelte 0% 0% 0% 0% 1-106
src/lib/components/layouts/ContentLayout.svelte 0% 0% 0% 0% 1-59
src/lib/components/layouts/DocumentLayout.svelte 0% 0% 0% 0% 1-121
src/lib/components/layouts/EmbedLayout.svelte 0% 0% 0% 0% 1-109
src/lib/components/viewer/AnnotationLayer.svelte 0% 0% 0% 0% 1-377
src/lib/components/viewer/Note.svelte 0% 0% 0% 0% 1-393
src/lib/components/viewer/NoteTab.svelte 100% 100% 100% 100%
src/lib/components/viewer/Notes.svelte 0% 0% 0% 0% 1-74
src/lib/components/viewer/PDF.svelte 0% 0% 0% 0% 1-478
src/lib/components/viewer/PDFPage.svelte 0% 0% 0% 0% 1-341
src/lib/components/viewer/Page.svelte 0% 0% 0% 0% 1-590
src/lib/components/viewer/PageActions.svelte 0% 0% 0% 0% 1-145
src/lib/components/viewer/Text.svelte 0% 0% 0% 0% 1-68
src/lib/components/viewer/Viewer.svelte 0% 0% 0% 0% 1-101
src/lib/components/viewer/ViewerContext.svelte 0% 0% 0% 0% 1-194
src/lib/components/viewer/Zoom.svelte 0% 0% 0% 0% 1-62
src/lib/load/document.ts 0% 0% 0% 0% 1-38
src/lib/utils/search.ts 94.8% 75% 75% 94.8% 14-15, 76-77
src/lib/utils/viewer.ts 91.66% 100% 77.77% 91.66% 100-109, 115-121
src/routes/(app)/documents/[id]-[slug]/+page.svelte 0% 0% 0% 0% 1-58
src/routes/(app)/documents/[id]-[slug]/+page.ts 0% 0% 0% 0% 1
src/routes/embed/documents/[id]-[slug]/+page.svelte 0% 0% 0% 0% 1-41
src/routes/embed/documents/[id]-[slug]/+page.ts 0% 0% 0% 0% 1
Generated in workflow #613 for commit 2e51a01 by the Vitest Coverage Report Action
netlify[bot] commented 1 month ago

Deploy Preview for documentcloud-frontend ready!

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...

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.