Skip to content

refactor: Omnichannel's tag autocompletes to useInfiniteQuery #35874

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

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

aleksandernsilva
Copy link
Contributor

@aleksandernsilva aleksandernsilva commented Apr 24, 2025

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments


This pull request refactors the Omnichannel's tag autocomplete functionality in the Rocket.Chat repository. The main changes include:

  1. New Custom Hook: Introduces a useTagsList hook in TypeScript using @tanstack/react-query. This hook fetches and manages a paginated list of livechat tags from the /v1/livechat/tags endpoint, supporting filtering by text, department, and an option to view all tags. It also handles infinite scrolling logic.

  2. Component Refactor: Updates the AutoCompleteTagsMultiple component to use the new useTagsList hook, simplifying data fetching and pagination logic. It enhances prop handling by deriving types from the PaginatedMultiSelectFiltered component and allowing pass-through props.

  3. Department Editing Logic: Modifies the logic in the department editing form to determine unit requirements by replacing list.itemCount with list.length.

These changes aim to improve the efficiency and maintainability of the tag autocomplete feature in the Omnichannel module.

Copy link
Contributor

dionisio-bot bot commented Apr 24, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

Copy link

changeset-bot bot commented Apr 24, 2025

⚠️ No Changeset found

Latest commit: a200f05

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

kodus-ai bot commented Apr 24, 2025

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

Copy link
Contributor

github-actions bot commented Apr 24, 2025

PR Preview Action v1.6.1

🚀 View preview at
https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-35874/

Built to branch gh-pages at 2025-04-25 17:45 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link

codecov bot commented Apr 24, 2025

Codecov Report

Attention: Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.

Project coverage is 61.14%. Comparing base (a90d317) to head (a200f05).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #35874      +/-   ##
===========================================
- Coverage    61.15%   61.14%   -0.01%     
===========================================
  Files         3009     3009              
  Lines        71554    71552       -2     
  Branches     16378    16379       +1     
===========================================
- Hits         43758    43752       -6     
- Misses       24830    24834       +4     
  Partials      2966     2966              
Flag Coverage Δ
e2e 57.86% <88.88%> (-0.02%) ⬇️
unit 75.09% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aleksandernsilva aleksandernsilva force-pushed the refactor/tag-autocomplete-query branch from e5b3a29 to cf364fd Compare April 24, 2025 20:43
Copy link

kodus-ai bot commented Apr 25, 2025

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

@aleksandernsilva aleksandernsilva force-pushed the refactor/tag-autocomplete-query branch from 45ba893 to a200f05 Compare April 25, 2025 17:33
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