feat(sharing): choose what a view's links unfurl into - #82
Merged
Merged
Conversation
The backend now lets each share view decide what a pasted link previews as: the generic card, or one naming the system (name, avatar and a snippet of the description). A second, independent setting does the same for member permalinks, with only that member's name and avatar. They are separate because naming a system and naming one member are different disclosures. Both sit in a new Link previews section on a view. Turning one on is an exposure like the six flags: it asks for re-auth when the view is shared and the safety category is armed, and a grace period stages it under the same flags_activate_at. Turning one off is immediate, and stays available even when what it would need to turn back on (publishing, permalinks) is gone, so going dark is never blocked. **Saying why a card is still generic.** The server reports what each URL really unfurls as. When a card is switched on but the link still previews generically, a note under the switch names the cause: the raise is waiting out the grace period, member permalinks are off, or the view is only reachable by share link, whose address is the secret and never gets a rich card. A staged raise counts as on for the note, because the live mode stays generic while it waits and a note keyed on the live mode would hide in the one case it exists for. The new fields default to generic, so an instance without the feature still parses.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #78, which adds the share view screen this builds on. Merge that first; this PR's diff is against it. It is independent of #79.
The app side of per-view link previews (backend sheaf-project/sheaf#295). Each share view now chooses what a pasted link unfurls into:
They are independent, because naming the system and naming one member are different disclosures. Both default to the generic card, and both live in a new Link previews section on a view.
Same doors as the flags
Turning a card on is an exposure, so it goes through what the six flags already do: re-auth when the view is shared and the safety category is armed, a server bounce reopening the sheet if the local check drifts, and staging under the same
flags_activate_atwhen there is a grace period. The existing "share view showing more" pending exposure already covers a staged card, so nothing new was needed there.Turning a card off is immediate. It also stays available when what it would need to turn back on is gone (publishing switched off, permalinks off), so going dark is never blocked. That is one deliberate difference from web, which disables the member switch outright once permalinks are off.
Saying why a card is still generic
The server reports what each URL really unfurls as (
link_preview_effective,member_link_preview_effective). When a card is on but the link still previews generically, a note under the switch names the cause:A staged raise counts as on for the note. The live mode stays
genericwhile a raise waits, so a note keyed on the live mode alone would hide in exactly the case it is for.Checked
assembleOpenDebugon this branch.