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
15 stars 5 forks source link

sveltekit viewer notes #552

Closed eyeseast closed 1 month ago

eyeseast commented 1 month ago

Closes #535 #549

Rendering notes in the document and on their own. Notes can render the document excerpt in two ways:

The idea is that if we're already loading a PDF on the page, as in the viewer, we can use that same resource and produce a sharper image. If we're not, as in embeds, we can use a static image and skip loading PDF.js and the entire PDF file.

This departs a bit from what's in Figma and probably still needs some styling help. I'd like to line up the excerpt in the document view with its exact spot on the page, but I'm not totally sure how best to do that.

Screenshot 2024-05-28 at 9 52 43 AM

Screenshot 2024-05-28 at 9 52 52 AM

Screenshot 2024-05-28 at 9 53 16 AM

netlify[bot] commented 1 month ago

Deploy Preview for documentcloud-frontend ready!

Name Link
Latest commit 446877306e8fad783c2d236a491654bf3ca46e19
Latest deploy log https://app.netlify.com/sites/documentcloud-frontend/deploys/665a24e4591a120008bdde35
Deploy Preview https://deploy-preview-552.muckcloud.com
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

github-actions[bot] commented 1 month ago

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 32.5% 3100 / 9538
🔵 Statements 32.5% 3100 / 9538
🔵 Functions 29.71% 52 / 175
🔵 Branches 48.38% 120 / 248
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/lib/api/documents.ts 82.15% 79.41% 85% 82.15% 28-56, 62-91, 113-114, 131-137, 141-142, 176-177, 238
src/lib/api/notes.ts 65.71% 75% 75% 65.71% 12-27, 33-52
src/lib/components/common/Action.svelte 0% 0% 0% 0% 1-48
src/lib/components/common/KV.svelte 100% 100% 100% 100%
src/lib/components/documents/Note.svelte 0% 0% 0% 0% 1-345
src/lib/components/documents/NoteLink.svelte 0% 0% 0% 0% 1-60
src/lib/components/documents/Notes.svelte 0% 0% 0% 0% 1-107
src/lib/components/documents/PDF.svelte 0% 0% 0% 0% 1-83
src/lib/components/documents/PDFPage.svelte 0% 0% 0% 0% 1-360
src/lib/utils/search.ts 95.23% 100% 80% 95.23% 13-14
src/routes/+layout.svelte 0% 0% 0% 0% 1-23
src/routes/documents/[id]-[slug]/+layout.svelte 0% 0% 0% 0% 1-89
src/routes/documents/[id]-[slug]/+page.svelte 0% 0% 0% 0% 1-300
src/routes/documents/[id]-[slug]/sidebar/Actions.svelte 0% 0% 0% 0% 1-94
src/routes/documents/[id]-[slug]/sidebar/Data.svelte 0% 0% 0% 0% 1-57
src/routes/documents/[id]-[slug]/sidebar/Notes.svelte 0% 0% 0% 0% 1-67
src/routes/documents/[id]-[slug]/sidebar/Sections.svelte 0% 0% 0% 0% 1-56
Generated in workflow #139
eyeseast commented 1 month ago

I think I got everything I can. Please check.