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

Dynamic Update for folders #5

Open
ahmadassaf opened this issue Mar 2, 2015 · 1 comment
Open

Dynamic Update for folders #5

ahmadassaf opened this issue Mar 2, 2015 · 1 comment

Comments

@ahmadassaf
Copy link
Owner

At the moment we fetch the bookmarks from the Chrome API once and we store in the localstorage. Now, this has to be enhanced for the following reasons

  • The order of the bookmarks will not reflect folders that you bookmarked to recently as it will only remember the order from the first query
  • When a user adds a new bookmark folder he might not see it

Possible Solutions

  • Maybe we can just fetch all the folder when the user activates booklight (performance ?)
  • Add listeners so that when a user adds a new folder it will fetch a new version. Now, this can be done in a nice way if he adds a folder through our interface. I predict some issues handling messaging between background page and normal extension if we want to listen to folder add from somewhere else
  • In the case of just bookmarking (no new folders), how about checking if we can update the timestamp associated with the dateGroupModified in the localstorage ?
@jpeg729
Copy link

jpeg729 commented Mar 28, 2015

Here's my 2c.

For just bookmarking (no new folders), I would add the following to the chrome message listener.

  1. Find the index of the element in booklight.foldersList matching the given request.folder
  2. If found, remove it from the array.
    folderElem = booklight.foldersList.splice(index, 1);
  3. And add it back to the beginning of the array.
    booklight.foldersList.unshift(folderElem);

I don't need to update the dateGroupModified as I don't sort by date.

The difficulty with new folders is adding them to the fuzzy search, and fuse.js docs don't list a public api method to do that.
I'd suggest the following...

  • If step 1 above returns nothing, then reload the list.

Of course, all this breaks down somewhat if someone adds a bookmark from elsewhere, but I think we can assume that if people have this extension, then they will mostly use it.

@ahmadassaf ahmadassaf self-assigned this Jul 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants