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

Fix viewer search and consolidate search routing, too #862

Closed eyeseast closed 20 hours ago

eyeseast commented 1 day ago

Closes #846 and consolidates routing logic around search.

For PDF pages, we're now getting the search query directly from the URL, instead of props, and reacting to URL changes.

github-actions[bot] commented 1 day ago

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 30.81% 6699 / 21738
🔵 Statements 30.81% 6699 / 21738
🔵 Functions 49.63% 273 / 550
🔵 Branches 75.56% 1008 / 1334
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/lib/components/forms/Search.svelte 0% 0% 0% 0% 1-74
src/lib/components/viewer/PDFPage.svelte 0% 0% 0% 0% 1-253
src/lib/components/viewer/ReadingToolbar.svelte 0% 0% 0% 0% 1-140
src/lib/components/viewer/Text.svelte 0% 0% 0% 0% 1-40
src/lib/components/viewer/ViewerContext.svelte 0% 0% 0% 0% 1-193
src/lib/utils/search.ts 82.92% 75% 75% 82.92% 14-15, 76-80
src/routes/(app)/documents/[id]-[slug]/+page.svelte 0% 0% 0% 0% 1-66
src/routes/(app)/projects/+page.svelte 0% 0% 0% 0% 1-118
src/routes/embed/documents/[id]-[slug]/+page.ts 0% 0% 0% 0% 1
Generated in workflow #767 for commit 014fa79 by the Vitest Coverage Report Action
netlify[bot] commented 1 day ago

Deploy Preview for documentcloud-frontend ready!

Name Link
Latest commit 014fa7912aa2c325eb27977ac0364cccb0cb0199
Latest deploy log https://app.netlify.com/sites/documentcloud-frontend/deploys/673f5cf4c77dfe000834e885
Deploy Preview https://deploy-preview-862.muckcloud.com
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

Lighthouse
1 paths audited
Performance: 57
Accessibility: 85
Best Practices: 92
SEO: 91
PWA: -
View the detailed breakdown and full score reports

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

eyeseast commented 21 hours ago

Do we still need query and getQuery in ViewerContext? Right now they're only used by Text and ReaderToolbar and seem like they could be replaced by the utility.

We probably don't. I'll take them out.