Land share-email links in the Dashboard's Shared view - #3634
Merged
Conversation
A share email's links opened the item on the desktop, and "Open Puter" went to the bare origin — the recipient arrived on Home with nothing to say what had just been shared. Every link now lands in the Dashboard's Files tab, on Shared, with the shared items selected. Each named file still links to itself. "Open Puter" carries every item in the mail (?shared=a&shared=b), so the whole batch lands highlighted; the digest records now keep each item's masked path for that. The button's href is rendered raw like the item links, so `=` and `&` read the same in the html and text parts, and the unsubscribe link is built from a separate origin value. On the GUI side `/?shared=` boots the dashboard rather than the desktop; `/desktop?shared=` keeps opening the item in place. The Files tab selects the rows by uid, which survives a rename. A share only reaches a real account, so a share link never mints a temp user and an existing temp session is asked to sign in first, as the desktop already did. The address-bar cleanup both shells need moves into a helper.
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The "Open Puter" link names every item in the mail, capped at twenty. But a single item's parameter is ~150 characters once the owner, uuid and an encoded name are in it, so twenty of them run to several kilobytes — past the ~2000 characters where older mail clients cut a URL off or stop making it clickable — and the count alone couldn't do what its comment promised for the mail's primary button. Add a length budget beside the count: items go in, in digest order, only while the whole link stays under it, so the button always works and the first items are the ones highlighted. A single item always fits.
`shareDeepLink` now builds through `sharedViewLink`, whose length budget applied to the first item too: a parameter that alone overran it was dropped, and the link came out as a bare `?shared=`. A name of a few hundred characters — the GUI allows five hundred, and encoding triples every non-ASCII one — was enough, so that item's own link in the mail landed on Shared with nothing picked out, where it used to open the item. The first item now always goes in; the budget only decides how many more join it. One long link is still the item the mail is about, and it is no worse than a bare origin for the clients that truncate it.
Salazareo
approved these changes
Aug 25, 2026
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.
What
When files are shared, the recipient's email carries links to each file and an "Open Puter" button. All of them now take the recipient to the Dashboard's Files tab, with Shared selected in the sidebar and the newly shared files highlighted. Previously the file links opened the item on the desktop and "Open Puter" went to the bare origin (Home).
Backend
shareDeepLink.ts:sharedViewLink(origin, paths)builds/?shared=a&shared=b(deduped, capped at 20 items so mail clients don't truncate; with no items it is/?shared=, which still lands on Shared).shareDeepLinkdelegates to it, so per-file links are unchanged.ShareNotificationService/shareNotifyTitle.ts: digest items keep their maskedpath; the "Open Puter" button links to Shared with every item in the mail highlighted. Older KV digest records withoutpathdegrade to a plain Shared link.templates.ts: the button href is triple-braced like the item links (=/&stay literal in html and text); the unsubscribe link is built from a separateoriginvalue.GUI
initgui.js:/?shared=boots the dashboard (route{ tab: 'files', shared: [...] }) instead of the desktop;/desktop?shared=keeps opening the item in place. A share link never mints a temp user (same rule as app landings).UIDashboard.js: consumes the route → Files tab onwindow.shared_path, strips the param (replaceState→/#files). An existing temp session gets the login cover first, mirroring the desktop handler.TabFiles.js: after the Shared listing renders, rows are selected by uid (rename-proof).selectUploadedRowsis refactored onto a sharedselectRowsWhere.clear_shared_parammoves intohelpers/parse_shared_path.jsso both shells share it;shared_uids_from_pathsadded toshare_paths.js.Verification
npm run typecheckclean. New tests: multi-item link (order, dedupe, cap, empty),digestItemPaths, template rendering of the button, and the button in the real send path (shareEmail.test.ts)./#files. Signed out → sign-in cover with?shared=intact, lands correctly after sign-in./desktop?shared=still opens the file in the editor.Notes
DIGEST_NAMES_PER_SENDER, 5 per sender per batch); "+N more" items aren't highlighted.UIDashboard(no temp session at hand; the code mirrors the desktop's).helpers/parse_shared_path.jsandhelpers/share_paths.jsboth parse the same path shape — worth folding together separately.