_Note: This issue is part of a larger pinning service integration epic undertaken spring/summer 2020._
Augment functionality of existing "Pin IPFS Resource" toggle to support the use of third-party pinning services:
Advantages of this approach are:
Original note from PRD:
(TBD) Feature in IPFS Companion that allows a user to pin data to their chosen pinning service
- This is likely unnecessary with auto-upload rules for pinned files
User flow:
- Users can use Desktop or WebUI to connect their local node to an IPFS pinning service
- User right-clicks a file or image and selects “pin to IPFS”
- If they have an auto-upload rule configured, that file is automatically added to their associated pinning service
@lidel and @rafaelramalho19 --
AFAIK, there are two scenarios in which a Companion user might invoke third-party pinning. Both only occur if the user has "Auto upload" enabled for one or more pinning services.
From the "Pin IPFS resource" toggle in the Companion drop-down.

When right-clicking on a page/image and selecting "Import to IPFS".

This seems logical enough that it doesn't need any modification or explanation, but want to run that past you both to make sure (a) that I haven't omitted any possible scenarios (b) it doesn't feel logical/obvious to you. Thanks!
:+1: Flow for (2) "Import to IPFS" is already ending in Web UI, so I don't think we need to do anything there.
:question: Depending on how pinning service integration is implemented, "pinning current URL" (1) may be problematic. If "auto pinning" requires webui running to work, then the existing toggle won't trigger pinning at remote service. We may rewire this toggle to open "pinning screen" in webui instead.
@lidel Sounds good. Let's keep this on hold until we know a bit more about the issues involved in (1).
@lidel - Revisiting your earlier question for a status check:
❓ Depending on how pinning service integration is implemented, "pinning current URL" (1) may be problematic. If "auto pinning" requires webui running to work, then the existing toggle won't trigger pinning at remote service. We may rewire this toggle to open "pinning screen" in webui instead.
Coming up with good "pinning UI" in Companion will be difficult because exposing user to the concept of a "pin" itself is feels too technical IMO.
Perhaps a better user experience would be if we replace "Pin IPFS Resource" with "Import to my IPFS node" which... copies reference to the current CID to MFS, and then opens Files in WebUI in a new tab (just like wealready do when user does quick upload or import via context menu).
This approach means we don't need any new UI in Companion, and lean more on WebUI, which is our general direction anyway.
Note that import to MFS effectively "pins" content that is already in node's cache (as long it is in MFS, it won't be garbage-collected), but is much easier for user to reason about:
@jessicaschilling how does this sound?
Refining the idea from my previous comment:
@lidel - sounds excellent, totally agree. I'm going to repurpose this issue from discussion to requirements now that we have those. This should wrap up pinning-related Companion work, at least for initial release 😊
Two thoughts below on i18n keys stashed from https://github.com/ipfs-shipyard/ipfs-companion/pull/937 but not implemented to save on contributor translation burden. Let's use this (or similar) wording: "assets" is a little clearer than "resources".
"panel_pinCurrentIpfsAddress": {
"message": "Pin IPFS Assets",
"description": "A menu item in Browser Action pop-up (panel_pinCurrentIpfsAddress)"
},
and
"panel_pinCurrentIpfsAddressTooltip": {
"message": "Pin the IPFS assets on this tab (e.g. files, images, videos) to your node to have local copies that are available offline and never thrown away.",
"description": "A menu item tooltip in Browser Action pop-up (panel_pinCurrentIpfsAddressTooltip)"
},
Small concern regarding low level pins:
/ipns/en.wikipedia-on-ipfs.org/wiki/ and that will cause 650GB downloadWhat if we don't do low level local pinning in Companion, but delegate that decision to Web UI?
/pinning or something, which would be alias for /files + _Set pinning_ modal /ipns/en.wikipedia-on-ipfs.org/wiki/, we will solve it for everything else.@lidel I think this might actually be a slightly different problem from the perspective of the end user. Unless you know pretty deeply how pinning works, the default user mindset is likely to be something like this:
Could we give the user the option to "pin this page" (which would, if I understand correctly, take the user to the Files screen + modal to decide if they want to MFS-pin just the local cache to their node or a pinning service) versus some more nuclear "pin entire site" option (which would have to come with warnings: you're pinning 80gb)?
In either case, agree we shouldn't be doing low-level pinning from Companion anyway, because your pins "disappear" and can never be seen from our file system for the ordinary user.
Continuing forward, notes from call today. @lidel - please amend/comment if I've got anything incorrect or you have additional thoughts.
We're already framing all those menu items under the context of "Current Tab", so it's implicit we're only talking about the page in question (this is also an existing problem: who knows how many folks have accidentally pinned something massive thinking they were only acting on one page).
Given the possible addition of multiple pinning services for the user, PLUS existing confusion of "real pin/low-level pin" vs "pseudo-pin/MFS import", it makes the most sense to keep the actual pinning activity happening entirely in Web UI vs being triggered from Companion. Proposed flow:
Keep Offline Copy ...; helptext would be something like Import all IPFS assets on this tab (e.g. files, images, videos) to your node to have a local copy that's available offline and never thrown away.Queen_Victoria.html into directory /ipfs-companion-imports/en.wikipedia-on-ipfs.org/wiki/ or similarKeep Offline Copy ... of other ipfspedia pages would result in them being saved in a directory structure that matches that of the original site URLNOTE: this does result in low-level pinning being removed from Companion's overall functionality. Are we OK with this? (Suggesting yes, because "I don't understand why my repo is 100GB and GC doesn't change that" is a common new-user complaint and is likely largely triggered by accidental massive low-level pinning. PLUS it removes the need to explain "real pin/low-level pin" vs "pseudo-pin/MFS import" - something fairly nuanced - to early-stage who may not need to understand this.)
I agree:
Keep Offline Copy ... (name TBD) that imports current tab to MFS and opens it in FilesDevil is in the details:
/ipfs-companion-shapshots/{domain}/paths/to/page because /ipfs-companion-imports is time-based, and here we want to maintain caches per specific URLCopy (Snapshot?) to My Files.. ?we can't change asset URLs in HTML, because that would change the CID of cached document, but we could just cache assets under URL-based paths to ensure our node keeps them around (a pragmatic compromise)
This sounds good. Additionally, "capture this web page" is a known feature request, so definitely worth the effort 😊
I think we need to use separate directory
Makes sense. What about Save Page Snapshot... for text?
I'd advise against silently overwriting, since one use case might be archival saves in (for example) a censorship situation where changes over time are important to document.