From a0f6c2f66397561a215a3a6daf8be49d40faf2eb Mon Sep 17 00:00:00 2001 From: curo1305 Date: Mon, 1 Jun 2026 19:32:51 +0200 Subject: [PATCH] fix(06.2): resolve four sharing UX issues found in re-test UAT - AccountView: remove hardcoded @ prefix so handle matches what share dialog expects - documents store: set is_shared=true optimistically after successful share so badge shows without refetch - GET /api/documents/{id}: allow recipients of an active share to view the document (was returning 404 for non-owners) - ShareModal: move Share button to its own full-width row so it no longer overflows the input area Co-Authored-By: Claude Sonnet 4.6 --- backend/api/documents.py | 13 ++++++- .../src/components/sharing/ShareModal.vue | 38 ++++++++++--------- frontend/src/stores/documents.js | 5 ++- frontend/src/views/AccountView.vue | 2 +- 4 files changed, 37 insertions(+), 21 deletions(-) diff --git a/backend/api/documents.py b/backend/api/documents.py index 10456c5..b4000cf 100644 --- a/backend/api/documents.py +++ b/backend/api/documents.py @@ -542,9 +542,20 @@ async def get_document( raise HTTPException(404, "Document not found") doc = await session.get(Document, uid) - if doc is None or doc.user_id != current_user.id: + if doc is None: raise HTTPException(404, "Document not found") + if doc.user_id != current_user.id: + # Allow recipients of an active share to view the document + share_result = await session.execute( + select(Share).where( + Share.document_id == uid, + Share.recipient_id == current_user.id, + ) + ) + if share_result.scalar_one_or_none() is None: + raise HTTPException(404, "Document not found") + meta = await storage.get_metadata(session, doc_id) if meta is None: raise HTTPException(404, "Document not found") diff --git a/frontend/src/components/sharing/ShareModal.vue b/frontend/src/components/sharing/ShareModal.vue index 8a369bc..4b29809 100644 --- a/frontend/src/components/sharing/ShareModal.vue +++ b/frontend/src/components/sharing/ShareModal.vue @@ -28,28 +28,30 @@ -
- - +
+
+ + +