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

Toggle mode #30

Closed
wants to merge 5 commits into from
Closed

Toggle mode #30

wants to merge 5 commits into from

Conversation

Inego
Copy link
Contributor

@Inego Inego commented Feb 15, 2018

This pull request changes the logic of working with the current URL.

  • The add-url command has been changed to toggle-url command, which now either adds or removes the current URL to/from the link list. This action will also be reported by a short Chrome notification (a notifications permission was added for that purpose).
  • The 'ADD' button now displays as 'ADD' or 'REMOVE' depending on whether the current URL is present in the link list, and functions accordingly.

Also, some minor UI modifications were made:

  • Space after colon was added for the "Total Links" label;
  • Message display for "URL removed" and "Finished!" was removed, since it seems excess or even debuggish.

@napsternxg
Copy link
Owner

Thanks for the PR. I am a bit busy with a few deadlines Will try to have a look at it after next week.

@Inego
Copy link
Contributor Author

Inego commented Mar 21, 2018

Hey @napsternxg, any chance of you reviewing this PR in the foreseeable future?

@napsternxg
Copy link
Owner

napsternxg commented Mar 21, 2018 via email

@Inego
Copy link
Contributor Author

Inego commented Oct 2, 2018

Wow, this PR is still there!

Copy link
Owner

@napsternxg napsternxg left a comment

Choose a reason for hiding this comment

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

Looks good to me.
Can you make the requested changes and then I can test the updated version.

console.log(`URL Item successfully added.`);
};

var add_exists = function(urlItem) {
Copy link
Owner

Choose a reason for hiding this comment

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

I think this feature is a bit misleading given the original implementation showed error message when you tried to add existing URL. I can think of the following workarounds:

  • Ask for permission if trying to remove page which is already added.
  • Change the badge of ReadLater logo to show that the current page is already present. Add a notification for users when the app is updated.

The main idea is that user's should not loose existing URLs when we make new functionality available in the UI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, what this PR does is implement the feature you approved in #28.
Changing this logic will defeat its main purpose.

Copy link
Owner

Choose a reason for hiding this comment

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

Sorry, I forgot about the details.
Is it possible to rename the button to ADD and REMOVE based on the presence of the URL in the storage?
This way the UI will make it more explicit to the user that the URL will be removed.
Also, if the invocation is by keyboard shortcut then we should ask for user confirmation before item removal.

I am trying to ensure this as many users have contacted me about missed URLs because the app instructions were not clear on some parts. It is important to make the usage of the app as simple and explanatory as possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there's no point to discuss this any more.
Thanks for your time!

var add_exists = function(urlItem) {
// Tried to add but it exists --- then remove
console.log("The current page is already present -- trying to remove...")
removeUrlHandler(urlItem.url);
Copy link
Owner

Choose a reason for hiding this comment

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

This is the line which should be altered with some decision rule based on the above comment.


let urlItem = createNewURLItemFromTab(tab);
success_callback(urlItem);
getCurrentTab().then(tab => {
Copy link
Owner

Choose a reason for hiding this comment

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

I like the use of Promise, never used it before in any real project. Thanks. May do a future refactor to convert all callbacks to promises.

@@ -21,7 +21,7 @@
<div id="header"><h1>ReadLater</h1><span>Save now, Read Later</span></div>
<!--<div id="currentLink"></div>-->
<div id="container">
<span id="addBtn">ADD</span>
<span id="toggleBtn">TOGGLE</span>
Copy link
Owner

Choose a reason for hiding this comment

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

Is it possible to rename this button to ADD and REMOVE based on the presence of the URL in the storage?
This way the UI will make it more explicit to the user that the URL will be removed.
Also, if the invocation is by keyboard shortcut then we should ask for user confirmation before item removal.

@Inego Inego closed this Dec 10, 2018
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.

2 participants