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 Share Functionality, Optimize DataTable & Fix Critical Bugs #5220

Merged
merged 18 commits into from
Jan 21, 2025

Conversation

berry-13
Copy link
Collaborator

@berry-13 berry-13 commented Jan 8, 2025

Summary

Description:

  • 🎯 Objective: Significantly enhance the Share functionality, optimize data handling, and resolve critical bugs

  • 💥 Error Handling Improvements:

    • 🆕 Introduced ShareServiceError class for detailed error management within api/models/Share.js
  • ID Anonymization Optimization:

    • 🔄 Refactored ID anonymization using memoization to enhance performance in api/models/Share.js
  • 🚀 API Enhancements:

    • 📝 Updated getSharedLinks to enable cursor-based pagination and search in api/models/Share.js
    • 🔄 Refined shared link CRUD operations (create, update, delete) in api/models/Share.js
    • 🔗 Aligned API routes with new shared link management and integrated cursor-based pagination in api/server/routes/share.js [1] [2] [3]
  • 🔧 Schema and Client Updates:

    • 🗑️ Removed isVisible and isAnonymous from shareSchema in api/models/schema/shareSchema.js
    • 📱 Updated ShareButton with useGetSharedLinkQuery for retrieving shared link data and added QR code generation in client/src/components/Conversations/ConvoOptions/ShareButton.tsx
  • 🐛 Bug Fixes & Improvements (Closes [Bug]: Incorrect Title when Sharing the Chat & Managing The Shared Links #5282):

    • 🛠️ Fixed a bug causing ShareLink to be written to the DB prematurely; now written only when generateLink is clicked
    • 🆕 Created a standardized DataTable component for handling infinite items (tested with 100,000 elements with no lag)
    • 🔎 Introduced a new button for deleting links directly from the main share dialogue for improved UI/UX
    • 👁️ Improved overall ShareLink logic with intuitive UI/UX, including displaying QR Codes in the Share Link dialog and conversation origins in the Share Link table
    • ⚙️ Addressed some prompt management UI issues unrelated to this PR's main objective
  • 🔄 Known Issues:

    • 🔍 Ongoing adjustments required for search in DataTable
    • 💾 Further improvements needed for DataTable cache logic

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Testing

Tested main features (Share, Convo, Messages) with:

  • Desktop
    • Chrome
    • Firefox
  • Mobile
    • Brave
    • Internet Samsung

Test Configuration:

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules.

@berry-13 berry-13 changed the title 🔗 feat: Enhance Share Link functionality with QR Code, conditional rendering, and improved pagination 🔗 feat: Enhance Share Functionality, Optimize DataTable & Fix Critical Bugs Jan 12, 2025
@danny-avila
Copy link
Owner

Thanks @berry-13

Please un-draft and mention me when ready!

Also:

This branch has conflicts that must be resolved

@berry-13 berry-13 force-pushed the refactor/share-link branch from 7e28df2 to c255687 Compare January 15, 2025 22:08
@berry-13 berry-13 marked this pull request as ready for review January 15, 2025 22:08
@berry-13
Copy link
Collaborator Author

@danny-avila ready

berry-13 and others added 15 commits January 20, 2025 22:04
…place pageNumber with cursor for improved data fetching
… shared link model and update related components
…d search functionality; update search handling in API and localization
…ty and loading states, optimize AnimatedSearchInput, and refine DataTable scrolling behavior
@danny-avila
Copy link
Owner

@berry-13 fyi qrcode.react was installed in the wrong location

1ecfaf3

@danny-avila danny-avila merged commit fa9e778 into main Jan 21, 2025
4 checks passed
@danny-avila danny-avila deleted the refactor/share-link branch January 21, 2025 14:31
lpirola pushed a commit to lpirola/LibreChat that referenced this pull request Jan 22, 2025
…l Bugs (danny-avila#5220)

* 🔄 refactor: frontend and backend share link logic; feat: qrcode for share link; feat: refresh link

* 🐛 fix: Conditionally render shared link and refactor share link creation logic

* 🐛 fix: Correct conditional check for shareId in ShareButton component

* 🔄 refactor: Update shared links API and data handling; improve query parameters and response structure

* 🔄 refactor: Update shared links pagination and response structure; replace pageNumber with cursor for improved data fetching

* 🔄 refactor: DataTable performance optimization

* fix: delete shared link cache update

* 🔄 refactor: Enhance shared links functionality; add conversationId to shared link model and update related components

* 🔄 refactor: Add delete functionality to SharedLinkButton; integrate delete mutation and confirmation dialog

* 🔄 feat: Add AnimatedSearchInput component with gradient animations and search functionality; update search handling in API and localization

* 🔄 refactor: Improve SharedLinks component; enhance delete functionality and loading states, optimize AnimatedSearchInput, and refine DataTable scrolling behavior

* fix: mutation type issues with deleted shared link mutation

* fix: MutationOptions types

* fix: Ensure only public shared links are retrieved in getSharedLink function

* fix: `qrcode.react` install location

* fix: ensure non-public shared links are not fetched when checking for existing shared links, and remove deprecated .exec() method for queries

* fix: types and import order

* refactor: cleanup share button UI logic, make more intuitive

---------

Co-authored-by: Danny Avila <[email protected]>
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.

[Bug]: Incorrect Title when Sharing the Chat & Managing The Shared Links
2 participants