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

🔖 feat: Enhance Bookmarks UX, add RBAC, toggle via librechat.yaml #3747

Merged
merged 28 commits into from
Aug 22, 2024

Conversation

danny-avila
Copy link
Owner

@danny-avila danny-avila commented Aug 22, 2024

Summary

I implemented several improvements to the Bookmarks feature, including adding Role-Based Access Control (RBAC) and refactoring various components for better performance and maintainability.

  • Added RBAC for bookmarks, allowing administrators to control access to this feature programmatically.
  • Refactored the updateTagsInConvo function to use the tags route.
  • Updated the BookmarkForm component to handle loading states more effectively, without async code.
  • Implemented a general role helper function to support updating access permissions for different permission types.
  • Improved error handling and logging throughout the bookmarks-related code.
  • Updated the Nav and Header components to conditionally render bookmark-related elements based on user permissions.
  • Refactored the useSideNavLinks hook to include bookmarks only when the user has access.
  • Optimized the BookmarkTable component to remove duplicate bookmarks and improve UI consistency.
  • Added better logging for tag/bookmark mutations to aid in debugging.

Documentation updates for this and related changes to prompts coming by Tomorrow 8/22/24

Other Changes

  • Updated the EditIcon component to use React.forwardRef for better compatibility with lib components that pass ref
  • Implemented a new updateConversationSelector in the store to handle conversation updates more efficiently.
  • Updated the PromptsCommand component to handle access permissions for prompts.

Testing:

# librechat.yaml
interface:
  bookmarks: false # then set to `true` to confirm they are re-enabled

…y exists; also close dialog on submission programmatically
@danny-avila danny-avila merged commit f86e9dd into main Aug 22, 2024
4 checks passed
@danny-avila danny-avila deleted the feat/toggle-bookmarks branch August 22, 2024 21:09
kenshinsamue pushed a commit to intelequia/LibreChat that referenced this pull request Sep 17, 2024
…anny-avila#3747)

* chore: update package version to 0.7.416

* chore: Update Role.js imports order

* refactor: move updateTagsInConvo to tags route, add RBAC for tags

* refactor: add updateTagsInConvoOptions

* fix: loading state for bookmark form

* refactor: update primaryText class in TitleButton component

* refactor: remove duplicate bookmarks and theming

* refactor: update EditIcon component to use React.forwardRef

* refactor: add _id field to tConversationTagSchema

* refactor: remove promises

* refactor: move mutation logic from BookmarkForm -> BookmarkEditDialog

* refactor: update button class in BookmarkForm component

* fix: conversation mutations and add better logging to useConversationTagMutation

* refactor: update logger message in BookmarkEditDialog component

* refactor: improve UI consistency in BookmarkNav and NewChat components

* refactor: update logger message in BookmarkEditDialog component

* refactor: Add tags prop to BookmarkForm component

* refactor: Update BookmarkForm to avoid tag mutation if the tag already exists; also close dialog on submission programmatically

* refactor: general role helper function to support updating access permissions for different permission types

* refactor: Update getLatestText function to handle undefined values in message.content

* refactor: Update useHasAccess hook to handle null role values for authenticated users

* feat: toggle bookmarks access

* refactor: Update PromptsCommand to handle access permissions for prompts

* feat: updateConversationSelector

* refactor: rename `vars` to `tagToDelete` for clarity

* fix: prevent recreation of deleted tags in BookmarkMenu on Item Click

* ci: mock updateBookmarksAccess function

* ci: mock updateBookmarksAccess function
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.

1 participant