Repository navigation
W5: "Shared with me" documents (needs a backend route — A11) #54
Description
Part of #44 · Lane W5 — documents · Size M · blocked on a backend route (ask A11)
Parity evidence — and a correction
work-consolidation.md records this as "not a gap — the web lacks it too". That is wrong.
The web ships it, server-rendered, which is why an endpoint diff missed it:
app/documents/layout.tsx:21-29→getSharedDocuments(user.id)components/documents/DocumentsWorkspace.tsx:44→<SharedDocumentsList documents={…} />components/documents/SharedDocumentsList.tsx— a "Shared with me" panel with the owner and
the viewer's role (Viewer / Editor / Admin).
iOS today
Views/DocumentsView.swift shows only documents the user owns. A document shared to an iOS
user is reachable only if someone hands them a share-link token. Lists already got their equivalent
(GET /api/lists/watching → "Shared with me" section, #40); documents have no equivalent route.
Blocking backend ask (A11)
Add
GET /api/documents/shared-with-me(orGET /api/documents?scope=shared) returning the same
shapegetSharedDocuments()already produces —{ id, title, role, updatedAt, isPublic, owner }—
authorized withgetCurrentUserOrSyncTokenso Bearer clients can call it.
Tracked as A11 in #66. Do not work around it by walking every document's
collaborator list.
Build this (once the route exists)
-
sharedDocuments()inAPIClient+SharedDocuments.swift. - A Shared with me section in
DocumentsView, kept out of the owned-documents folder
tree (same rule asAppDataStore.watchedLists— the tree nests within the owner's
hierarchy, so foreign documents must not be inserted into it). - Row shows owner handle + role badge; tapping opens the document read-only or editable
according to role. - Editing gates on role (
watcher= read-only,collaborator/manager= editable) and the
offline sync outbox must not queue writes for read-only documents.
Acceptance criteria
- A document shared to the account appears under "Shared with me" without a share link.
- Role is respected in the editor; read-only documents cannot enter the sync outbox.
- Owned-document folder tree is unchanged.
- Unit tests for the new call + the tree-exclusion rule.
Files: new Services/APIClient+SharedDocuments.swift, Services/AppDataStore.swift,
Views/DocumentsView.swift.
Activity
Adron commentedon Sep 15, 2026
Still blocked on A11 — re-verified 2026-09-15
Checked the backend working tree today:
GET /api/documents/shared-with-meroute.app/api/documents/sharedisshared/[token](share-link resolution), not a collaborator-scoped listing.
app/api/documents/route.tshas noscopeparameter handling.getSharedDocuments(lib/documents/queries.ts:142) still has exactly one caller,app/documents/layout.tsx:22— server-rendered, unreachable from a Bearer client.The build plan in this issue remains correct and can start the moment A11 ships. Leaving open and
blocked rather than working around it by walking every document's collaborator list, per the
issue's own instruction. Tracked in #66.
Adron commentedon Sep 16, 2026
Still blocked — no change since the 2026-09-15 check
Re-verified against
~/Codez/interlinedlisttoday: still noGET /api/documents/shared-with-me,still no
?scope=sharedhandling inapp/api/documents/route.ts, andgetSharedDocuments(
lib/documents/queries.ts:142) still has exactly one caller —app/documents/layout.tsx:22,server-rendered and unreachable from a Bearer client.
The build plan in the description remains correct and can start the day A11 ships. Deliberately not
working around it by walking every document's collaborator list, per the issue's own instruction.
Tracked as A11 in #66.