Add service for loading user bookmarks#1335
Merged
jcscottiii merged 1 commit intomainfrom Mar 31, 2025
Merged
Conversation
This was referenced 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.
eba3668 to
0f3160a
Compare
jrobbins
approved these changes
Mar 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:TaskTrackerproperty,userSavedSearchBookmarksTask, to theAppBookmarkInfointerface. This will hold the status and data of the user's bookmarks loading task.isBusyLoadingBookmarkInfohelper to consider the loading state of theuserSavedSearchBookmarksTask.UserSavedSearchesInternalErrorandUserSavedSearchesUnknownErrorto handle errors specific to fetching the user's bookmark list.webstatus-bookmarks-service:loadingUserSavedBookmarksTask(Lit Task) to fetch all of the current user's saved searches from the backend.willUpdatelifecycle method when theapiClientanduserproperties are available. For theuser, 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)userSavedSearchBookmarksTaskwithin theappBookmarkInfocontext.This is a split up of #1330
Depends on #1334