Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Frontline ticket main#6604

Merged
Enkhtuvshin0513 merged 48 commits intomainfrom
frontline-ticket-main
Nov 4, 2025
Merged

Frontline ticket main#6604
Enkhtuvshin0513 merged 48 commits intomainfrom
frontline-ticket-main

Conversation

@Kato-111
Copy link
Collaborator

@Kato-111 Kato-111 commented Oct 31, 2025

Important

This PR introduces a comprehensive ticketing system with CRUD operations, real-time updates, and UI enhancements, including pipeline and status management, and Facebook integration.

  • Features:
    • Complete ticketing system with CRUD operations, real-time updates, and Kanban board.
    • Pipeline and status management with creation, update, and removal capabilities.
    • UI enhancements including ticket detail sheet, inline editors, and hotkeys.
    • Integration with Facebook for repair actions.
  • Backend:
    • Added GraphQL mutations, queries, and subscriptions for tickets, pipelines, and statuses in mutations.ts, queries.ts, and subscription.ts.
    • Defined models for Ticket, Pipeline, and Status in connectionResolvers.ts.
  • Frontend:
    • Implemented TicketCard, TicketsBoard, and AddTicketForm components for UI.
    • Added SelectAssigneeTicket, SelectDateTicket, and SelectPriorityTicket for ticket attribute selection.
    • Updated navigation and settings pages to include new ticketing features.

This description was created by Ellipsis for bd2f9d3. You can customize this summary. It will automatically update as commits are pushed.


Summary by CodeRabbit

  • New Features
    • Full ticketing subsystem: tickets CRUD, pipelines, statuses, default status seeding, reorderable statuses, pipeline counts on channels.
  • Real-time
    • New subscriptions for ticket, pipeline and status changes (per-item and list updates).
  • UI
    • Tickets navigation/routes renamed; Kanban board, detail sheet, add-ticket flows, inline editors, breadcrumbs, hotkeys, pipeline pages and management UIs.
  • API
    • New GraphQL queries/mutations/types/hooks for tickets, pipelines, statuses, priorities, dates, assignees.
  • Integrations
    • Facebook repair action and supporting UI/hooks.

uuganaa1007 and others added 30 commits October 17, 2025 10:33
….removeStatus, which will lead to infinite recursion. Consider calling a direct delete operation (e.g. deleteOne) and preserving the check for status usage if still needed.
…lity

- Added StatusGroupTemp component for managing ticket statuses.
- Created StatusInline and Statuses components for inline display and listing of statuses.
- Introduced constants for ticket status types and default statuses.
- Implemented GraphQL mutations and queries for adding, updating, and deleting ticket statuses.
- Developed hooks for managing ticket status operations (add, update, delete, get).
- Updated ChannelDetailsPage, ChannelMembersPage, ChannelsSettingsIndexPage, and PipelineDetailPage for new structure.
- Added PipelinesPage for managing pipelines associated with channels.
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Changes requested ❌

Reviewed everything up to adaba51 in 12 minutes and 10 seconds. Click for details.
  • Reviewed 7807 lines of code in 138 files
  • Skipped 1 files when reviewing.
  • Skipped posting 28 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. backend/plugins/frontline_api/src/modules/ticket/graphql/schemas/pipeline.ts:12
  • Draft comment:
    Consider using standard units and ensure consistency for field types.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
2. frontend/plugins/frontline_ui/src/modules/FrontlineNavigation.tsx:50
  • Draft comment:
    Navigation for 'Tickets' is added correctly. Verify routing consistency with Main.tsx.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. frontend/plugins/frontline_ui/src/modules/FrontlineSubGroups.tsx:10
  • Draft comment:
    Conditional rendering for tickets vs channels is clear; maintain consistent naming.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
4. frontend/plugins/frontline_ui/src/modules/Main.tsx:15
  • Draft comment:
    Added route for 'tickets' seems correct. Verify no conflicts with existing routes.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
5. frontend/plugins/frontline_ui/src/modules/channels/components/settings/breadcrumbs/ChannelDetailBreadcrumb.tsx:12
  • Draft comment:
    Skeleton height uses class 'h-[1lh]'; likely a typo. Consider using a valid unit like 'h-6'.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The lh unit is a valid CSS unit that represents line-height, so h-[1lh] would set the height to 1 line-height. This could be intentional to make the skeleton match the height of text. However, the comment suggests it's a typo. Without more context about whether the codebase uses lh units elsewhere or what the intended design is, it's hard to say definitively. The comment is making an assumption that this is a typo, but it could be intentional. The author may have deliberately chosen 1lh to match text height. This seems like a speculative comment - "likely a typo" indicates uncertainty. The lh unit is actually valid CSS (line-height unit), so this might not be a typo at all. The author could have intentionally used 1lh to make the skeleton height match the line height of text, which would be a reasonable design choice for a breadcrumb component. The comment is speculative ("likely a typo") rather than definitive. While lh is technically valid, it's uncommon and could easily be a typo for h-6 or similar. However, the rules state I should not make speculative comments, and this comment itself is speculative ("likely a typo"). Without strong evidence that this is definitely wrong, I should delete it. This comment is speculative and assumes the code is wrong without strong evidence. The lh unit is valid CSS, and the author may have intentionally used it. Following the rule against speculative comments, this should be deleted.
6. frontend/plugins/frontline_ui/src/modules/channels/components/settings/channels-list/Channels.tsx:11
  • Draft comment:
    Ensure proper error handling if channel data is missing when navigating.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
7. frontend/plugins/frontline_ui/src/modules/pipelines/components/CreatePipeline.tsx:29
  • Draft comment:
    Hotkey scope logic is well implemented. Double-check consistency of scope usage across modules.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
8. frontend/plugins/frontline_ui/src/modules/pipelines/components/PipelinesList.tsx:11
  • Draft comment:
    Typo in className: 'text-xlfont-semibold' should likely be 'text-xl font-semibold'.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
9. frontend/plugins/frontline_ui/src/modules/ticket/components/ticket-detail/TicketFields.tsx:43
  • Draft comment:
    Verify if 'content.pop()' is intentional to remove the last block; ensure it meets business requirements.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to verify their intention and ensure it meets business requirements, which violates the rules. It does not provide a specific suggestion or ask for a specific test to be written.
10. frontend/plugins/frontline_ui/src/modules/ticket/hooks/useGetTickets.tsx:60
  • Draft comment:
    Pagination and subscription merge logic is well-implemented; consider memoizing variables to reduce re-renders.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
11. backend/plugins/frontline_api/src/apollo/resolvers/mutations.ts:18
  • Draft comment:
    Typographical: The entry PipelineMutations uses a different capitalization than the other mutations (e.g., facebookMutations, callMutations, imapMutations). If this isn’t intentional due to a naming convention, please consider using consistent camelCase (e.g., pipelineMutations).
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This is a code quality/consistency comment. The observation is factually correct - there is an inconsistency in naming. However, I need to consider: (1) The imported name PipelineMutations comes from the source file @/ticket/graphql/resolvers/mutations/Pipeline - the author didn't choose this name, they're importing what exists. (2) The comment suggests changing it to pipelineMutations, but that would require either renaming the export in the source file OR using an import alias like import { PipelineMutations as pipelineMutations }. (3) This is a minor style issue that doesn't affect functionality. (4) The rules say "Comments that suggest code quality refactors are good! But only if they are actionable and clear." This is actionable (use an alias), but it's also quite minor and the author may have intentionally kept the original export name. The comment is technically correct about the inconsistency, and it is actionable (the author could use an import alias). This could be considered a valid code quality suggestion. The inconsistency is visible and could confuse future developers about naming conventions. While the comment is technically correct and actionable, it's a very minor style issue. The author is importing an existing export and may have intentionally preserved the original name. The rules emphasize removing comments unless there's STRONG EVIDENCE they're correct and important. A naming inconsistency that doesn't affect functionality and might be intentional doesn't meet the bar for "clearly a code change required." This is a minor style/consistency comment that, while technically correct, doesn't represent a clear code change requirement. The author is importing existing exports and may have intentionally kept the original naming. This falls into the category of "not clearly required" and should be deleted.
12. backend/plugins/frontline_api/src/modules/ticket/db/models/Ticket.ts:88
  • Draft comment:
    Typographical: The error message here ('ticket not found') uses lowercase 't', whereas in the getTicket method the error message is 'Ticket not found'. Consider capitalizing for consistency.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This is a style/consistency comment about error message capitalization. While it does point out a real inconsistency, I need to consider: (1) Is this actionable? Yes, it's a simple fix. (2) Is it important? It's very minor - just capitalization consistency. (3) Does it violate the rules? The rules say "Do NOT make comments that are obvious or unimportant." This seems to fall into the "unimportant" category. Error message capitalization is a very minor style issue that doesn't affect functionality. (4) The comment is about code that was changed (new file), so it passes that test. However, this is the kind of nitpicky comment that could be annoying to a developer and doesn't really improve code quality in a meaningful way. While this is technically an inconsistency, it's extremely minor and doesn't affect functionality. Some might argue that consistency in error messages is important for user experience and code quality, even if it's just capitalization. The comment is actionable and clear. Even though the comment is actionable, it falls squarely into the "unimportant" category mentioned in the rules. Error message capitalization is a trivial style issue that doesn't warrant a review comment. If this were part of a broader style guide enforcement, it might be different, but as a standalone comment it's too nitpicky. This comment should be deleted. While it correctly identifies an inconsistency, it's too minor and unimportant to warrant a review comment. It's the kind of nitpicky style issue that should either be caught by a linter or ignored.
13. backend/plugins/frontline_api/src/modules/ticket/graphql/schemas/pipeline.ts:46
  • Draft comment:
    Typo: In the 'createPipeline' mutation, consider adding a space after the colon in 'pipelineId:String' for consistency. It should be 'pipelineId: String'.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 15% vs. threshold = 50% This is a legitimate formatting inconsistency - the file has pipelineId:String and statusId:String without spaces, while all other type annotations have spaces after the colon. However, the rules state "Do NOT make comments that are obvious or unimportant." This is a very minor formatting issue that doesn't affect functionality. GraphQL parsers will handle both formats fine. The comment is also only pointing out one instance when there are actually multiple instances of this pattern in the file (lines 30, 46, 47). This seems like something a linter or formatter would catch, and it's a very minor style issue that doesn't impact code quality significantly. While this is technically a valid observation about inconsistent formatting, it could be argued that maintaining consistent code style is important for readability and maintainability. The comment is actionable and clear about what needs to be fixed. Even though consistent formatting has some value, this is an extremely minor and obvious issue that falls under "unimportant" comments. It's purely cosmetic, doesn't affect functionality, and would typically be caught by automated formatting tools. The rules explicitly state not to make obvious or unimportant comments. This comment should be deleted. While it correctly identifies a formatting inconsistency, it's too minor and obvious to warrant a review comment. This type of spacing issue is trivial and would typically be handled by automated linters or formatters.
14. backend/plugins/frontline_api/src/modules/ticket/graphql/schemas/pipeline.ts:47
  • Draft comment:
    Typo: In the 'createPipeline' mutation, consider adding a space after the colon in 'statusId:String' for consistency. It should be 'statusId: String'.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 15% vs. threshold = 50% This is a minor formatting/style issue. While it's technically correct that adding a space would be more consistent with most of the file, the file already has multiple instances of this inconsistency (lines 30, 46, 47). The comment is about a very minor style issue that doesn't affect functionality. According to the rules, I should not comment on things that are "obvious or unimportant." This is a trivial formatting issue. Additionally, this kind of formatting would typically be caught by a linter or formatter if the project cares about it. The comment is technically correct but falls into the category of "obvious or unimportant" - it's just whitespace formatting. The comment is technically correct and does point out a real inconsistency. Code quality and consistency are important, and this is an actionable suggestion. Perhaps this kind of consistency fix is valuable for maintainability. While consistency is valuable, this is an extremely minor whitespace issue that doesn't affect functionality at all. The file already has this same inconsistency in multiple places (lines 30, 46, 47), so fixing just one instance doesn't really solve the problem. This falls squarely into "obvious or unimportant" territory - it's just a missing space. This comment should be deleted. It's about a trivial whitespace formatting issue that doesn't affect functionality. While technically correct, it violates the rule about not making "obvious or unimportant" comments. If this matters, it should be caught by automated formatting tools.
15. backend/plugins/frontline_api/src/modules/ticket/graphql/schemas/status.ts:26
  • Draft comment:
    There is an extra whitespace before the comma in the parameter list of the query 'getTicketStatusesByType'. Consider removing the extra space: change "(pipelineId: String! , type: Int!)" to "(pipelineId: String!, type: Int!)".
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 15% vs. threshold = 50% This comment is about a very minor whitespace/formatting issue. While technically correct, I need to consider if this violates the rule "Do NOT make comments that are obvious or unimportant." A single extra space before a comma is extremely minor and would not affect the GraphQL schema functionality at all. This is the kind of thing that could be caught by a linter or formatter, and is arguably too trivial to warrant a manual review comment. The rules emphasize not making obvious or unimportant comments, and this seems to fall into that category - it's a nitpick about spacing that has no functional impact. However, code consistency and style do matter for maintainability, and if the codebase has a standard of no spaces before commas, this could be a valid style correction. The comment is actionable and clear, which the rules say is good for code quality refactors. While consistency matters, this is such a minor formatting issue that it falls under "obvious or unimportant" comments. This is the type of thing automated formatters handle, and spending human review time on a single space character is not valuable. The rules explicitly state not to make obvious or unimportant comments, and a single whitespace character definitely qualifies as unimportant. This comment should be deleted because it's about an unimportant formatting detail (a single extra space) that doesn't warrant manual review attention. It violates the rule against making obvious or unimportant comments.
16. backend/plugins/frontline_api/src/modules/ticket/graphql/schemas/ticket.ts:59
  • Draft comment:
    Typographical inconsistency: In the 'createTicketParams' definition, 'pipelineId:String' is missing a space after the colon. For consistency with other type definitions (e.g., in 'updateTicketParams'), please change it to 'pipelineId: String'.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This is a valid observation about an inconsistency in the code. The comment identifies a real formatting issue where line 59 lacks a space after the colon while all other similar declarations have it. However, I need to consider whether this is too minor to warrant a comment. The rules say not to make comments that are "obvious or unimportant." A missing space is quite minor and might be considered unimportant. On the other hand, consistency in code formatting is generally valued, and this is a clear, actionable suggestion. GraphQL schema definitions should be consistent. This isn't something that would be caught by a build necessarily, depending on the linter configuration. The comment is clear, actionable, and points to a real inconsistency. This is an extremely minor formatting issue that doesn't affect functionality. Many teams would consider this too trivial for a PR comment, especially if there's a linter or formatter that should catch it. The comment might be seen as nitpicky. While minor, code consistency is important for maintainability, and this is a clear, objective inconsistency within the same file. The comment is actionable and specific. However, given the rules emphasize not making "obvious or unimportant" comments, and this is purely cosmetic with no functional impact, it leans toward being unimportant. This comment identifies a real but very minor formatting inconsistency. Given the rules against making "obvious or unimportant" comments, and considering this is purely cosmetic with no functional impact, I should delete this comment. It's the type of thing that should be caught by automated formatting tools rather than manual review.
17. frontend/plugins/frontline_ui/src/modules/channels/components/settings/breadcrumbs/ChannelDetailBreadcrumb.tsx:12
  • Draft comment:
    Typo detected: The Skeleton component's height class 'h-[1lh]' in line 12 appears to be incorrect. Did you mean 'h-[1rem]' or another valid height value?
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 15% vs. threshold = 50% The lh unit is a valid CSS unit introduced in CSS Values and Units Module Level 4, representing the line-height of an element. Using h-[1lh] in Tailwind's arbitrary value syntax is perfectly valid and would set the height to match one line height, which makes semantic sense for a skeleton loader that's replacing text content. The comment assumes this is a typo for h-[1rem], but these are different units with different purposes. The author likely chose 1lh intentionally to match the height of the text it's replacing. This comment would incorrectly suggest changing working, intentional code. I might be wrong if the erxes-ui library or the project's Tailwind configuration doesn't support the lh unit, or if older browsers that don't support lh are a concern. The comment could be correct if this project has specific constraints I'm not aware of. While browser support could be a concern, the comment doesn't mention that - it simply calls it a typo and suggests h-[1rem] as an alternative. If browser support were the issue, the comment should have been framed that way. Without evidence that lh units are unsupported in this codebase, I should assume the author knew what they were doing when using a valid CSS unit. The comment should be deleted. h-[1lh] uses the valid CSS lh (line-height) unit, which is appropriate for a skeleton loader replacing text. The comment incorrectly assumes this is a typo without strong evidence.
18. frontend/plugins/frontline_ui/src/modules/channels/components/settings/members/Members.tsx:128
  • Draft comment:
    Typo: Extra spaces found in the className string ("px-2 "). Consider removing the additional space for consistency.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The comment is about code that was changed in the diff (a new line added). It identifies what appears to be extra whitespace in a className string. However, looking at the broader context, I see that line 131 also has trailing space: className="border-none w-8 ", and even line 86 in the non-skeleton code has trailing space: className="border-none px-2 w-52 ". This suggests it might be an intentional pattern or at least consistent with the existing code style. The comment is very minor - extra whitespace in a className string doesn't affect functionality. According to the rules, I should not make comments that are "obvious or unimportant" and this seems to fall into that category. It's a very minor style issue that doesn't affect code behavior. While the extra spaces are technically present, this is an extremely minor style issue that has no functional impact. The pattern appears somewhat consistent in the file (other lines also have trailing spaces), suggesting this might even be intentional formatting. This type of nitpicky comment may not be worth the PR author's time. You're right that this is a very minor issue. Even though the comment is technically correct about the extra spaces, it falls under the category of "obvious or unimportant" comments that should not be made. The functional impact is zero, and it's the kind of thing that could be handled by automated formatting tools rather than manual review. This comment should be deleted. While technically correct about extra spaces, it's too minor and unimportant to warrant a review comment. It has no functional impact and falls under the rule against making obvious or unimportant comments.
19. frontend/plugins/frontline_ui/src/modules/channels/components/settings/members/Members.tsx:131
  • Draft comment:
    Typo: Trailing space in the className string ("w-8 "). Consider removing the extra whitespace.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 15% vs. threshold = 50% This is a very minor code quality issue - trailing whitespace in a className string. While technically correct, this falls into the category of "obvious or unimportant" comments. Trailing spaces in className strings don't affect functionality (CSS class names are trimmed). This is the type of thing that should be caught by a linter or prettier, not in code review. The comment is about a change (the line was added), so it passes that test. However, it's extremely minor and not actionable in a meaningful way - it doesn't affect code behavior or maintainability in any significant way. This could be part of a broader code quality standard, and fixing small issues like this could prevent them from accumulating. Also, I notice there are multiple instances of trailing spaces in the file (lines 109, 128, 131), so maybe this is worth addressing systematically. While consistency is valuable, the rules explicitly state not to make comments that are "obvious or unimportant." Trailing whitespace in className strings is cosmetic and doesn't affect functionality. If this were a real concern, it should be handled by automated tooling (linters/formatters), not manual code review. The comment doesn't meet the bar of being clearly important enough to warrant human attention. This comment should be deleted. It's about a trivial cosmetic issue (trailing whitespace) that doesn't affect functionality and should be handled by automated tooling rather than manual code review. It falls under the category of "obvious or unimportant" comments that the rules explicitly say to avoid.
20. frontend/plugins/frontline_ui/src/modules/pipelines/components/CreatePipelineForm.tsx:18
  • Draft comment:
    Typographical note: There is an inconsistency in the capitalization of the pipeline field. The label 'Pipeline name' (line 18) is styled in lowercase while the corresponding description uses 'Pipeline Name' (line 20). Consider using a consistent capitalization scheme.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 15% vs. threshold = 50% This is a very minor issue - the inconsistency is between a visible label and a screen-reader-only description. While consistency is good, this falls into the "obvious or unimportant" category mentioned in the rules. The comment doesn't point to a functional bug or significant code quality issue. It's essentially a nitpick about capitalization in hidden text. The rules specifically say "Do NOT make comments that are obvious or unimportant." This seems to fall into that category - it's an extremely minor stylistic inconsistency that has no functional impact. However, accessibility is important, and screen reader users would hear this inconsistency. Maintaining consistency in accessibility text could be considered a quality issue. Also, the comment does identify a real inconsistency that exists in the code. While accessibility is important, this is still an extremely minor issue - just a capitalization difference in descriptive text. The rules explicitly state not to make obvious or unimportant comments, and this falls into that category. It's not a functional bug, security issue, or significant code quality problem. This comment should be deleted. It's pointing out an extremely minor capitalization inconsistency in screen-reader-only text, which falls under "obvious or unimportant" comments that should not be made according to the rules.
21. frontend/plugins/frontline_ui/src/modules/pipelines/components/CreatePipelineForm.tsx:35
  • Draft comment:
    Typographical note: The field label for description is written as 'description' (line 35). For consistency and readability, consider capitalizing it as 'Description'.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This is a style/consistency comment about capitalization. The rules state "Do NOT make comments that are obvious or unimportant." This is a very minor stylistic issue - capitalizing a label. While there is technically an inconsistency, this is the kind of thing that could be considered obvious or unimportant. However, the rules also say "Comments that suggest code quality refactors are good! But only if they are actionable and clear." This comment is actionable and clear. The question is whether this rises to the level of importance to warrant a comment. Given that it's about UI text consistency and is quite minor, and the rules emphasize not making obvious or unimportant comments, I lean toward this being too minor to keep. This is a legitimate inconsistency in the code, and consistency in UI labels is generally good practice. The comment is actionable and provides a clear suggestion. Perhaps this isn't as "obvious or unimportant" as I initially thought, since maintaining consistent capitalization in user-facing text is a reasonable quality standard. While consistency is good, this is an extremely minor stylistic issue about capitalizing a single word in a label. The rules emphasize not making obvious or unimportant comments, and this falls into that category. It's the kind of thing that could be caught in a style guide or linter, not something that needs manual review attention. This comment is too minor and unimportant to keep. While technically correct about the inconsistency, capitalizing a label is an obvious stylistic fix that doesn't warrant a review comment. I should delete this comment.
22. frontend/plugins/frontline_ui/src/modules/pipelines/hooks/useAddPipeline.tsx:3
  • Draft comment:
    The file is named useAddPipeline.tsx, but the exported hook is named usePipelineAdd. Please confirm if this naming mismatch is intentional or if it should be aligned to avoid confusion.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This comment violates the rule "Do NOT ask the PR author to confirm their intention, to explain, to double-check things, to ensure the behavior is intended". The comment is asking for confirmation rather than stating that something should be changed. While there is a legitimate naming inconsistency, the comment is phrased as a question asking the author to confirm their intention. According to the rules, comments should not ask for confirmation or explanation - they should only be made when there is clearly a code change required. If this were phrased as "The hook name should match the filename" it might be more actionable, but as written it's asking for confirmation. The naming inconsistency is a real issue that could cause confusion for developers trying to import this hook. It's a legitimate code quality concern that should probably be addressed, and the comment is about code that was changed (new file). While the naming inconsistency is real, the comment explicitly asks the author to "confirm if this naming mismatch is intentional", which directly violates the rule against asking authors to confirm their intention. The comment should either state definitively that the names should be aligned, or not be made at all. As written, it's a request for clarification rather than actionable feedback. Delete this comment because it asks the author to confirm their intention rather than providing clear, actionable feedback. The phrasing "Please confirm if this naming mismatch is intentional" violates the rule against asking for confirmation or explanation.
23. frontend/plugins/frontline_ui/src/modules/status/graphql/query/getTicketStatusesByPipelines.ts:4
  • Draft comment:
    The GraphQL query name getTicketStatusesChoicesPipeline appears to be inconsistent with the file name and exported constant (which use getTicketStatusesByPipelines / GET_TICKET_STATUS_BY_PIPELINE). Is this an unintended typographical error? Please confirm the intended naming.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The comment identifies what appears to be a naming inconsistency. However, the comment ends with "Is this an unintended typographical error? Please confirm the intended naming." This is explicitly asking the author to confirm their intention, which violates the rules. The rules state: "Do NOT ask the PR author to confirm their intention, to explain, to double-check things, to ensure the behavior is intended." While there may be a legitimate naming inconsistency here, the comment is phrased as a question asking for confirmation rather than stating a clear issue that needs to be fixed. The comment is speculative ("appears to be") and asks for confirmation rather than being definitive. The naming inconsistency could be intentional - perhaps the GraphQL query on the backend is actually named "getTicketStatusesChoicesPipeline" and the file/constant names are just descriptive wrappers. Without seeing the backend schema or other parts of the codebase, I can't be certain this is actually an error. That's a valid point - the GraphQL query name must match the backend schema exactly, so the query name "getTicketStatusesChoicesPipeline" is likely correct as-is. The file and constant names are just frontend conventions and may intentionally differ. The comment asks for confirmation rather than identifying a definite issue, which violates the rules. This comment should be deleted because it asks the PR author to confirm their intention ("Please confirm the intended naming"), which explicitly violates the rules. Additionally, without seeing the backend GraphQL schema, we cannot determine if this is actually an error - the query name must match the backend.
24. frontend/plugins/frontline_ui/src/modules/ticket/components/TicketsBoard.tsx:132
  • Draft comment:
    Typo: Consider renaming 'previoustickets' to 'previousTickets' for clarity.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This is a code quality/style comment about naming conventions. The rules state that "Comments that suggest code quality refactors are good! But only if they are actionable and clear." This comment is actionable and clear - it's a simple variable rename. However, I need to consider: 1) Is this obvious or unimportant? Variable naming consistency is generally considered important for code maintainability. 2) The variable is only used locally within a small scope (lines 132-136), so the impact is limited. 3) There are multiple similar issues in the file (setAllticketsMap, newtickets, setOpenCreateticket), so singling out just this one seems inconsistent. 4) This is a minor style issue that doesn't affect functionality. The rules say "Do NOT make comments that are obvious or unimportant" - this could be considered relatively unimportant since it's a local variable with limited scope. While naming consistency is generally good practice, this is a very minor style issue on a local variable with limited scope. The comment only addresses one of several similar issues in the file, which makes it seem arbitrary. Additionally, this could be considered "obvious" - any developer reviewing their own code or using a linter would likely catch this. Although the comment is actionable and clear, it falls into the category of "obvious or unimportant" issues that the rules explicitly say not to comment on. The variable is local, the typo doesn't affect functionality, and there are multiple similar issues in the file that aren't being addressed. This makes the comment seem nitpicky rather than substantively helpful. This comment should be deleted. While it's technically correct, it's a minor style issue on a local variable that falls under "obvious or unimportant" comments that should not be made according to the rules. The comment is also inconsistent since there are other similar naming issues in the file.
25. frontend/plugins/frontline_ui/src/modules/ticket/components/TicketsBoard.tsx:145
  • Draft comment:
    Typo: 'newtickets' should likely be 'newTickets' to follow camelCase conventions.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The comment is pointing out a legitimate code quality issue - inconsistent naming conventions. However, I need to check the rules carefully. The rules say "Comments that suggest code quality refactors are good! But only if they are actionable and clear." This comment is actionable and clear - it's asking to rename a variable to follow camelCase. However, the rules also say "Do NOT comment unless there is clearly a code change required" and "Do NOT make comments that are obvious or unimportant." A variable naming convention issue like this is relatively minor and could be considered "obvious" - a linter would typically catch this. The rules also say to assume comments are incorrect by default unless there's STRONG EVIDENCE they are correct. While the comment is technically correct about the naming convention, it's a very minor style issue in a brand new file, and there are multiple other similar issues in the same file (previoustickets, setAllticketsMap, setOpenCreateticket) that weren't flagged, making this comment inconsistent. This is a legitimate code quality issue that improves code consistency and readability. The comment is actionable and clear. However, it's a minor style issue that would typically be caught by a linter, and the automated tool only flagged one of several similar issues in the file, making it inconsistent. While the comment is technically correct and actionable, it falls into the category of "obvious" issues that should be caught by automated tooling like linters or formatters. The rules explicitly state not to make obvious comments, and naming convention issues are typically handled by linters. Additionally, the inconsistency of only flagging one of multiple similar issues suggests this isn't a critical concern. This comment should be deleted. While it's technically correct about the naming convention, it's a minor, obvious style issue that should be caught by linters rather than code review. The rules explicitly say not to make obvious or unimportant comments.
26. frontend/plugins/frontline_ui/src/modules/ticket/components/TicketsBoard.tsx:234
  • Draft comment:
    Typo: 'setOpenCreateticket' seems mis-capitalized; consider renaming it to 'setOpenCreateTicket' for consistency.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This is a code quality/style comment about variable naming. The rules state that "Comments that suggest code quality refactors are good! But only if they are actionable and clear." However, I need to consider: 1) This is a new file, so all the code is new. 2) The naming inconsistency exists, but there are multiple similar cases in the file. 3) This is a relatively minor style issue - the code will work fine either way. 4) The comment is about a local variable name, not a public API. 5) Most importantly, the rules say "Do NOT comment unless there is clearly a code change required" and "Do NOT make comments that are obvious or unimportant." A variable naming style preference, especially when the pattern is used consistently throughout the file, falls into the category of "not clearly required" and potentially "unimportant." The naming inconsistency is real and the suggestion would improve code consistency with common conventions. If this were the only instance, it might be worth fixing. The comment is actionable and clear about what to change. While the comment is technically correct and actionable, it's a minor style issue that doesn't affect functionality. The rules explicitly state not to make comments that are "obvious or unimportant," and variable naming style preferences generally fall into this category unless they cause actual confusion or bugs. Additionally, the same pattern appears multiple times in the file, suggesting this might be intentional or at least consistent within this file's context. This comment should be deleted. It's a minor style/naming preference that doesn't represent a clear code quality issue requiring change. The rules emphasize not commenting unless there's clearly a code change required, and a variable naming style preference doesn't meet that threshold.
27. frontend/plugins/frontline_ui/src/modules/ticket/components/ticket-selects/SelectStatusTicket.tsx:270
  • Draft comment:
    Typo: Consider renaming 'fallBackStatus' to 'fallbackStatus' (all lowercase 'b') for consistency with common naming conventions.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This is a code quality/style comment about naming conventions. The rules state that "Comments that suggest code quality refactors are good! But only if they are actionable and clear." This comment is both actionable (rename the variable) and clear. However, I need to consider if this is "obvious or unimportant" - the rules say "Do NOT make comments that are obvious or unimportant." A variable naming convention issue like this is relatively minor and could be considered unimportant. It's not a bug, it doesn't affect functionality, and it's a very small style inconsistency. The codebase might even have other instances of similar naming patterns. This seems like a nitpick that doesn't provide significant value. While the comment is technically correct about naming conventions, this is an extremely minor style issue that doesn't affect functionality. The rules explicitly state not to make comments that are "obvious or unimportant," and a single letter capitalization in a variable name falls into the "unimportant" category. This is the kind of thing that could be caught by a linter if the team cares about it. The critique is valid - this is indeed a very minor style issue. While code quality comments are encouraged if actionable and clear, this particular issue is too trivial to warrant a PR comment. It's not a significant code quality improvement, just a minor stylistic preference about one letter's capitalization. This comment should be deleted. While technically correct about naming conventions, it's too minor and unimportant to warrant a PR comment. It's a nitpick about a single letter's capitalization that doesn't affect code functionality or readability in any meaningful way.
28. frontend/plugins/frontline_ui/src/pages/TicketIndexPage.tsx:14
  • Draft comment:
    There appears to be an unnecessary trailing space in the className attribute for Breadcrumb.List (className="gap-1 "). Please consider removing the trailing space to avoid potential unintended styling issues.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The comment is about a change in the diff - the trailing space was added in this PR. However, I need to consider the rules: 1) This is a minor code quality issue that could be considered "obvious or unimportant", 2) Trailing spaces in className strings typically don't cause styling issues in most CSS frameworks (they're trimmed), 3) This could be considered a trivial issue that might be caught by linters, 4) The comment does suggest a clear code change (removing the space), which is actionable. The question is whether this rises to the level of being important enough to comment on, or if it's too trivial. This is a very minor whitespace issue that likely has no functional impact. Most CSS frameworks and browsers handle trailing spaces in class names gracefully. This could be considered an "obvious or unimportant" comment that doesn't warrant human attention. It's also the type of thing that should be caught by automated linting tools rather than code review. While the trailing space is indeed minor and likely has no functional impact, it is technically a code quality issue that was introduced in this PR. The comment is actionable and clear. However, given the rules emphasize not making "obvious or unimportant" comments, and this is a trivial whitespace issue, it probably doesn't meet the threshold for a useful review comment. This comment should be deleted. While it correctly identifies a trailing space that was introduced in the PR, it's too trivial and unimportant to warrant a review comment. This type of issue should be handled by automated linting tools, not human code review.

Workflow ID: wflow_Wzkgl0Q1HAWq2E6V

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

createdAt: Date
updatedAt: Date
memberCount: Int
pipelineCount:Int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: It looks like there's no space after the colon in the pipelineCount:Int field definition. Consider changing it to pipelineCount: Int.

Suggested change
pipelineCount:Int
pipelineCount: Int


input TicketsPipelineFilter {
channelId: String
pipelineId:String
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: In the TicketsPipelineFilter input, consider adding a space after the colon in pipelineId:String for consistency. It should be pipelineId: String.

Suggested change
pipelineId:String
pipelineId: String

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed 4d3b3e0 in 1 minute and 24 seconds. Click for details.
  • Reviewed 10 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/plugins/frontline_ui/src/modules/status/components/StatusInline.tsx:1
  • Draft comment:
    Remove unused TICKET_STATUS_TYPES import for cleaner code.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_gSWgQrmUWHDJrjKX

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (6)
frontend/plugins/frontline_ui/src/modules/status/components/StatusGroup.tsx (4)

145-146: Pass type parameter in delete mutation variables

This is the same issue flagged in the previous review. The delete mutation may require the type parameter to properly refetch the status list.

Apply this diff to include the type parameter:

     deleteStatus({
-      variables: { id: statusId },
+      variables: { id: statusId, type: statusType },
       onCompleted: () => {

229-235: Use _id instead of id in update mutation variables

This is the same critical issue flagged in the previous review. The UPDATE_TICKET_STATUS mutation expects _id, not id.

Apply this diff:

       updateStatus({
         variables: {
-          id: editingStatus._id,
+          _id: editingStatus._id,
           name,
           description,

358-365: Remove length check to allow empty array sync

This is the same issue flagged in the previous review. The length check prevents the UI from clearing when all statuses are deleted.

Apply this diff:

   useEffect(() => {
-    if (
-      statuses.length > 0 &&
-      JSON.stringify(statuses) !== JSON.stringify(_statuses)
-    ) {
+    if (JSON.stringify(statuses) !== JSON.stringify(_statuses)) {
       _setStatuses(statuses);
     }
   }, [_statuses, statuses]);

384-399: Use _id instead of id in reorder mutation variables

This is the same critical issue flagged in the previous review at lines 384-399. The UPDATE_TICKET_STATUS mutation expects _id, not id.

Apply this diff:

         updateStatus({
           variables: {
-            id: status._id,
+            _id: status._id,
             order: index,
           },
frontend/plugins/frontline_ui/src/modules/ticket/components/ticket-navigations/TicketNavigations.tsx (2)

67-69: Fix the short-circuit expression to use explicit control flow.

The short-circuit expression triggers the ESLint no-unused-expressions rule. This issue has already been addressed in a previous review comment.


96-98: Fix the short-circuit expression and add pipeline validation.

The short-circuit expression triggers the ESLint no-unused-expressions rule. Additionally, the effect should validate that the selected pipeline belongs to the active channel. This issue has already been comprehensively addressed in a previous review comment.

🧹 Nitpick comments (3)
frontend/plugins/frontline_ui/src/modules/status/hooks/useDeleteTicketStatus.tsx (1)

12-12: Add generic parameters to MutationHookOptions for type safety.

The options parameter lacks generic type parameters, which reduces type safety and IntelliSense support.

Apply this diff to improve type safety:

- const deleteStatus = (options: MutationHookOptions) => {
+ const deleteStatus = (options?: MutationHookOptions<{ deleteTicketStatus: boolean }, { _id: string }>) => {

This ensures callers pass correctly-typed variables and receive properly-typed results.

frontend/plugins/frontline_ui/src/modules/status/components/StatusGroup.tsx (2)

235-235: Simplify color validation

The optional chaining makes the second length check redundant.

Apply this diff:

-          color: color?.length && color.length > 2 ? color : '',
+          color: color && color.length > 2 ? color : '',

403-408: Consider removing unnecessary event mutation

Mutating the event object's delta.x property isn't necessary since verticalListSortingStrategy already constrains movement to the vertical axis. This function can likely be removed entirely.

Apply this diff:

-  const handleDragMove = (event: DragMoveEvent) => {
-    const { delta } = event;
-    if (delta) {
-      delta.x = 0;
-    }
-  };
   return (
     <div className="w-full p-4">
       <div className="flex items-center justify-between">
@@ -430,7 +425,6 @@
       <DndContext
         collisionDetection={closestCenter}
         onDragEnd={handleDragEnd}
-        onDragMove={handleDragMove}
       >
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between adaba51 and 4d3b3e0.

📒 Files selected for processing (5)
  • frontend/plugins/frontline_ui/src/modules/status/components/StatusGroup.tsx (1 hunks)
  • frontend/plugins/frontline_ui/src/modules/status/components/StatusInline.tsx (1 hunks)
  • frontend/plugins/frontline_ui/src/modules/status/hooks/useAddTicketStatus.tsx (1 hunks)
  • frontend/plugins/frontline_ui/src/modules/status/hooks/useDeleteTicketStatus.tsx (1 hunks)
  • frontend/plugins/frontline_ui/src/modules/ticket/components/ticket-navigations/TicketNavigations.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • frontend/plugins/frontline_ui/src/modules/status/components/StatusInline.tsx
  • frontend/plugins/frontline_ui/src/modules/status/hooks/useAddTicketStatus.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: Write concise, technical TypeScript code
Use functional and declarative programming patterns; avoid classes
Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Avoid console logs
Always use absolute paths for imports
Use TypeScript for all code (no .js/.jsx)
Prefer interfaces over types for object shapes
Avoid enums; use maps instead
Use the function keyword for pure functions
Avoid unnecessary curly braces in simple conditionals; use concise syntax

Files:

  • frontend/plugins/frontline_ui/src/modules/ticket/components/ticket-navigations/TicketNavigations.tsx
  • frontend/plugins/frontline_ui/src/modules/status/hooks/useDeleteTicketStatus.tsx
  • frontend/plugins/frontline_ui/src/modules/status/components/StatusGroup.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursorrules)

**/*.tsx: Use declarative JSX
Use Shadcn UI, Radix UI, and Tailwind for components and styling
Implement responsive, mobile-first design with Tailwind CSS
Minimize useEffect and setState usage
Wrap client components in React.Suspense with a fallback
Use dynamic loading for non-critical components
Include explicit width and height (or sizes) when rendering images
Implement lazy loading for images
Limit 'use client': favor server components and Next.js SSR
Use 'use client' only for Web API access in small components
Do not use 'use client' components for data fetching or state management

Files:

  • frontend/plugins/frontline_ui/src/modules/ticket/components/ticket-navigations/TicketNavigations.tsx
  • frontend/plugins/frontline_ui/src/modules/status/hooks/useDeleteTicketStatus.tsx
  • frontend/plugins/frontline_ui/src/modules/status/components/StatusGroup.tsx
🧠 Learnings (1)
📚 Learning: 2025-10-07T04:35:24.836Z
Learnt from: CR
Repo: erxes/erxes PR: 0
File: .cursorrules:0-0
Timestamp: 2025-10-07T04:35:24.836Z
Learning: Applies to **/*.tsx : Minimize useEffect and setState usage

Applied to files:

  • frontend/plugins/frontline_ui/src/modules/ticket/components/ticket-navigations/TicketNavigations.tsx
🧬 Code graph analysis (3)
frontend/plugins/frontline_ui/src/modules/ticket/components/ticket-navigations/TicketNavigations.tsx (5)
frontend/libs/erxes-ui/src/components/sidebar.tsx (1)
  • Sidebar (745-769)
frontend/plugins/frontline_ui/src/modules/ticket/components/ticket-navigations/ChannelNavigations.tsx (1)
  • TicketNavigations (64-78)
frontend/plugins/frontline_ui/src/modules/channels/hooks/useGetChannels.tsx (1)
  • useGetChannels (9-20)
frontend/libs/erxes-ui/src/modules/navigation-menu/components/NavigationMenu.tsx (1)
  • NavigationMenuGroup (85-116)
frontend/plugins/frontline_ui/src/modules/pipelines/hooks/useGetPipelines.tsx (1)
  • useGetPipelines (18-37)
frontend/plugins/frontline_ui/src/modules/status/hooks/useDeleteTicketStatus.tsx (2)
frontend/plugins/frontline_ui/src/modules/status/graphql/mutation/deleteTicketStatus.ts (1)
  • DELETE_TICKET_STATUS (3-7)
frontend/plugins/frontline_ui/src/modules/status/graphql/query/getTicketStatusByType.ts (1)
  • GET_TICKET_STATUS_BY_TYPE (3-17)
frontend/plugins/frontline_ui/src/modules/status/components/StatusGroup.tsx (8)
frontend/plugins/frontline_ui/src/modules/status/types/index.ts (1)
  • ITicketStatus (1-12)
frontend/plugins/frontline_ui/src/modules/status/components/StatusInline.tsx (2)
  • StatusInlineIcon (16-54)
  • StatusInlineLabel (58-68)
frontend/plugins/frontline_ui/src/modules/settings/states/StatusStates.ts (2)
  • editingStatusState (4-4)
  • addingStatusState (3-3)
frontend/plugins/frontline_ui/src/modules/status/hooks/useDeleteTicketStatus.tsx (1)
  • useDeleteTicketStatus (8-31)
frontend/plugins/frontline_ui/src/modules/status/hooks/useAddTicketStatus.tsx (1)
  • useAddTicketStatus (6-39)
frontend/plugins/frontline_ui/src/modules/status/hooks/useUpdateTicketStatus.tsx (1)
  • useUpdateTicketStatus (11-36)
frontend/plugins/frontline_ui/src/modules/settings/schema/ticketStatus.ts (1)
  • TICKET_STATUS_FORM_SCHEMA (3-7)
frontend/plugins/frontline_ui/src/modules/status/hooks/useGetTicketStatus.tsx (1)
  • useGetTicketStatus (11-28)
🪛 ESLint
frontend/plugins/frontline_ui/src/modules/ticket/components/ticket-navigations/TicketNavigations.tsx

[error] 68-68: Expected an assignment or function call and instead saw an expression.

(@typescript-eslint/no-unused-expressions)


[error] 97-97: Expected an assignment or function call and instead saw an expression.

(@typescript-eslint/no-unused-expressions)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (4)
frontend/plugins/frontline_ui/src/modules/status/hooks/useDeleteTicketStatus.tsx (2)

14-19: Previous issue resolved: pipelineId now included in refetch.

The refetch query now correctly includes both type and pipelineId variables, resolving the issue flagged in the previous review.


20-28: Verify: Options spread may override onError handler.

Spreading options at line 27 after defining onError allows callers to override the toast error notification. This might bypass centralized error handling.

If overriding is unintended, move the spread before onError:

   return _deleteStatus({
+    ...options,
     refetchQueries: [
       {
         query: GET_TICKET_STATUS_BY_TYPE,
         variables: { type, pipelineId },
       },
     ],
     onError: (e) => {
       toast({
         title: 'Error',
         description: e.message,
         variant: 'destructive',
       });
     },
-    ...options,
   });

Alternatively, if custom error handling is desired, consider merging handlers instead of replacing.

frontend/plugins/frontline_ui/src/modules/status/components/StatusGroup.tsx (2)

51-68: LGTM!

The skeleton component provides a clean loading state that matches the actual Status component structure.


70-137: LGTM!

The Status component correctly implements drag-and-drop functionality and properly threads the statusType to child components.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed 8f99fb3 in 2 minutes and 37 seconds. Click for details.
  • Reviewed 80 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/plugins/frontline_ui/src/modules/status/components/StatusGroup.tsx:386
  • Draft comment:
    Consider creating a shallow copy of _statuses (e.g. using slice()) when saving previousOrder to avoid potential reference issues if _statuses is mutated.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The comment is about a change made in the diff (line 386 is new). React state variables are immutable by convention - _setStatuses replaces the state, it doesn't mutate it. The arrayMove function returns a new array. After line 387 executes, _statuses still refers to the old array until the next render, and previousOrder also refers to that same old array. This should work correctly for the error handler. The only way this could be a problem is if something else mutates the array in place, but that would be a bug elsewhere and violate React patterns. The comment seems to be overly cautious about a non-issue in this context. Could there be some edge case where the array is mutated in place that I'm not seeing? Maybe the updateStatus callback or some other async operation could cause issues? However, even if that were the case, the error handler executes synchronously within the forEach loop, so it should still have the correct reference. Even considering edge cases, React state management patterns ensure that _statuses won't be mutated in place. The error handler would execute before any state updates from re-renders. The suggestion to use .slice() is technically harmless but unnecessary defensive programming that doesn't address any real issue in this code. This comment suggests an unnecessary defensive copy. The current code is correct because React state is immutable and arrayMove returns a new array. The previousOrder reference will correctly point to the old state for the error handler. This is overly cautious advice that doesn't identify a real bug.
2. frontend/plugins/frontline_ui/src/modules/status/components/StatusGroup.tsx:367
  • Draft comment:
    Using JSON.stringify for deep equality in useEffect works but could be inefficient for larger arrays. Consider a more optimized deep equality check if performance becomes a concern.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
3. frontend/plugins/frontline_ui/src/pages/PipelinesPage.tsx:11
  • Draft comment:
    Typographical note: The space between 'text-xl' and 'font-semibold' was missing initially and has been corrected. This ensures the proper application of both classes.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_7Egoqc3wHdzFa16q

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (2)
frontend/plugins/frontline_ui/src/modules/status/components/StatusGroup.tsx (2)

235-242: Critical: Use _id instead of id for UPDATE_TICKET_STATUS mutation

The UPDATE_TICKET_STATUS mutation expects an _id variable, not id. Using id causes Apollo to throw "Variable "$_id" of required type is missing", preventing inline edits from persisting.

Apply this diff:

       updateStatus({
         variables: {
-          id: editingStatus._id,
+          _id: editingStatus._id,
           name,
           description,
           color: color?.length && color.length > 2 ? color : '',

385-406: Critical: Use _id instead of id for UPDATE_TICKET_STATUS mutation

On line 393, the updateStatus mutation uses id but UPDATE_TICKET_STATUS expects _id. This causes Apollo to throw "Variable "$_id" of required type is missing", preventing drag-and-drop reordering from persisting.

Note: The error rollback logic (lines 386, 397) is now correctly implemented by capturing previousOrder before the state update.

Apply this diff:

     newOrder.forEach((status, index) => {
       if (status.order !== index) {
         updateStatus({
           variables: {
-            id: status._id,
+            _id: status._id,
             order: index,
           },
🧹 Nitpick comments (1)
frontend/plugins/frontline_ui/src/modules/status/components/StatusGroup.tsx (1)

241-241: Simplify redundant color validation

The condition color?.length && color.length > 2 has a redundant check. If color?.length is truthy, color is guaranteed to be defined.

Apply this diff:

-          color: color?.length && color.length > 2 ? color : '',
+          color: color && color.length > 2 ? color : '',
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4d3b3e0 and 8f99fb3.

📒 Files selected for processing (2)
  • frontend/plugins/frontline_ui/src/modules/status/components/StatusGroup.tsx (1 hunks)
  • frontend/plugins/frontline_ui/src/pages/PipelinesPage.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: Write concise, technical TypeScript code
Use functional and declarative programming patterns; avoid classes
Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Avoid console logs
Always use absolute paths for imports
Use TypeScript for all code (no .js/.jsx)
Prefer interfaces over types for object shapes
Avoid enums; use maps instead
Use the function keyword for pure functions
Avoid unnecessary curly braces in simple conditionals; use concise syntax

Files:

  • frontend/plugins/frontline_ui/src/pages/PipelinesPage.tsx
  • frontend/plugins/frontline_ui/src/modules/status/components/StatusGroup.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursorrules)

**/*.tsx: Use declarative JSX
Use Shadcn UI, Radix UI, and Tailwind for components and styling
Implement responsive, mobile-first design with Tailwind CSS
Minimize useEffect and setState usage
Wrap client components in React.Suspense with a fallback
Use dynamic loading for non-critical components
Include explicit width and height (or sizes) when rendering images
Implement lazy loading for images
Limit 'use client': favor server components and Next.js SSR
Use 'use client' only for Web API access in small components
Do not use 'use client' components for data fetching or state management

Files:

  • frontend/plugins/frontline_ui/src/pages/PipelinesPage.tsx
  • frontend/plugins/frontline_ui/src/modules/status/components/StatusGroup.tsx
🧬 Code graph analysis (2)
frontend/plugins/frontline_ui/src/pages/PipelinesPage.tsx (3)
frontend/plugins/frontline_ui/src/modules/channels/components/settings/Settings.tsx (1)
  • ChannelPipelinesPage (31-35)
frontend/plugins/frontline_ui/src/modules/pipelines/components/CreatePipeline.tsx (1)
  • CreatePipeline (23-125)
frontend/plugins/frontline_ui/src/modules/pipelines/components/PipelinesList.tsx (1)
  • PipelinesList (9-89)
frontend/plugins/frontline_ui/src/modules/status/components/StatusGroup.tsx (8)
frontend/plugins/frontline_ui/src/modules/status/types/index.ts (1)
  • ITicketStatus (1-12)
frontend/plugins/frontline_ui/src/modules/status/components/StatusInline.tsx (2)
  • StatusInlineIcon (16-54)
  • StatusInlineLabel (58-68)
frontend/plugins/frontline_ui/src/modules/settings/states/StatusStates.ts (2)
  • editingStatusState (4-4)
  • addingStatusState (3-3)
frontend/plugins/frontline_ui/src/modules/status/hooks/useDeleteTicketStatus.tsx (1)
  • useDeleteTicketStatus (8-31)
frontend/plugins/frontline_ui/src/modules/status/hooks/useAddTicketStatus.tsx (1)
  • useAddTicketStatus (6-39)
frontend/plugins/frontline_ui/src/modules/status/hooks/useUpdateTicketStatus.tsx (1)
  • useUpdateTicketStatus (11-36)
frontend/plugins/frontline_ui/src/modules/settings/schema/ticketStatus.ts (1)
  • TICKET_STATUS_FORM_SCHEMA (3-7)
frontend/plugins/frontline_ui/src/modules/status/hooks/useGetTicketStatus.tsx (1)
  • useGetTicketStatus (11-28)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (8)
frontend/plugins/frontline_ui/src/pages/PipelinesPage.tsx (4)

1-3: LGTM! Clean imports following absolute path conventions.

The imports correctly use absolute paths with the @ prefix as per coding guidelines, and all imported dependencies are utilized in the component.


5-7: LGTM! Appropriate guard clause for missing channelId.

The component correctly extracts the channelId from URL parameters with proper TypeScript typing and uses a guard clause to prevent rendering when the required parameter is missing.


11-11: Previous typographical error has been fixed.

The className on line 11 now correctly uses "text-xl font-semibold" with proper spacing. The previous issue flagged by the bot has been resolved.


9-9: Based on my verification, I can now provide the final assessment:

No layout overflow issues detected with h-screen usage.

The h-screen class on line 9 of PipelinesPage.tsx is consistent with similar pages in the same module (ChannelMembersPage, ChannelIntegrationsPage). The layout hierarchy shows:

  • SettingsHeader and Outlet are rendered as siblings within PageContainer
  • ChannelPipelinesPage renders a full-height container for its content
  • PipelinesList uses h-full to fill the parent container
  • The Table component handles internal content scrolling

This design pattern is used throughout the frontline_ui plugin and similar plugins (operation_ui, sales_ui), suggesting it is intentional and working as designed. No changes are needed.

frontend/plugins/frontline_ui/src/modules/status/components/StatusGroup.tsx (4)

51-68: LGTM!

The loading skeleton provides a good placeholder that matches the Status component structure.


70-137: LGTM!

The Status component correctly implements drag-and-drop functionality with proper styling and conditional behavior. The integration with useSortable and the dynamic color theming work well.


139-201: LGTM!

The dropdown menu correctly handles edit and delete actions with proper toast notifications. The status type is appropriately passed via the hook initialization.


367-371: LGTM - Fixed!

The useEffect now correctly syncs empty status arrays from the server, fixing the issue where deleted statuses would remain visible in the UI.

Comment on lines +409 to +414
const handleDragMove = (event: DragMoveEvent) => {
const { delta } = event;
if (delta) {
delta.x = 0;
}
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Consider using dnd-kit modifiers instead of direct delta mutation

Directly mutating delta.x = 0 to prevent horizontal dragging may interfere with dnd-kit's internal state. Consider using dnd-kit's built-in modifiers or CSS constraints (transform: translateY(...)) for more reliable behavior.

Example using the restrictToVerticalAxis modifier:

+import { restrictToVerticalAxis } from '@dnd-kit/modifiers';
...
 <DndContext
   collisionDetection={closestCenter}
   onDragEnd={handleDragEnd}
-  onDragMove={handleDragMove}
+  modifiers={[restrictToVerticalAxis]}
 >

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In frontend/plugins/frontline_ui/src/modules/status/components/StatusGroup.tsx
around lines 409 to 414, the handler mutates event.delta.x directly to block
horizontal movement which can conflict with dnd-kit internals; remove that
direct mutation and instead pass a vertical-only modifier to your DndContext
(e.g., use dnd-kit's restrictToVerticalAxis in the modifiers prop) or constrain
movement via CSS transforms; update the component to register the modifier on
the DndContext (and remove the handleDragMove mutation) so dragging is reliably
restricted to vertical movement.

Comment on lines 5 to 12
async createdUser(pipeline: ITicketPipelineDocument) {
return sendTRPCMessage({
pluginName: 'core',
module: 'users',
action: 'findOne',
input: { query: { _id: pipeline.userId } },
});
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add subdomain

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Changes requested ❌

Reviewed f49872e in 2 minutes and 30 seconds. Click for details.
  • Reviewed 103 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/plugins/frontline_ui/src/modules/integrations/facebook/components/FacebookIntegrationRepair.tsx:15
  • Draft comment:
    Ensure that 'integrationType' from useParams is defined or provide a fallback, as it is critical for the mutation variables.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The comment starts with "Ensure that..." which is a red flag according to the rules - comments that start with "Verify that..." or "Ensure that..." are likely not useful. The comment is also speculative - it assumes that integrationType might be undefined, but there's no evidence in the code that this is actually a problem. The component is clearly designed to be used in a route context where integrationType is expected to be a URL parameter. If it were undefined, that would be a routing/usage issue, not a code issue in this component. Additionally, providing an empty string as a fallback might actually mask bugs rather than help - if the parameter is missing, it's better to fail explicitly. The comment doesn't show strong evidence of a bug. Could there be legitimate cases where this component is rendered without the integrationType parameter in the route? Maybe the routing setup is incomplete or there's a valid edge case where this could be undefined? Even if there were such cases, the comment doesn't provide evidence that this is actually happening. The component name and usage context (Facebook integration repair) strongly suggest it's used in a specific route with defined parameters. Without evidence of an actual bug, this is purely speculative defensive programming advice. This comment should be deleted. It starts with "Ensure that..." which is a pattern to avoid, it's speculative without evidence of an actual problem, and it suggests defensive programming without demonstrating that there's a real issue. The component is clearly designed for a specific routing context.
2. frontend/plugins/frontline_ui/src/modules/integrations/facebook/components/FacebookIntegrationRepair.tsx:26
  • Draft comment:
    For better accessibility, add an 'aria-label' to the icon-only Button so that assistive technologies can properly describe its action.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The comment is about accessibility, which is a legitimate concern. However, I need to consider the rules: 1) The rule states "Do NOT comment on any pure frontend UI or styling changes, only logic." Accessibility could be considered UI/styling, but it's also about functionality for users with disabilities. 2) The comment is actionable and clear - it suggests adding an aria-label. 3) It's not speculative - the button clearly lacks an aria-label. 4) However, accessibility issues like missing aria-labels might be caught by automated accessibility linters or tests that the team may have in place. 5) The rule says to assume the author did UI changes correctly, which could apply here. The rules explicitly state to not comment on "pure frontend UI or styling changes" and to "assume that if the author changed the UI, they did it correctly." Accessibility attributes like aria-label could be considered part of UI implementation, and this comment might fall under that category. Additionally, missing aria-labels are often caught by automated accessibility tools. While accessibility is important, the rules are clear that UI changes should be assumed correct, and this is a UI/accessibility concern rather than a logic issue. The team likely has accessibility linters or standards in place that would catch this if it's truly required for their codebase. This comment should be deleted. It falls under the category of UI/styling changes that the rules say to ignore, and we should assume the author implemented the UI correctly. If aria-labels are required, automated accessibility tools would likely catch this.
3. frontend/plugins/frontline_ui/src/modules/integrations/facebook/components/FacebookIntegrationRepair.tsx:17
  • Draft comment:
    Consider adding an 'onError' callback in the repairIntegrations mutation call to handle errors gracefully and inform the user if something goes wrong.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This comment suggests adding error handling, which could be considered a code quality improvement. However, I need to consider the rules: 1) The comment should not be speculative or suggest something that might be handled elsewhere (like in the hook itself), 2) It should be clearly necessary, not just a "nice to have", 3) It shouldn't be obvious or unimportant. Without seeing the useFbIntegrationsRepair hook implementation, I can't know if error handling is already done there. The mutation might handle errors internally. This seems like a speculative suggestion about best practices rather than a clear bug or issue. The comment uses "Consider" which is soft language suggesting it's not a definite issue. I might be missing that error handling is genuinely absent and this could lead to a poor user experience. The hook might not handle errors, and without an onError callback, users might not know when repairs fail. This could be a legitimate code quality issue. While error handling is important, without seeing the hook implementation, I cannot confirm this is definitely needed. The hook itself might handle errors, or there might be a global error handler. The comment is speculative ("Consider") rather than definitive. According to the rules, I should not keep speculative comments and need STRONG EVIDENCE that the comment is correct. This comment should be deleted. It's a speculative suggestion about adding error handling without strong evidence that it's missing or necessary. The error handling might already exist in the hook or elsewhere in the application. The soft language ("Consider") indicates it's not a definite issue.

Workflow ID: wflow_acn4FoKXQGzLWytG

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

header: () => <RecordTable.InlineHead label="Actions" />,
cell: ({ cell }) => {
const { isActive, _id, name } = cell.row.original;
const { integrationType } = useParams();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the integrationType is the same for all rows, consider extracting it from useParams at a higher level and passing it down as a prop to avoid redundant hook calls in each cell.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f99fb3 and f49872e.

📒 Files selected for processing (4)
  • frontend/plugins/frontline_ui/src/modules/integrations/components/IntegrationsRecordTable.tsx (2 hunks)
  • frontend/plugins/frontline_ui/src/modules/integrations/facebook/components/FacebookIntegrationRepair.tsx (1 hunks)
  • frontend/plugins/frontline_ui/src/modules/integrations/facebook/graphql/mutations/fbConfig.ts (1 hunks)
  • frontend/plugins/frontline_ui/src/modules/integrations/facebook/hooks/useFbIntegrationsRepair.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: Write concise, technical TypeScript code
Use functional and declarative programming patterns; avoid classes
Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Avoid console logs
Always use absolute paths for imports
Use TypeScript for all code (no .js/.jsx)
Prefer interfaces over types for object shapes
Avoid enums; use maps instead
Use the function keyword for pure functions
Avoid unnecessary curly braces in simple conditionals; use concise syntax

Files:

  • frontend/plugins/frontline_ui/src/modules/integrations/facebook/hooks/useFbIntegrationsRepair.tsx
  • frontend/plugins/frontline_ui/src/modules/integrations/facebook/graphql/mutations/fbConfig.ts
  • frontend/plugins/frontline_ui/src/modules/integrations/facebook/components/FacebookIntegrationRepair.tsx
  • frontend/plugins/frontline_ui/src/modules/integrations/components/IntegrationsRecordTable.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursorrules)

**/*.tsx: Use declarative JSX
Use Shadcn UI, Radix UI, and Tailwind for components and styling
Implement responsive, mobile-first design with Tailwind CSS
Minimize useEffect and setState usage
Wrap client components in React.Suspense with a fallback
Use dynamic loading for non-critical components
Include explicit width and height (or sizes) when rendering images
Implement lazy loading for images
Limit 'use client': favor server components and Next.js SSR
Use 'use client' only for Web API access in small components
Do not use 'use client' components for data fetching or state management

Files:

  • frontend/plugins/frontline_ui/src/modules/integrations/facebook/hooks/useFbIntegrationsRepair.tsx
  • frontend/plugins/frontline_ui/src/modules/integrations/facebook/components/FacebookIntegrationRepair.tsx
  • frontend/plugins/frontline_ui/src/modules/integrations/components/IntegrationsRecordTable.tsx
🧬 Code graph analysis (3)
frontend/plugins/frontline_ui/src/modules/integrations/facebook/hooks/useFbIntegrationsRepair.tsx (1)
frontend/plugins/frontline_ui/src/modules/integrations/facebook/graphql/mutations/fbConfig.ts (1)
  • FACEBOOK_REPAIR (9-13)
frontend/plugins/frontline_ui/src/modules/integrations/facebook/components/FacebookIntegrationRepair.tsx (3)
frontend/plugins/frontline_ui/src/modules/integrations/types/Integration.ts (1)
  • IIntegrationDetail (9-25)
frontend/plugins/frontline_ui/src/modules/integrations/facebook/hooks/useFbIntegrationsRepair.tsx (1)
  • useFbIntegrationsRepair (4-8)
frontend/libs/erxes-ui/src/components/spinner.tsx (1)
  • Spinner (40-132)
frontend/plugins/frontline_ui/src/modules/integrations/components/IntegrationsRecordTable.tsx (1)
frontend/plugins/frontline_ui/src/modules/integrations/facebook/components/FacebookIntegrationRepair.tsx (1)
  • FacebookIntegrationRepair (12-35)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
frontend/plugins/frontline_ui/src/modules/integrations/facebook/graphql/mutations/fbConfig.ts (1)

9-13: Mutation wiring looks good.

The new FacebookRepair mutation lines up with the backend signature and keeps the existing config mutation untouched.

frontend/plugins/frontline_ui/src/modules/integrations/facebook/components/FacebookIntegrationRepair.tsx (1)

12-33: Nice focused repair action.

Hook usage, loading guard, and toast handling are consistent with the rest of the integrations UI. No changes needed here.

frontend/plugins/frontline_ui/src/modules/integrations/facebook/hooks/useFbIntegrationsRepair.tsx (1)

4-7: Hook wrapper is clean.

Returning the mutation plus loading state keeps the component API tidy.

Comment on lines +169 to +175
const { integrationType } = useParams();
return (
<div className="flex items-center gap-1.5 px-2 justify-center">
{IntegrationType.FACEBOOK_MESSENGER === integrationType ||
IntegrationType.FACEBOOK_POST === integrationType ? (
<FacebookIntegrationRepair cell={cell} />
) : null}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix the hook violation in the Actions cell.

The inline cell renderer is just a plain callback, so calling useParams inside it breaks the Rules of Hooks and will trip our lint checks; React requires hooks to run only within components or custom hooks.(legacy.reactjs.org) Please resolve by deriving integrationType in IntegrationsRecordTable and passing it into integrationTypeColumns, then branch on that value inside the renderer instead of invoking useParams.

   const params = useParams();
+  const integrationType = params?.integrationType as IntegrationType | undefined;

   return (
     <RecordTable.Provider
-      columns={integrationTypeColumns({ Actions })}
+      columns={integrationTypeColumns({ Actions, integrationType })}
       data={(integrations || []).filter((integration) => integration)}
-export const integrationTypeColumns = ({
-  Actions,
-}: {
+export const integrationTypeColumns = ({
+  Actions,
+  integrationType,
+}: {
   Actions: (props: {
     cell: Cell<IIntegrationDetail, unknown>;
   }) => React.ReactNode;
-}): ColumnDef<IIntegrationDetail>[] => [
+  integrationType?: IntegrationType;
+}): ColumnDef<IIntegrationDetail>[] => [
...
-      const { integrationType } = useParams();
+      const shouldShowRepair =
+        integrationType === IntegrationType.FACEBOOK_MESSENGER ||
+        integrationType === IntegrationType.FACEBOOK_POST;
       return (
         <div className="flex items-center gap-1.5 px-2 justify-center">
-          {IntegrationType.FACEBOOK_MESSENGER === integrationType ||
-          IntegrationType.FACEBOOK_POST === integrationType ? (
+          {shouldShowRepair ? (
             <FacebookIntegrationRepair cell={cell} />
           ) : null}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const { integrationType } = useParams();
return (
<div className="flex items-center gap-1.5 px-2 justify-center">
{IntegrationType.FACEBOOK_MESSENGER === integrationType ||
IntegrationType.FACEBOOK_POST === integrationType ? (
<FacebookIntegrationRepair cell={cell} />
) : null}
const shouldShowRepair =
integrationType === IntegrationType.FACEBOOK_MESSENGER ||
integrationType === IntegrationType.FACEBOOK_POST;
return (
<div className="flex items-center gap-1.5 px-2 justify-center">
{shouldShowRepair ? (
<FacebookIntegrationRepair cell={cell} />
) : null}
🤖 Prompt for AI Agents
In
frontend/plugins/frontline_ui/src/modules/integrations/components/IntegrationsRecordTable.tsx
around lines 169 to 175, the Actions cell renderer incorrectly calls useParams
(violating Rules of Hooks); derive integrationType once in the
IntegrationsRecordTable parent component using useParams, pass that
integrationType into integrationTypeColumns (or the column renderer factory) as
a prop/argument, and then inside the inline renderer branch on the passed
integrationType to conditionally render <FacebookIntegrationRepair /> instead of
calling useParams there; update the column factory/signature to accept
integrationType and remove any direct hook calls from the cell renderer.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
backend/plugins/frontline_api/src/apollo/resolvers/mutations.ts (1)

7-9: Inconsistent naming convention for mutation imports.

The PipelineMutations import uses PascalCase while statusMutations and ticketMutations use camelCase. For consistency with other mutation imports in this file (channelMutations, conversationMutations, integrationMutations, etc.), consider using camelCase for all three:

-import { PipelineMutations } from '@/ticket/graphql/resolvers/mutations/Pipeline';
-import { statusMutations } from '@/ticket/graphql/resolvers/mutations/Status';
-import { ticketMutations } from '@/ticket/graphql/resolvers/mutations/Ticket';
+import { PipelineMutations as pipelineMutations } from '@/ticket/graphql/resolvers/mutations/Pipeline';
+import { statusMutations } from '@/ticket/graphql/resolvers/mutations/Status';
+import { ticketMutations } from '@/ticket/graphql/resolvers/mutations/Ticket';

And update the spread operator usage:

-  ...PipelineMutations,
+  ...pipelineMutations,
backend/plugins/frontline_api/src/apollo/schema/schema.ts (1)

38-53: Inconsistent naming convention for query imports.

The new query imports use singular form (PipelineQuery, StatusQuery, TicketQuery) while existing query imports use plural form (ChannelsQueries, ConversationsQueries, IntegrationsQueries, etc.). For consistency, consider using plural form:

 import {
   mutations as PipelineMutations,
-  queries as PipelineQuery,
+  queries as PipelineQueries,
   types as PipelineTypes,
 } from '@/ticket/graphql/schemas/pipeline';

 import {
   mutations as StatusMutations,
-  queries as StatusQuery,
+  queries as StatusQueries,
   types as StatusTypes,
 } from '@/ticket/graphql/schemas/status';
 import {
   mutations as TicketMutations,
-  queries as TicketQuery,
+  queries as TicketQueries,
   types as TicketTypes,
 } from '@/ticket/graphql/schemas/ticket';

And update the template string interpolations at lines 80-82:

-    ${PipelineQuery}
-    ${StatusQuery}
-    ${TicketQuery}
+    ${PipelineQueries}
+    ${StatusQueries}
+    ${TicketQueries}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e468ef7 and e4e7a8d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • backend/plugins/frontline_api/src/apollo/resolvers/mutations.ts (2 hunks)
  • backend/plugins/frontline_api/src/apollo/resolvers/queries.ts (1 hunks)
  • backend/plugins/frontline_api/src/apollo/schema/schema.ts (4 hunks)
  • backend/plugins/frontline_api/src/connectionResolvers.ts (3 hunks)
  • frontend/plugins/frontline_ui/src/modules/FrontlineNavigation.tsx (1 hunks)
  • frontend/plugins/frontline_ui/src/modules/FrontlineSubGroups.tsx (1 hunks)
  • frontend/plugins/frontline_ui/src/modules/channels/components/settings/channels-list/Channels.tsx (1 hunks)
  • frontend/plugins/frontline_ui/src/modules/channels/components/settings/channels-list/CreateChannel.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • frontend/plugins/frontline_ui/src/modules/channels/components/settings/channels-list/Channels.tsx
  • frontend/plugins/frontline_ui/src/modules/channels/components/settings/channels-list/CreateChannel.tsx
  • backend/plugins/frontline_api/src/apollo/resolvers/queries.ts
  • frontend/plugins/frontline_ui/src/modules/FrontlineSubGroups.tsx
  • backend/plugins/frontline_api/src/connectionResolvers.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: Write concise, technical TypeScript code
Use functional and declarative programming patterns; avoid classes
Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Avoid console logs
Always use absolute paths for imports
Use TypeScript for all code (no .js/.jsx)
Prefer interfaces over types for object shapes
Avoid enums; use maps instead
Use the function keyword for pure functions
Avoid unnecessary curly braces in simple conditionals; use concise syntax

Files:

  • frontend/plugins/frontline_ui/src/modules/FrontlineNavigation.tsx
  • backend/plugins/frontline_api/src/apollo/resolvers/mutations.ts
  • backend/plugins/frontline_api/src/apollo/schema/schema.ts
**/*.tsx

📄 CodeRabbit inference engine (.cursorrules)

**/*.tsx: Use declarative JSX
Use Shadcn UI, Radix UI, and Tailwind for components and styling
Implement responsive, mobile-first design with Tailwind CSS
Minimize useEffect and setState usage
Wrap client components in React.Suspense with a fallback
Use dynamic loading for non-critical components
Include explicit width and height (or sizes) when rendering images
Implement lazy loading for images
Limit 'use client': favor server components and Next.js SSR
Use 'use client' only for Web API access in small components
Do not use 'use client' components for data fetching or state management

Files:

  • frontend/plugins/frontline_ui/src/modules/FrontlineNavigation.tsx
🧬 Code graph analysis (2)
backend/plugins/frontline_api/src/apollo/resolvers/mutations.ts (4)
backend/plugins/frontline_api/src/modules/ticket/graphql/resolvers/mutations/Pipeline.ts (1)
  • PipelineMutations (6-64)
backend/plugins/frontline_api/src/modules/ticket/graphql/resolvers/mutations/Status.ts (1)
  • statusMutations (7-59)
backend/plugins/frontline_api/src/modules/ticket/graphql/resolvers/mutations/Ticket.ts (1)
  • ticketMutations (6-65)
backend/plugins/frontline_api/src/modules/inbox/graphql/resolvers/mutations/widget.ts (1)
  • widgetMutations (220-1027)
backend/plugins/frontline_api/src/apollo/schema/schema.ts (1)
backend/plugins/frontline_api/src/modules/ticket/graphql/resolvers/mutations/Pipeline.ts (1)
  • PipelineMutations (6-64)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: frontline_ui-ci
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
backend/plugins/frontline_api/src/apollo/resolvers/mutations.ts (1)

19-22: LGTM!

The new ticket-related mutations are properly integrated into the mutations object using the spread operator, following the same pattern as existing mutation modules.

backend/plugins/frontline_api/src/apollo/schema/schema.ts (1)

68-70: LGTM!

The new Pipeline, Status, and Ticket schema components are properly interpolated into the respective template strings, following the same pattern as existing schema modules.

Also applies to: 80-82, 93-95

Comment on lines +50 to +52
name="Tickets"
icon={IconMessageReply}
path="frontline/ticket"
path="frontline/tickets"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

LGTM! Pluralization improves semantic clarity.

The update from "Ticket" to "Tickets" and the corresponding path change to "frontline/tickets" makes sense for a list/board view and aligns with the PR's ticketing system introduction.

Please verify that the route "frontline/tickets" is properly defined in the routing configuration to ensure navigation works correctly.


🏁 Script executed:

#!/bin/bash
# Description: Verify the tickets route exists in Main.tsx or route configuration files

# Search for the tickets route definition
rg -nP --type=tsx --type=ts -C3 'frontline/tickets|path.*tickets|Route.*tickets'

Length of output: 27


🏁 Script executed:

#!/bin/bash
# Search for the tickets route without type specification
rg -nP -C3 'frontline/tickets|path.*tickets' --max-filesize=1M

Length of output: 3703


🏁 Script executed:

#!/bin/bash
# Find and examine Main.tsx and routing configuration files
fd -e tsx -e ts 'Main|route|routing' | head -20

Length of output: 1288


🏁 Script executed:

#!/bin/bash
# Search for route definitions more broadly
rg -nC3 'frontline.*ticket' --max-filesize=1M

Length of output: 106532


Route is properly configured, but related files have inconsistent singular paths that need updating.

The route frontline/tickets is correctly defined at frontend/plugins/frontline_ui/src/modules/Main.tsx:31 and is referenced in FrontlineSubGroups.tsx:10. However, your pluralization change introduces breaking links in:

  • frontend/plugins/frontline_ui/src/widgets/notifications/system/WelcomeMessage.tsx:37 — still uses /frontline/ticket
  • frontend/plugins/frontline_ui/src/config.tsx:49 — still uses frontline/ticket

Update these paths to frontline/tickets to maintain consistency.

🤖 Prompt for AI Agents
In frontend/plugins/frontline_ui/src/modules/FrontlineNavigation.tsx around
lines 50-52 and related files, there is a pluralization mismatch: update the
hardcoded route references that still use "/frontline/ticket" to the plural
"/frontline/tickets". Specifically, change the path in
frontend/plugins/frontline_ui/src/widgets/notifications/system/WelcomeMessage.tsx
at or near line 37 and in frontend/plugins/frontline_ui/src/config.tsx at or
near line 49 to use "frontline/tickets" so they match the route defined in
Main.tsx and FrontlineSubGroups.tsx.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed 0c087e2 in 2 minutes and 23 seconds. Click for details.
  • Reviewed 63 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. backend/plugins/frontline_api/src/modules/ticket/graphql/resolvers/customResolvers/pipeline.ts:5
  • Draft comment:
    Updated createdUser signature to include the 'subdomain' parameter. Ensure that all call sites are updated to provide this value.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the author to ensure that all call sites are updated to provide the new subdomain parameter. This falls under the rule of not asking the author to ensure something is done, which is not allowed.
2. frontend/plugins/frontline_ui/src/modules/status/hooks/useGetTicketStatus.tsx:42
  • Draft comment:
    Removed commented-out 'skip' option. This clean-up improves readability—verify that the skip logic is handled appropriately elsewhere if needed.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to verify that the skip logic is handled appropriately elsewhere, which is against the rules. It does not provide a specific suggestion or ask for a specific test to be written. It is more of a general request for verification.
3. frontend/plugins/frontline_ui/src/modules/ticket/components/add-ticket/AddTicketForm.tsx:25
  • Draft comment:
    Removed legacy commented-out code using useParams and pipelines retrieval. This clean-up improves readability; confirm that no needed logic was removed.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to confirm that no needed logic was removed, which violates the rule against asking the author to confirm their intention or to double-check things. The comment does not provide a specific suggestion or point out a specific issue with the code.
4. frontend/plugins/frontline_ui/src/modules/ticket/components/add-ticket/AddTicketForm.tsx:57
  • Draft comment:
    Removed commented-out useEffect block that initialized the pipelineId from pipelines. Confirm that this auto-selection logic, if needed, is implemented elsewhere.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The comment is about removed code (commented-out code being deleted). The comment asks the author to "confirm" something, which is explicitly against the rules ("Do NOT ask the PR author to confirm their intention, to explain, to double-check things, to ensure the behavior is intended"). The comment is also speculative with "if needed" - it doesn't definitively state there's a problem. The author removed commented-out code, which is generally a good cleanup practice. If the logic was needed, it would have been uncommented and used, not left as a comment. This comment doesn't provide strong evidence of an actual issue. Could the removed useEffect have been providing important functionality that's now missing? Maybe the auto-selection logic was intentionally commented out temporarily and removing it could cause issues. The comment might be trying to prevent a regression. If the useEffect was important, it wouldn't have been left commented out in the first place. Removing commented-out code is standard cleanup. The comment explicitly asks to "confirm" which violates the rules, and uses speculative language "if needed" rather than identifying a concrete problem. Without evidence that this removal breaks something, the comment should be deleted. This comment should be deleted because it asks the PR author to confirm something (violating the rules) and is speculative ("if needed") rather than identifying a concrete issue. Removing commented-out code is standard practice and doesn't require justification.

Workflow ID: wflow_GMZnJR6GlJgG2JrH

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
frontend/plugins/frontline_ui/src/modules/ticket/components/add-ticket/AddTicketForm.tsx (1)

63-69: Fix BlockNote document mutation (previously flagged)

The editor.document returns a live array; calling pop() directly on it mutates the editor's internal state and deletes the last block from the document. Clone the array before modification to avoid corrupting user content.

Apply this diff to fix:

-  const handleDescriptionChange = async () => {
-    const content = await editor?.document;
+  const handleDescriptionChange = () => {
+    const content = editor?.document;
     if (content) {
-      content.pop();
-      setDescriptionContent(content as Block[]);
+      const clonedContent = content.slice();
+      clonedContent.pop();
+      setDescriptionContent(clonedContent as Block[]);
     }
   };
🧹 Nitpick comments (2)
frontend/plugins/frontline_ui/src/modules/ticket/components/add-ticket/AddTicketForm.tsx (2)

147-152: Replace any with proper type

The value parameter is typed as any, which defeats TypeScript's type safety. Based on the field type (assigneeId is string | undefined), use explicit typing.

Apply this diff:

                   <SelectAssigneeTicket.FormItem
                     value={field.value || ''}
-                    onValueChange={(value: any) => {
+                    onValueChange={(value: string | undefined) => {
                       field.onChange(value);
                     }}

55-61: Verify disabled exhaustive-deps rule

Two concerns:

  1. Static analysis reports the react-hooks/exhaustive-deps rule is not found, suggesting the ESLint plugin may not be configured properly.
  2. The disabled rule excludes defaultValues from dependencies, which is recreated on every render (lines 37-44). This could cause stale closures if pipelineId or currentUser change.

Consider memoizing defaultValues with useMemo:

const defaultValues = useMemo(() => ({
  pipelineId: pipelineId || undefined,
  name: '',
  priority: 0,
  assigneeId: pipelineId ? undefined : currentUser?._id,
  startDate: undefined,
  targetDate: undefined,
}), [pipelineId, currentUser?._id]);

Then include it in the dependencies array without suppressing the lint rule.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e4e7a8d and 0c087e2.

📒 Files selected for processing (3)
  • backend/plugins/frontline_api/src/modules/ticket/graphql/resolvers/customResolvers/pipeline.ts (1 hunks)
  • frontend/plugins/frontline_ui/src/modules/status/hooks/useGetTicketStatus.tsx (1 hunks)
  • frontend/plugins/frontline_ui/src/modules/ticket/components/add-ticket/AddTicketForm.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • frontend/plugins/frontline_ui/src/modules/status/hooks/useGetTicketStatus.tsx
  • backend/plugins/frontline_api/src/modules/ticket/graphql/resolvers/customResolvers/pipeline.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: Write concise, technical TypeScript code
Use functional and declarative programming patterns; avoid classes
Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Avoid console logs
Always use absolute paths for imports
Use TypeScript for all code (no .js/.jsx)
Prefer interfaces over types for object shapes
Avoid enums; use maps instead
Use the function keyword for pure functions
Avoid unnecessary curly braces in simple conditionals; use concise syntax

Files:

  • frontend/plugins/frontline_ui/src/modules/ticket/components/add-ticket/AddTicketForm.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursorrules)

**/*.tsx: Use declarative JSX
Use Shadcn UI, Radix UI, and Tailwind for components and styling
Implement responsive, mobile-first design with Tailwind CSS
Minimize useEffect and setState usage
Wrap client components in React.Suspense with a fallback
Use dynamic loading for non-critical components
Include explicit width and height (or sizes) when rendering images
Implement lazy loading for images
Limit 'use client': favor server components and Next.js SSR
Use 'use client' only for Web API access in small components
Do not use 'use client' components for data fetching or state management

Files:

  • frontend/plugins/frontline_ui/src/modules/ticket/components/add-ticket/AddTicketForm.tsx
🧬 Code graph analysis (1)
frontend/plugins/frontline_ui/src/modules/ticket/components/add-ticket/AddTicketForm.tsx (8)
frontend/plugins/frontline_ui/src/modules/ticket/hooks/useCreateTicket.tsx (1)
  • useCreateTicket (7-38)
frontend/plugins/frontline_ui/src/modules/ticket/states/ticketCreateSheetState.ts (1)
  • ticketCreateDefaultValuesState (5-7)
frontend/plugins/frontline_ui/src/modules/ticket/types/index.ts (1)
  • TAddTicket (24-24)
frontend/plugins/frontline_ui/src/modules/ticket/types/validations.ts (1)
  • addTicketSchema (3-16)
frontend/plugins/frontline_ui/src/modules/ticket/components/ticket-selects/SelectStatusTicket.tsx (1)
  • SelectStatusTicket (301-308)
frontend/plugins/frontline_ui/src/modules/ticket/components/ticket-selects/SelectPriorityTicket.tsx (1)
  • SelectPriorityTicket (241-245)
frontend/plugins/frontline_ui/src/modules/ticket/components/ticket-selects/SelectAssigneeTicket.tsx (1)
  • SelectAssigneeTicket (233-237)
frontend/plugins/frontline_ui/src/modules/ticket/components/ticket-selects/SelectDateTicket.tsx (1)
  • SelectDateTicket (215-220)
🪛 ESLint
frontend/plugins/frontline_ui/src/modules/ticket/components/add-ticket/AddTicketForm.tsx

[error] 60-60: Definition for rule 'react-hooks/exhaustive-deps' was not found.

(react-hooks/exhaustive-deps)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: operation_ui-ci
  • GitHub Check: frontline_api-ci
  • GitHub Check: Analyze (javascript-typescript)

Comment on lines +88 to +90
onSubmit={form.handleSubmit(onSubmit, (errors) => {
console.log(errors);
})}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Remove console.log

Console logging violates the coding guidelines. Consider using the toast notification system (already available via useToast in useCreateTicket) or remove this error handler if form validation errors are displayed inline.

Apply this diff:

-        onSubmit={form.handleSubmit(onSubmit, (errors) => {
-          console.log(errors);
-        })}
+        onSubmit={form.handleSubmit(onSubmit)}

As per coding guidelines.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
onSubmit={form.handleSubmit(onSubmit, (errors) => {
console.log(errors);
})}
onSubmit={form.handleSubmit(onSubmit)}
🤖 Prompt for AI Agents
In
frontend/plugins/frontline_ui/src/modules/ticket/components/add-ticket/AddTicketForm.tsx
around lines 88 to 90, remove the inline console.log in the form error handler;
either delete the second argument to form.handleSubmit (so validation errors are
shown inline) or replace the console.log with a toast notification using the
existing useToast from useCreateTicket (invoke toast.error or similar with a
concise validation-failed message and optionally list key errors). Ensure you
import/use the existing toast hook correctly and do not leave any console.*
calls.

Comment on lines +196 to +208
<Button
type="button"
variant="ghost"
className="bg-background hover:bg-background/90"
onClick={() => {
onClose();
form.reset();
editor?.removeBlocks(editor?.document);
setDescriptionContent(undefined);
}}
>
Cancel
</Button>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify BlockNote editor reset logic

Line 203 passes editor.document to removeBlocks, which expects block identifiers rather than the live document array. To clear the editor, use editor.replaceBlocks with an empty array or a single empty paragraph block.


🏁 Script executed:

#!/bin/bash
# Verify BlockNote API usage for clearing/resetting editor content

echo "Checking BlockNote documentation for correct editor reset pattern..."
echo "Expected: editor.replaceBlocks(editor.document, []) or similar"
echo ""
echo "Current usage at line 203:"
echo "  editor?.removeBlocks(editor?.document)"
echo ""
echo "This passes the document array to removeBlocks, which typically expects block IDs."

Length of output: 284


🌐 Web query:

BlockNote editor API how to clear all blocks or reset editor content

💡 Result:

Two simple ways:

  1. Remove every block (clear)
  • Get all top-level blocks from editor.document, map to IDs, call removeBlocks.
    Example:
    const ids = editor.document.map(b => b.id);
    editor.removeBlocks(ids);
    Use when you want an empty document. [1][2]
  1. Replace whole document (reset to specific content)
  • Use replaceBlocks to swap current blocks for new blocks (e.g., a single empty paragraph) or call insertBlocks after removing.
    Example (replace with one empty paragraph):
    const newBlocks = [{ type: "paragraph", content: "" }];
    editor.replaceBlocks(editor.document.map(b => b.id), newBlocks);
    Or create a fresh editor with initialContent to start with desired content. [1][3]

References:

  • Manipulating Content / Removing & Replacing Blocks. [1]
  • Editor methods (removeBlocks / replaceBlocks / transact). [2]
  • Example usage in BlockNote examples (insert/update/remove/replace). [3]

(If you want a ready-to-use snippet for your framework — React / vanilla JS / with Liveblocks — tell me which and I’ll paste it.)


Based on the BlockNote API documentation, the original review comment's concern is confirmed and well-founded.

The removeBlocks method expects an array of block identifiers (BlockIdentifier[]), where each identifier should be a string representing the block ID or a Block object. While Block objects can technically be used as BlockIdentifiers, the current code at line 203 passes editor?.document directly, which is not the proper documented usage pattern.

The correct approach is to map the document to block IDs first: const ids = editor.document.map(b => b.id); editor.removeBlocks(ids), or alternatively, use replaceBlocks to replace all existing blocks with an empty set.


Fix the editor reset logic at line 203

Change editor?.removeBlocks(editor?.document) to editor?.removeBlocks(editor?.document.map(b => b.id)) to properly pass block identifiers instead of the raw document array.

🤖 Prompt for AI Agents
In
frontend/plugins/frontline_ui/src/modules/ticket/components/add-ticket/AddTicketForm.tsx
around lines 196 to 208, the editor reset call passes the entire document to
removeBlocks which expects an array of block identifiers; change the call to
pass an array of block IDs (e.g., map the document to b.id) or use replaceBlocks
to clear blocks so removeBlocks receives BlockIdentifier[] instead of the raw
document.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed bd2f9d3 in 58 seconds. Click for details.
  • Reviewed 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/plugins/frontline_ui/src/modules/channels/components/settings/channels-list/CreateChannel.tsx:19
  • Draft comment:
    Switching from a relative to an alias import improves maintainability and readability. Confirm that alias '@/channels/states' is properly configured in your project (e.g., tsconfig/webpack) so that module resolution remains consistent.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_cGzOAC6rRJkHjkuw

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 4, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
16.9% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@Enkhtuvshin0513 Enkhtuvshin0513 merged commit d9467fe into main Nov 4, 2025
10 of 12 checks passed
@Enkhtuvshin0513 Enkhtuvshin0513 deleted the frontline-ticket-main branch November 4, 2025 05:18
This was referenced Nov 6, 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.

4 participants