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(file-uploader): support drag and drop #2848

Closed

Conversation

asudoh
Copy link
Contributor

@asudoh asudoh commented May 28, 2019

Closes: #2288

Not for this milestone (v10.3), but creating a draft pull request to get designer's input. Notably:

  • Does the color/thickness of the dotted line and hover-over line of drop area look good? Or should we choose some different tokens?
  • The "list of files" UI in the spec has border, whereas the current v10 doesn't. Was it a remaining v10 item?
  • Chose "add" cursor that seems to meet what it does, but I have an impression that the spec may intend custom cursor. If so, where can I grab the custom cursor from?

The latest demo can be seen at: https://deploy-preview-2848--the-carbon-components.netlify.com/component/file-uploader--default.html

Changelog

New

  • {{new thing}}

Changed

  • {{change thing}}

Removed

  • {{removed thing}}

Testing / Reviewing

{{ Add descriptions, steps or a checklist for how reviewers can verify this PR works or not }}

@netlify
Copy link

netlify bot commented May 28, 2019

Deploy preview for the-carbon-components ready!

Built with commit 2564d2d

https://deploy-preview-2848--the-carbon-components.netlify.com

@netlify
Copy link

netlify bot commented May 28, 2019

Deploy preview for carbon-components-react ready!

Built with commit 2564d2d

https://deploy-preview-2848--carbon-components-react.netlify.com

@shixiedesign
Copy link
Contributor

shixiedesign commented May 30, 2019

Hi @asudoh! Thanks for starting on this issue.

  • Here's the drop zone's spec: dotted box border should be 1px, $ui-04, 8px dashes, 4px gaps. The border needs to be 3:1 accessible I believe.
    image

  • Blue drop zone outline looks correct 🎉! 2px, blue. Just need to make sure the color is interactive-03, so the highlight outline is actually #ffffff on dark theme

  • The cursor doesn't have to be custom. However, the add cursor should only appear inside the drop zone. This is currently reversed and should be fixed. The green add sign is a visual indicator to users that they can now "drop", so green add outside drop zone would be wrong. Cursor should be default outside the drop zone.
    May-29-2019 22-01-11

  • Lastly, I think the drop zone needs to be taller to provide sufficiently big target area. I don't have the specific sketchfile too 🤦‍♀ so I'm gonna suggest 256px wide and 96px tall, with an internal padding of 16px all around:
    image

@asudoh asudoh force-pushed the drag-drop-file-uploader branch 6 times, most recently from ecb6b08 to ff9972b Compare May 31, 2019 10:48
@asudoh
Copy link
Contributor Author

asudoh commented May 31, 2019

@shixiedesign Thank you for the design review! - Updated the demo link with most of suggested design change, except the width of the drop container given the original one is wider than 256px. Please let me know if shortening to 256px is more desirable.

I'll get in sync with @emyarod on React implementation. Until then, let me keep this PR draft.

Copy link
Contributor

@shixiedesign shixiedesign left a comment

Choose a reason for hiding this comment

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

Hi @asudoh I spec'ed out the file loader more completely after finding the sketchfile, so a few more small visual fixes:

  • Default width of the drop zone, let's not make it smaller, but make it 320px so it's a nice number divisible by 8.

  • file list's x icon should use color $icon-02
    image

  • this loader should be 16x16 in overall size, with a ring thickness of 3px
    Current
    image
    Should be
    image

  • cursor should turn into "pointing hand" when hovering over the link for upload:
    May-31-2019 11-56-11

  • bug: when dragging+hovering, the blue outline shouldn't cause the text inside to move.
    May-31-2019 11-58-43

  • do we have an error state for the file list? (see below spec img) We should use $support-01 for main error message, detailed error message is $text-01, type size 12px, ui-03 for divider line.

Below is the complete spec for your reference:

image

@netlify
Copy link

netlify bot commented Jun 3, 2019

Deploy preview for carbon-elements ready!

Built with commit 2564d2d

https://deploy-preview-2848--carbon-elements.netlify.com

@asudoh
Copy link
Contributor Author

asudoh commented Jun 3, 2019

@shixiedesign Thank you for the more detailed spec - Updated https://deploy-preview-2848--the-carbon-components.netlify.com/component/file-uploader--default.html upon the update.

One question wrt the invalid state is that whether we need an invalid icon there. I'm wondering this because @emyarod originally had it, which can be seen at https://the-carbon-components.netlify.com/component/file-uploader--example-upload-states.html. I have https://deploy-preview-2848--the-carbon-components.netlify.com/component/file-uploader--example-upload-states.html for now.

@shixiedesign
Copy link
Contributor

@asudoh investigating this right now along with issue #2901 (comment)

@shixiedesign

This comment has been minimized.

@asudoh
Copy link
Contributor Author

asudoh commented Jun 6, 2019

Cool thanks @shixiedesign for specing this and entering the issue!

@asudoh
Copy link
Contributor Author

asudoh commented Jun 26, 2019

Superseded by: #3175

@asudoh asudoh closed this Jun 26, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jun 26, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jun 26, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jun 28, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jun 28, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jul 1, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jul 2, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jul 2, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jul 2, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jul 3, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jul 8, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jul 9, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jul 9, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jul 9, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jul 9, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jul 10, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jul 16, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jul 16, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Jul 23, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Aug 5, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Aug 13, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Aug 13, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Aug 29, 2019
emyarod added a commit to emyarod/carbon that referenced this pull request Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FileUploader] Drag and drop support in file uploader
5 participants