Provide better guidance to users when an analysis is shared to avoid unintentional changes being made
Opened this issue · 5 comments
Users need clear guidance about the consequences of editing an analysis after it has been shared (changes made up until each recipient's import time will be seen by the recipient).
We can only assume that if the share link has been copied, then it has been shared. Obviously we can't spy on the user to see if they have sent it to someone. The shared-ness needs to be preserved between visits to the analysis.
There are two parts to this:
Back end
Ticket for this part: VEuPathDB/service-eda#40
Front end
Preliminaries
The new analysis property will go here
Based on the discussion above about the back end, this property can probably be mandatory and old studies will contain false
values even if they have been shared. We will have to be careful to roll out the back end first.
The useAnalysis
hook will need to return a setIsShared
setter.
Upon sharing
- In the share dialogues for both EDA and Map, we need to do
analysis.setIsShared(true)
when the copy button is pressed or if the text is selected - Add the bold danger/safe zone messages to the share dialogue. See the mockup here https://www.figma.com/design/zUxPFmqMhOAyDbhZITj6s9/Share-mechanism-overhaul?node-id=2009%3A44&t=UwHTqvqW5ng3ixU2-1
- Also remove or disable the (x) from the share dialogue (EDA only)
- The red/orange danger button will close the dialogue and continue in the same analysis
- The green button will create a copy and switch to the copy (which will be new and unshared) - make sure the copy is
isShared=false
!! - Colours should come from our regular palette:
coreui/src/definitions/colors.ts
-warning
andsuccess
Indicating isShared state
Two options to run by UX ASAP:
Shared
badge in the map header and in the analysis header (same row as the Share button)- 🔴
- EDA: Share button gets a red dot (tooltip explains that the analysis has been shared, verbiage to be refined later)
- Map: Share item in left hand menu gets a red dot and same tooltip
Note that we may move some Map functions into the header, and this will likely include the Share button, so the red dot would be more visible there.
Upon opening an isShared=true
analysis
Map and EDA
Show a modal that contains only the red and green warnings with the same functionality as above (red=stay, green=copy)
Two followups:
- are there any other analysis schema changes we want to roll out at the same time
- do we want a "never show this again" (for this analysis) checkbox? This would require another analysis property "userHasDismissedShareWarning". Probably overkill?
In the share dialogues for both EDA and Map, we need to do
analysis.setIsShared(true)
when the copy button is pressed or if the text is selected
We should set it if the user copies the selected text (see copy event). In the copy event handler, we can use getSelection to determine if anchorNode is the node containing the text of the share url.
Show a modal that contains only the red and green warnings with the same functionality as above (red=stay, green=copy)
Can we reuse the share dialog, but alter the title of the dialog to something like "Share details". This can be based on isShared
, or maybe we can find something that works in both cases.
We've had some discussion on Slack about having a button to reveal and copy the share link. The link would be revealed without pressing the button if the analysis has already been shared. (The button basically sets isShared
to true
and the link visibility depends on isShared
.)
I think this is probably the best solution. Does anyone have any other suggestions?
I think probably option 1 (share "badge") is better at this point. Even though I don't personally like the proliferation of big buttons/badges, it's better for the map for the badge to be in the header.