File list shows which files are shared (row badge) #577

Closed
opened 2026-09-17 19:39:36 +00:00 by Cordy · 3 comments
Owner

Follow-up from #571, split out because it is the one piece of that panel that needs backend work — everything else in the panel is served by what #573–#576 already shipped.

What

A file that is shared carries a badge in the file list, so "who can see this?" is answerable without opening the share dialog on every row.

Drawn in share-panel-571-mockup.html rev 1, state B: a small Shared chip beside the filename.

Why it is not free

The listing response has no per-path grant count. share.GrantQuerier.ListForPath answers for one path; calling it per row would be N queries per directory render.

So this needs a batch shape — roughly:

  • a store query that takes the paths in the current listing and returns the counts, or
  • a counts map folded into the existing listing response (internal/api/listmeta.go is the precedent — it already decorates listings with per-path extras).

listmeta.go is almost certainly the right home: it exists precisely so the browser can render per-row state without a request per row.

Decisions still open

  • Does the badge distinguish kinds? A file shared with two people is not the same as a file with a live public link on it — arguably the public one deserves the louder treatment, since it is the one reachable without an account. A single neutral Shared chip is simpler; Shared vs Public link is more truthful.
  • Does it count? Shared vs Shared · 3. A count invites a click; a bare chip does not.
  • Owner's view only? On a path reached through /shared, a badge saying "Shared" is noise — the whole tree is shared, that is why you can see it.

Not in scope

The panel itself (#571) and anything about how grants are created. This issue is only the indicator.

Follow-up from #571, split out because it is the one piece of that panel that needs **backend** work — everything else in the panel is served by what #573–#576 already shipped. ## What A file that is shared carries a badge in the file list, so "who can see this?" is answerable without opening the share dialog on every row. Drawn in `share-panel-571-mockup.html` rev 1, state B: a small `Shared` chip beside the filename. ## Why it is not free The listing response has no per-path grant count. `share.GrantQuerier.ListForPath` answers for **one** path; calling it per row would be N queries per directory render. So this needs a batch shape — roughly: - a store query that takes the paths in the current listing and returns the counts, or - a counts map folded into the existing listing response (`internal/api/listmeta.go` is the precedent — it already decorates listings with per-path extras). `listmeta.go` is almost certainly the right home: it exists precisely so the browser can render per-row state without a request per row. ## Decisions still open - **Does the badge distinguish kinds?** A file shared with two people is not the same as a file with a live public link on it — arguably the public one deserves the louder treatment, since it is the one reachable without an account. A single neutral `Shared` chip is simpler; `Shared` vs `Public link` is more truthful. - **Does it count?** `Shared` vs `Shared · 3`. A count invites a click; a bare chip does not. - **Owner's view only?** On a path reached through `/shared`, a badge saying "Shared" is noise — the whole tree is shared, that is why you can see it. ## Not in scope The panel itself (#571) and anything about how grants are created. This issue is only the indicator.
Author
Owner

Mockup batch A is drawn: batch-a-572-577-598-mockup.html (design folder), block 5 — all three open decisions as variants A/B/C with a decision table. Recommendation: B — kind-distinguished chips (Shared quiet, Public in the warn tone), no counts, owner's view only (suppressed under /shared and inside space content). Build waits on markup.

Mockup batch A is drawn: `batch-a-572-577-598-mockup.html` (design folder), block 5 — all three open decisions as variants A/B/C with a decision table. Recommendation: **B** — kind-distinguished chips (*Shared* quiet, *Public* in the warn tone), no counts, owner's view only (suppressed under `/shared` and inside space content). Build waits on markup.
Author
Owner

Mockup approved (batch A rev 1 block 5 stands, no markup): variant BShared quiet / Public warn-toned, no counts, owner's view only, suppressed under /shared and inside space content. Public wins the chip when both apply.

Mockup approved (batch A rev 1 block 5 stands, no markup): **variant B** — *Shared* quiet / *Public* warn-toned, no counts, owner's view only, suppressed under `/shared` and inside space content. Public wins the chip when both apply.
Author
Owner

Shipped in v0.6.216 (PR #606), live on both dogfoods, as approved variant B: listmeta splits owner share records into Shared (grants) and Public (links) via shareFlagMaps/applyPublic; the row chip renders Public in the link tone and it wins when both apply; labels i18n ×4. No counts; owner-records-only keeps /shared views quiet by construction. Closing.

Shipped in **v0.6.216** (PR #606), live on both dogfoods, as approved variant B: listmeta splits owner share records into Shared (grants) and Public (links) via `shareFlagMaps`/`applyPublic`; the row chip renders Public in the link tone and it wins when both apply; labels i18n ×4. No counts; owner-records-only keeps `/shared` views quiet by construction. Closing.
Cordy closed this issue 2026-09-18 12:27:35 +00:00
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#577
No description provided.