-
Notifications
You must be signed in to change notification settings - Fork 489
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: improve breadcrumbs functionality #1599
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so awesome 😊 A few notes ...
- It looks possible to drag onto a higher-level directory in a breadcrumb (i.e. the hover underline activates) if one is in a subdirectory, but I believe it's actually just trying to import to the current directory. For example, say I have
orange.png
infiles/cats
but not in the top level. If I am infiles/cats
in Web UI and I drag my local copy oforange.png
tofiles
in the breadcrumb, I get the warning thatA folder with that name already exists
even though it doesn't in the top-level directory. (Note as well: that warning message should read 'item' instead of 'folder' to account for situations like this one.) - Alternate take on this: Maybe it's actually just trying to upload to the currently displayed directory instead of the higher directory? (Having a hard time teasing out what's actually going wrong here.)
- I believe the right-click menu for the breadcrumbs is acting on the currently displayed directory, too. For example: "Copy CID" for a higher-level breadcrumb item actually copies the CID of the currently displayed directory.
- Per Files: icon for parent directory #840 (comment) - would it be possible to display a directory's CID on hover of the breadcrumb, as in the mockup in that comment? That also is a subtle clue that those items are interactive.
- Per Files: icon for parent directory #840 (comment) - once this is all done, we can remove the
..
folder from the main file grid entirely (that was what kicked off this whole exercise, ha ...)
Thank you!
Updated Joyride tour in 91a0d3a - screenshot below: |
824cc0e
to
6afbe9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following right-click actions for breadcrumbs seem to work perfectly 😊
- Share link
- Copy CID
- Inspect
- Rename
- Delete
The following right-click actions don't quite work:
- Pin:
- If a directory is un-pinned, right-clicking its breadcrumb and selecting "Pin" pins it successfully
- If a directory is already pinned, right-clicking breadcrumb still says "Pin" (not "Unpin")
- Download: This downloads a .txt file that actually contains (valid) dir-index-html HTML for displaying the directory! 🤣 Voting that we should just remove this option entirely from breadcrumbs (it doesn't appear when right-clicking a directory in the files table).
Issues with moving files via dragging:
- None 😊 aside from the known issue in Add file overwrite confirmation #1612
Issues with importing files via dragging:
- I can drag a file into the main file list (not the breadcrumb) when I am in the home directory, or home+1 directory (e.g.
home/cats
), but not any deeper (e.g. nothome/cats/moar cats
orhome/cats/moar cats/even moar cats
) -- it gives "folder with that name already exists" error. (Using the "Import" button in any directory works just fine.) - Dragging onto any level of breadcrumb actually just imports it into the presently displayed directory.
Two more things from earlier:
- Per Files: icon for parent directory #840 (comment) - would it be possible to display a directory's CID on hover of the breadcrumb, as in the mockup in that comment? That also is a subtle clue that those items are interactive.
- We're using
folderExists
(line 7 inpublic/locales/foo/notify.json
) for the error whenever a user tries to import a file with an already existing name, too. Should we just make this more general ("an item with that name already exists") or should we add a separateitemExists
i18n key?
Thank you so much for continuing to untangle this 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the improved breadcrumbs! Before we merge, need to address what @jessicaschilling said +
-
Download:
as @jessicaschilling noted, either remove it or fix (I'd vote fix: wire it up to download TAR archive using the same code path as one when a custom directory is created when multiple items are marked with checkboxes and Download is clicked on the bottom drawer) -
Should we just make this more general ("an item with that name already exists") or should we add a separate
itemExists
i18n key?I vote for making it generic, that's what we did in other places.
-
💫 breadcrumb for parent has all the context menu items, but its parents only have three items
– bit confusing, are we able to unify this? -
🐛 Found a D&D bug: while in "Files, click on the "Files" in navbar and keep it clicked, then drag it into Files ;-) –
Unhandled Rejection (TypeError): entry is null
is produced -
🐛 When I right click on a crumb, its menu is displayed. When I click on another, its menu does not display: I see menu for previous crumb + browser-native menu instead. Was able to reproduce in both Firefox and Chromium. Are we able to close existing menu if a different crumb is right-clicked?
-
🐛 💫 dragging file item onto the crumb of parent directory SOMETIMES copies it instead of moving
I've seen Files.mv works different according to target parent directory kubo#7646 but was not able to reproduce it in CLI, then I had it happen once for me in WebUI while testing this PR, but then worked ok.. unclear is its a bug in webui (old dir listing being cached) or ephemeral go-ipfs bug (sometimes not refreshing MFS root CID?). It may be tricky to debug, so as this is just a mild annoyance, and not something that breaks things or lose data, I would not block this PR, and fill separate issue for tracking this.
The logic is that if an item is a directory, you can only do the 3 options, if it's a file you can do the full list
@lidel unfortunately I don't think it's possible with the current solution, since we create an invisible overlay around the dropdown to catch mouse interactions. There's 2 solutions that come to my head:
What option would you prefer? -- Thanks both of you for your deep review 🙏 |
Bummer about the hover being expensive. We can leave it out. |
@rafaelramalho19 IIUC going with "global listener that checks if there was a click the dropdown and just close it if that's the case" would produce better UX:
I rely on your judgement here. If this is a 🕳️ 🐇 and not something you can quickly do, I suggest we ship v2.11 without any context actions on breadcrumbs (its still better than before this PR), and fill separate issue for adding them later 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafaelramalho19 nearly there, probably the last nit: dragging image onto breadcrumb breaks the app – mind applying simililar fix as you did for strings and navbar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick note on the Joyride helptext, otherwise I'm good whenever @lidel is 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafaelramalho19 drag-and-drop works great now, but recent commit introduced regression in how PDF and videos are rendered (images are fine, so we missed it).
before they took entire free space, now they are a narrow column:
before | now |
---|---|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafaelramalho19 thanks, PDF previews look fine again.
Q: you mentioned that we should keep joyride for them, buy I've rebuilt this PR and now I get no context menu on breadcrumbs at all. Mind checking on your end? nvm, it was due to HTTP API I used for testing being slow to respond due to high number of Pins I have in local repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Let's merge?
ps. The slowdown I experienced is not related to this PR, but was already present in go-ipfs.
I filled #1618 to track it.
Notes
Fixes #840.