Skip to content

Add service for loading user bookmarks#1335

Merged
jcscottiii merged 1 commit intomainfrom
jcscottiii/ui-searches-v6.0.1
Mar 31, 2025
Merged

Add service for loading user bookmarks#1335
jcscottiii merged 1 commit intomainfrom
jcscottiii/ui-searches-v6.0.1

Conversation

@jcscottiii
Copy link
Collaborator

@jcscottiii jcscottiii commented Mar 29, 2025

This PR adds a new task in the frontend to support loading a user's saved bookmarks. This is the pre-req step for displaying these bookmarks in the sidebar (next PR).

Main changes:

  • app-bookmark-info-context:
    • Added a new TaskTracker property, userSavedSearchBookmarksTask, to the AppBookmarkInfo interface. This will hold the status and data of the user's bookmarks loading task.
    • Updated the isBusyLoadingBookmarkInfo helper to consider the loading state of the userSavedSearchBookmarksTask.
    • Introduced new error classes: UserSavedSearchesInternalError and UserSavedSearchesUnknownError to handle errors specific to fetching the user's bookmark list.
  • webstatus-bookmarks-service:
    • Added a new loadingUserSavedBookmarksTask (Lit Task) to fetch all of the current user's saved searches from the backend.
    • This task is triggered in the willUpdate lifecycle method when the apiClient and user properties are available. For the user, it is okay if there is an actual User object (means the user has been detected) or null (no user detected after trying. Different from undefined)
    • The results of the task are stored in the userSavedSearchBookmarksTask within the appBookmarkInfo context.

This is a split up of #1330

Depends on #1334

@jcscottiii jcscottiii requested review from KyleJu and jrobbins March 29, 2025 22:59
Base automatically changed from jcscottiii/ui-searches-v6.0.0 to main March 31, 2025 17:44
This PR adds a new task in the frontend to support loading a user's saved bookmarks.
This is the pre-req step for displaying these bookmarks in the sidebar (next PR).

Main changes:
- **`app-bookmark-info-context`:**
    - Added a new `TaskTracker` property, `userSavedSearchBookmarksTask`, to the `AppBookmarkInfo` interface. This will hold the status and data of the user's bookmarks loading task.
    - Updated the `isBusyLoadingBookmarkInfo` helper to consider the loading state of the `userSavedSearchBookmarksTask`.
    - Introduced new error classes: `UserSavedSearchesInternalError` and `UserSavedSearchesUnknownError` to handle errors specific to fetching the user's bookmark list.
- **`webstatus-bookmarks-service`:**
    - Added a new `loadingUserSavedBookmarksTask` (Lit Task) to fetch all of the current user's saved searches from the backend.
    - This task is triggered in the `willUpdate` lifecycle method when the `apiClient` and `user` properties are available. For the `user`, it is okay if there is an actual User object (means the user has been detected) or null (no user detected after trying. Different from undefined)
    - The results of the task are stored in the `userSavedSearchBookmarksTask` within the `appBookmarkInfo` context.
@jcscottiii jcscottiii force-pushed the jcscottiii/ui-searches-v6.0.1 branch from eba3668 to 0f3160a Compare March 31, 2025 17:57
@jcscottiii jcscottiii added this pull request to the merge queue Mar 31, 2025
Merged via the queue into main with commit 07cea5f Mar 31, 2025
6 checks passed
@jcscottiii jcscottiii deleted the jcscottiii/ui-searches-v6.0.1 branch March 31, 2025 23:10
@jrobbins jrobbins mentioned this pull request Apr 2, 2025
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