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

Feature: bulk creation of bookmarks #1587

Merged

Conversation

ArthurHoaro
Copy link
Member

This changes creates a new form in addlink page allowing to create
multiple bookmarks at once more easily. It focuses on re-using as much
existing code and template component as possible.

These changes includes:

  • a new form in addlink (hidden behind a button by default),
    containing a text area for URL, and tags/private status to apply to
    created links
  • this form displays a new template called editlink.batch, itself
    including editlink template multiple times
  • User interation in this new templates are handle by a new JS script
    (shaare-batch.js) making AJAX requests, and therefore does not need page
    reloading
  • ManageShaareController has been split into 3 distinct controllers:
    • ShaareAdd: displays addlink template
    • ShaareManage: various operation applied on existing shaares
      (change visibility, pin, deletion, etc.)
    • ShaarePublish: handles creation/edit forms and saving Shaare's
      form
  • Updated translations

Fixes #137


The PR is currently in progress because it relies on async retrieval of metadata (#1567 and #1584), but I encourage you to test it and provide any feedback you'd have, especially regarding the UI/UX.

You can find a live demo here: https://shaarli-batch.hoa.ro (demo/demo)

@gruenheit
Copy link

The bulk creation uses the configuration setting "Private links by default > All new links are private by default" even if one decides to toggle the "private" setting to public, it is re-activated with every single step = twice, so this is very annoying!

Shaarli_Next_new_feature_bulk-links_20201010_201333

@ArthurHoaro
Copy link
Member Author

Good catch! Thanks for the report, I'll try to fix that tomorrow.

@ArthurHoaro ArthurHoaro force-pushed the feature/batch-bookmark-creation branch 2 times, most recently from fa862e1 to c4366d4 Compare October 15, 2020 10:00
@ArthurHoaro ArthurHoaro force-pushed the feature/batch-bookmark-creation branch from c4366d4 to e139d8b Compare October 20, 2020 08:32
@leNEKO
Copy link

leNEKO commented Oct 22, 2020

Salut Arthur :)

Nice feature, but maybe it would need some UI feedback when dealing with save all on a big list (a screencast https://webm.red/view/Pc6x.webm)

@ArthurHoaro ArthurHoaro force-pushed the feature/batch-bookmark-creation branch from ec56693 to b22116e Compare October 23, 2020 10:59
@ArthurHoaro
Copy link
Member Author

Merci Nico ! =)

You are right, it's very obvious with a large batch of URLs like shown on your screencast.
I have added a progress bar in the middle of the page, with a darkened background to give some feedback to the user. I have also reduced the loading time by memoizing tag list retrieval.

Note that while it works, my web server (or the social media where we extract metadata) doesn't very much like being hit by 60x2 HTTP requests from the same client a few seconds apart, and I have encountered a time out once.

For large batches I'd recommend using our Python client + REST API, or the import/export format.

This changes creates a new form in addlink page allowing to create
multiple bookmarks at once more easily. It focuses on re-using as much
existing code and template component as  possible.

These changes includes:
  - a new form in addlink (hidden behind a button by default),
containing a text area for URL, and tags/private status to apply to
created links
  - this form displays a new template called editlink.batch, itself
including editlink template multiple times
  - User interation in this new templates are handle by a new JS script
(shaare-batch.js) making AJAX requests, and therefore does not need page
reloading
  - ManageShaareController has been split into 3 distinct controllers:
    + ShaareAdd: displays addlink template
    + ShaareManage: various operation applied on existing shaares
(change visibility, pin, deletion, etc.)
    + ShaarePublish: handles creation/edit forms and saving Shaare's
form
  - Updated translations

Fixes shaarli#137
Reduced additional processing time per links from ~40ms to ~5ms
@ArthurHoaro ArthurHoaro force-pushed the feature/batch-bookmark-creation branch from 5c6d51b to 34c8f55 Compare October 27, 2020 19:13
@ArthurHoaro ArthurHoaro merged commit b2b5ef3 into shaarli:master Oct 27, 2020
@ArthurHoaro ArthurHoaro deleted the feature/batch-bookmark-creation branch October 27, 2020 19:18
nodiscc added a commit that referenced this pull request Feb 2, 2021
nodiscc added a commit that referenced this pull request Dec 4, 2022
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.

batch "add multiple links" feature
3 participants