Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: pop-up menu and share page tweaks #907

Merged
merged 49 commits into from
Jul 8, 2020
Merged

Conversation

jessicaschilling
Copy link
Contributor

@jessicaschilling jessicaschilling commented Jul 1, 2020

In brief

A grab bag of small-but-helpful changes to IPFS Companion's pop-up menu and share page. This PR saves height of the pop-up overall and gets closer visually to browser-native menu appearance, but also clarifies usage (particularly for onboarding users) through repositioning/rewording items and adding additional info (values for "Copy" menu items!).

What's changed in the UI

Pop-up header

  • Consolidate header area to bring on/off and prefs controls into a more universal (top right) location, and save space
  • Make cube/IPFS wordmark combo closer in alignment with the global IPFS logo style overall
  • Bring version number next to "IPFS" for clarity, to save space, and to emphasize the gateway/API/peers status info
  • List peers first in status items list
  • Adds hover titles for all items for increased clarity and beginner-friendliness
  • Remove starfield background to make small text easier to read and to bring more into alignment with our gradual move to a "flatter" look

Pop-up menu

  • Removes "Tools" title from tools menu, and moves tools menu above active tab menu
  • Removes global gateway toggle per conversations with @olizilla and @lidel (don't panic, it's still in preferences page)
  • Renames remaining tools menu items to "Quick Import/Share..." and "Go to My Node..." for clarity and to remove reference to Web UI
  • Renames active tab menu title to "Current tab" and restyles for consistency with native/browser menu styling (Title Case, gray text)
  • Makes menu text smaller throughout for consistency with native/browser menu styling
  • Makes menu spacer line lighter gray for consistency with native/browser menu styling
  • Makes menu items Title Case for consistency with native/browser menu styling (also cleans up native OS notifications for consistency of Title Case and sentence case)
  • Adds option of helperText for all menu items, so it can be used for displaying truncated version of items to be copied (shareable link, content path, CID)
  • Partially links helperText to those items' real values, but doesn't get all the way (see "still missing" below)

Share page

  • Give share page title its own i18n message distinct from menu item title, for clarity

Still missing ... And also ...

  • Copy helper text isn't dynamic! This info (shareable links, IPFS paths, CIDs to appear under "Copy ..." menu items) comes from copier.js, and I hit a wall with this one. @lidel or @olizilla -- might you be willing to update the placeholder text in this PR with real live info?
  • Still a few changes to be made to i18n messages, for clarity in both prefs page and menu items around pinning and local gateway language -- but want to make these in a different PR to avoid merge conflict with style: Preferences page tweaks #903 now that's in master

Screenshots

"On" state for a DNSLink page, the most complex display scenario (L-R: Firefox before, Firefox after, Chrome after)
image

"Off" state (L-R: Firefox before, Firefox after, Chrome after)
image

Share page (L-R: Firefox before, Firefox after)
image

Issues resolved/partially resolved

This work draws from a variety of longstanding "discussion thread" issues and will close or partially close the following:

@jessicaschilling
Copy link
Contributor Author

jessicaschilling commented Jul 1, 2020

@lidel -- for review ... I hope I'm not trampling on your baby!

Bringing this back into WIP for a few more changes.

@jessicaschilling jessicaschilling removed the request for review from lidel July 2, 2020 15:13
@jessicaschilling jessicaschilling changed the title feat: Pop-up header tweaks [WIP] feat: Pop-up header tweaks Jul 2, 2020
@jessicaschilling
Copy link
Contributor Author

(Note: Some of this work will require changing text on the prefs page -- not doing that in this PR to avoid a merge conflict with prior prefs page changes. It's on my list though!)

@jessicaschilling
Copy link
Contributor Author

Hi @lidel -- per our conversation, gently pushing this back over in your direction. Thank you for the review!

@jessicaschilling jessicaschilling changed the title [WIP] feat: Pop-up header tweaks feat: Pop-up header tweaks Jul 3, 2020
This wires up hints to show copied value + adds 30s cache for async
lookup function used by this as a small optimization.
@lidel lidel force-pushed the feat/popup-header-tweaks branch from f14d83f to 34c9b0d Compare July 8, 2020 12:55
@lidel
Copy link
Member

lidel commented Jul 8, 2020

I wired up the hints, they look great!

2020-07-08--14-56-48

Performance caveat when using without redirect

When local gateway is used, lookups are cheap, because data loaded in the tab is already on local IPFS Node

CID resolution is much more expensive when redirect is off (eg. when embedded js-ipfs is used).
In that scenario UI may freeze until IPFS node is able to resolve CID for current URL.

This may take from a few seconds to minutes, and means broken state like this (looks offline but in reality it is running):

need-async-2020-07-08--14-53-14

I'll look into ways we can do CID resolution asynchronously, so its lack does ot block UI render.

This decouples menu render for the time it takes to resolve CID
It also improves UX by disabling the 'Copy CID' action until
initial resolution is successful
@lidel
Copy link
Member

lidel commented Jul 8, 2020

@jessicaschilling I believe I finished implementing missing pieces – please take a quick look if I did not introduce any regression in UI.


FYSA I made CID resolution async so if it takes too long it does not block render of browser action popup.
That ensures smooth experience even when some things are slow.

Below is example of embedded js-ipfs taking long time to resolve DNSLink + traverse DAG to find CID of index.html presented in the browser:

not-ready-2020-07-08--16-07-19

(Feel free to tweak the hint for disabled state if needed)

@jessicaschilling
Copy link
Contributor Author

jessicaschilling commented Jul 8, 2020

@lidel I made a small change to the disabled-state message, but LGTM!

With the aim of not being too much of a burden to translators due to frequent changes, I added 4 small improvements to this PR. Please feel free to merge if you're OK with these.

  1. Clarifies language around public/local gateways on prefs page and location bar (this may cause a minor merge conflict since prefs page has been updated prior to this branch, but an easy one to fix):
    image

image

  1. Standardizes page titles for welcome, prefs and share-file pages, because I just noticed that and it's annoying:
  • Welcome | IPFS Companion
  • Preferences | IPFS Companion
  • Import & Share Files | IPFS Companion
  1. Clarifies tool tip for "Pin IPFS Resource" ... please let me know if I've introduced any ambiguity/inaccuracy here:
    image

  2. Adds tool tips to all remaining pop-up menu items ... please let me know if I've introduced any ambiguity/inaccuracy here:
    image

image

image

image

image

Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I resolved conflicts (preferring versions from this PR) and merged changes from master – might be worth taking a final look at Preferences as its now all up to date with your tweaks @jessicaschilling

add-on/_locales/en/messages.json Outdated Show resolved Hide resolved
@jessicaschilling
Copy link
Contributor Author

@lidel - Thanks for the resolving the conflicts, and supplying better link-copy text. I think we're good to go here!

Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ship it

@lidel lidel changed the title feat: Pop-up menu and share page tweaks feat: pop-up menu and share page tweaks Jul 8, 2020
@lidel lidel merged commit 5f5d9a6 into master Jul 8, 2020
@lidel lidel deleted the feat/popup-header-tweaks branch July 8, 2020 21:41
@Mithgol
Copy link

Mithgol commented Jul 14, 2020

Removes global gateway toggle per conversations with @olizilla and @lidel (don't panic, it's still in preferences page)

Congratulations, y'all have just made some quick decisions (“Does the global gateway currently have a copy of this IPFS resource? Can I share its global URL in Telegram and expect Telegram to generate a preview under my message? Can I share its global URL in Twitter and expect Twitter to generate a Twitter Card under my message?”) significatly less quicker.

This toggle is not even on the first page of the preferences. It becomes necessary to scroll the preferences.

@lidel
Copy link
Member

lidel commented Jul 14, 2020

@Mithgol I make similar checks by opening IPFS resource in Incognito mode. That way you can check how resource loads from public gateway without the need to disable anything in IPFS Companion.

For a longer rationale, see my comment at #910 (comment) – hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants