Bulk create HTML snapshots (#1132)

* Add option to create HTML snapshot for bulk edit

* Add the prerequisite for displaying the "Create HTML Snapshot" bulk action option

* Add test case

This test case covers the scenario where the bulk actions panel displays the corresponding options when the HTML snapshot feature is enabled.

* Use the existing `tasks.create_html_snapshots()` instead of the for loop

* Fix the exposure of `settings.LD_ENABLE_SNAPSHOTS` within `BookmarkListContext`

* add service tests

* cleanup context

---------

Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@gmail.com>
This commit is contained in:
thR CIrcU5
2025-08-13 05:06:23 +08:00
committed by GitHub
parent aaa0f6e119
commit c746afcf76
7 changed files with 189 additions and 2 deletions

View File

@@ -31,6 +31,7 @@ from bookmarks.services.bookmarks import (
share_bookmarks,
unshare_bookmarks,
refresh_bookmarks_metadata,
create_html_snapshots,
)
from bookmarks.type_defs import HttpRequest
from bookmarks.utils import get_safe_return_url
@@ -368,6 +369,8 @@ def handle_action(request: HttpRequest, query: QuerySet[Bookmark] = None):
return unshare_bookmarks(bookmark_ids, request.user)
if "bulk_refresh" == bulk_action:
return refresh_bookmarks_metadata(bookmark_ids, request.user)
if "bulk_snapshot" == bulk_action:
return create_html_snapshots(bookmark_ids, request.user)
@login_required