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

Show when there are pending documents #515

Closed eyeseast closed 5 months ago

eyeseast commented 5 months ago

This is a super-minimal implementation, just using text to tell the user how many documents are pending. This aims to solve the problem of a user uploading one or more documents and being redirected back to search results before the new documents are indexed.

Screenshot 2024-04-22 at 6 10 21β€―PM
netlify[bot] commented 5 months ago

Deploy Preview for documentcloud-frontend ready!

Name Link
Latest commit 565acb5dde3eface9e443986ca0ea4d2f76931f6
Latest deploy log https://app.netlify.com/sites/documentcloud-frontend/deploys/6627f8f6461c430009212bc6
Deploy Preview https://deploy-preview-515.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 5 months ago

Coverage Report

Status Category Percentage Covered / Total
πŸ”΅ Lines 40.07% 2710 / 6763
πŸ”΅ Statements 40.07% 2710 / 6763
πŸ”΅ Functions 25% 36 / 144
πŸ”΅ Branches 45.4% 84 / 185
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/lib/api/documents.ts 85.62% 87.5% 82.35% 85.62% 24-50, 56-71, 102-103, 164
src/lib/components/common/Tip.svelte 0% 0% 0% 0% 1-29
src/lib/components/documents/DocumentListItem.svelte 100% 50% 100% 100%
src/lib/components/documents/NoteHighlights.svelte 100% 100% 100% 100%
src/lib/components/documents/Pending.svelte 0% 0% 0% 0% 1-27
src/lib/components/documents/ResultsList.svelte 100% 22.22% 50% 100%
src/lib/components/documents/SearchHighlights.svelte 100% 100% 100% 100%
src/routes/(embed)/documents/[id]/annotations/[note_id]/+page.svelte 0% 0% 0% 0% 1-235
src/routes/(embed)/documents/[id]/pages/[page]/+page.svelte 0% 0% 0% 0% 1-215
src/routes/app/+page.svelte 0% 0% 0% 0% 1-118
src/routes/app/+page.ts 0% 0% 0% 0% 1-36
Generated in workflow #58
allanlasser commented 5 months ago

Sketches of two approaches to presenting the pending information. The first is subtle, with a notification at the bottom of the "action" sidebar. The second is obvious, with a modal confirmation upon upload success.

image

eyeseast commented 5 months ago

It's possible we could use both of these approaches: Show the modal, or some ephemeral message, when you first return to the search view after uploading, and then show the "Processing last upload" block once that's closed. If you refresh or search again after hiding the modal, there's no reason for it to come back.

eyeseast commented 5 months ago

Feedback from @morisy:

allanlasser commented 5 months ago

Explored placing at the top of either center or right column, I think it could belong to eitherβ€”it's either feedback on an action, or it's a substitute for missing content. If placed in the center, I'm not sure if it belongs in the floating header or as the first list item.

EDIT: Also, consider that on mobile, the right column will be hidden. This leads me to believe center column may provide users with the clearest feedback.

image

eyeseast commented 5 months ago

I think putting it at the top of search results makes the most sense. It's where the documents will eventually show up, and where I'm most likely to look.