Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Added default download path #7023

Merged
merged 2 commits into from
Mar 16, 2017
Merged

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented Feb 3, 2017

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Resolves #2110

Auditors

@bradleyrichter @bsclifton

Test Plan

  • go to the preferences, general tab
  • define your default download path
  • toggle show dialog
  • based on your settings, download dialog should be opened or not
  • if you set to hide download dialog, files should be downloaded automatically to your default download path

@NejcZdovc NejcZdovc added this to the 0.13.3 milestone Feb 3, 2017
@NejcZdovc NejcZdovc self-assigned this Feb 3, 2017
@NejcZdovc NejcZdovc force-pushed the feature/#2110-download branch from 4aebac9 to 4ac876a Compare February 3, 2017 10:43
@NejcZdovc
Copy link
Contributor Author

@bradleyrichter in #2110 you added pencil at the end of the input. Can you please provide an icon for it, if we will use it. For now I set input to read only and when you click on it, dialog is shown automatically.

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

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

Two things I think:

  • @bradleyrichter can we get an icon for editing the path? It feels a little naked without it. Here's a demo:
    screen shot 2017-02-09 at 12 08 18 pm

  • @NejcZdovc Can we get some unit tests? Basically, it would be using the Enzyme library and extending our existing preferences tests to include these two new settings 😄

@NejcZdovc
Copy link
Contributor Author

@bsclifton Sorry I added you as a review too soon. My mistake. This PR is not ready for a final review as you notice there is no test for this new feature. I added label ready-for-review so that @bradleyrichter can look through it and prepare icon for browse/edit. And yes I agree we need to have a browse/edit icon.

@bradleyrichter
Copy link
Contributor

@NejcZdovc SVG icon for the edit (pencil) button attached:

browser_icon_pencil.svg.zip

@NejcZdovc NejcZdovc force-pushed the feature/#2110-download branch 2 times, most recently from 8f3c718 to bd77916 Compare February 13, 2017 08:11
@bbondy bbondy modified the milestones: 0.13.6, 0.13.5 Feb 16, 2017
@bsclifton
Copy link
Member

bsclifton commented Feb 16, 2017

@NejcZdovc was this one done? (or still needing some work?)

@NejcZdovc
Copy link
Contributor Author

@bsclifton I added test's as well, so we are ready for a review

@NejcZdovc NejcZdovc force-pushed the feature/#2110-download branch 3 times, most recently from 04878a9 to 577422d Compare March 3, 2017 06:39
Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

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

Comment left; also added a commit for you to check out 😄 If you rework the action, LMK and I can re-review. Otherwise, you should be good to squash it and this'll be ready for merge

properties: ['openDirectory']
}, (folder) => {
if (Array.isArray(folder) && fs.lstatSync(folder[0]).isDirectory()) {
appActions.changeSetting(settings.DOWNLOAD_DEFAULT_PATH, folder[0])
Copy link
Member

Choose a reason for hiding this comment

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

I think this is fine as-is... but it could be better as it's own discreet action (in the event that we'd like other reducers to be listening). Perhaps an action like defaultDownloadPathChanged

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

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

actually- a few things I just noticed (was too focused on the code). Can you touch these up?

screen shot 2017-03-03 at 1 39 58 am

  • The pencil icon should probably change color when hovered. You should be able to look at other pages for an example (see the bookmarks manager for example).

  • The cursor for the pencil should be pointer I think, to be consistent with other controls. EDIT: it's OK as-is

  • You can also add a -webkit-user-select: none; to prevent the text cursor icon from showing up when the mouse either gets near it or page is click and dragged (and mouse goes near pencil icon) EDIT: to be addressed after Refactor of paymentTab #7481 is merged

@NejcZdovc
Copy link
Contributor Author

@bsclifton First of all sorry, I somehow over looked your second review.

I added hover color effect. Regarding the pointer I remember talking with @bradleyrichter about it for bookmark manager and he said that we should use only color hover and not a pointer. Bookmark manager for example don't have single pointer hover, only color hover. I agree that we should be consistent, so we need a guide line for it.

For user select I suggest to add it after #7481 is merged, because I added aphrodite param for component SettingItem.

@NejcZdovc NejcZdovc force-pushed the feature/#2110-download branch from 58e9152 to a383e96 Compare March 8, 2017 10:51
Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

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

@NejcZdovc I think the approach you're recommending is reasonable 😄

I did notice a problem. When testing on Windows, I noticed that the "Save As..." functionality no longer works. When choosing "Save As...", it should always prompt the user... since they are going to pick the filename to save
screen shot 2017-03-10 at 11 07 49 am

When I picked the "Save As" option, it immediately did the download without prompting ☹️

@NejcZdovc NejcZdovc force-pushed the feature/#2110-download branch from a383e96 to c835413 Compare March 10, 2017 20:37
@NejcZdovc
Copy link
Contributor Author

Just for a reference, @bridiver added flag to handle "Save as" calls brave/muon@de90c69

/**
* Open dialog for default download path setting
*/
defaultDownloadPath: function () {
Copy link
Collaborator

Choose a reason for hiding this comment

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

these no longer have to go in aboutActions and this file should be deprecated. Use appActions for now instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved

@bridiver
Copy link
Collaborator

this will need changes to correspond with my muon updates to correctly handle the prompt

@NejcZdovc NejcZdovc force-pushed the feature/#2110-download branch 3 times, most recently from 0488a54 to d3881eb Compare March 13, 2017 07:31
Resolves brave#2110

Auditors: @bradleyrichter @bsclifton

Test Plan:
- go to preferences, general tab
- define your default download path
- toggle show dialog
- based on your settings, download dialog should be opened or not
- if you set don't show dialog, filse should be downloaded to your default set path

 # Added hover effect
@NejcZdovc NejcZdovc force-pushed the feature/#2110-download branch from d3881eb to 88b44fd Compare March 16, 2017 00:07
@NejcZdovc NejcZdovc requested a review from bsclifton March 16, 2017 00:55
@NejcZdovc
Copy link
Contributor Author

@bsclifton added save prompt for save as. Ready for a review

@bsclifton
Copy link
Member

An area we can improve (cc: @bradleyrichter):

If I have a long path, it gets clipped
screen shot 2017-03-16 at 2 56 24 pm

It looks the exact same in Chrome though, so not a deal-breaker or anything... just an area we could do better 😄
screen shot 2017-03-16 at 2 57 51 pm

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

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

Just tested changes out w/ the latest Muon prebuilt; things worked great 😄 ++++++

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

Successfully merging this pull request may close these issues.

6 participants