Skip to content

Comments

[WEB-2552] fix: issue list overflow and event propagation#5706

Merged
pushya22 merged 3 commits intopreviewfrom
fix-issue-list-overflow
Sep 26, 2024
Merged

[WEB-2552] fix: issue list overflow and event propagation#5706
pushya22 merged 3 commits intopreviewfrom
fix-issue-list-overflow

Conversation

@anmolsinghbhatia
Copy link
Collaborator

@anmolsinghbhatia anmolsinghbhatia commented Sep 26, 2024

Problem:

  1. The issue name is overflowing in the sub-issue and relation section within the peek overview.
  2. When updating a sub-issue or related issue, the page redirects to that specific issue. The same behavior occurs when toggling a sub-issue.
  3. In the issue layout, the quick action is propagating the control link event.
  4. In the existing issue modal, when the issue title is long, it overflows.

Solution:

  1. Adjusted the layout to prevent the issue name from overflowing.
  2. Added event propagation control to prevent redirection after updating or toggling sub-issues.
  3. Implemented event propagation control for the quick action in the issue layout.
  4. Made necessary adjustments to prevent title overflow in the existing issue modal.

Areas to Test (For QA Team)

  • Issue Sub-issue and Issue Relation sections in the Issue Peek Overview.
  • Quick actions in the issue list layout, especially the edit and delete modals.
  • Add Existing Issue modal.

Reference:

[WEB-2552]

Media:

Before After
before after
before after
before after
before after

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 26, 2024

Walkthrough

The changes across multiple components primarily focus on enhancing the rendering and interaction of issue names within modals and lists. Modifications include the addition of truncation classes for better text overflow handling, the implementation of onClick event handlers to prevent default behaviors, and updates to styling for improved visual consistency. These adjustments aim to refine user interactions and the overall presentation of issues in the application.

Changes

Files Change Summary
web/core/components/core/modals/existing-issues-list-modal.tsx Modified rendering of issue names with added truncate class for text overflow handling and updated link styling.
web/core/components/issues/issue-layouts/list/block.tsx Added onClick event handler to prevent default actions and stop event propagation in the IssueBlock component.
web/core/components/issues/relations/issue-list-item.tsx Updated class names for better styling, added onClick handler, and modified structure for the RelationIssueListItem.
web/core/components/issues/sub-issues/issue-list-item.tsx Simplified class names, updated click event handlers to prevent default actions, and enhanced styling for text overflow.

Possibly related PRs

Suggested labels

🎨UI / UX

Suggested reviewers

  • sriramveeraghanta
  • SatishGandham

🐰 In the meadow, changes bloom,
Truncating names to make more room.
Clicks now dance without a care,
A smoother flow, a joy to share!
With each update, we hop along,
Enhancing views, where we belong! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@anmolsinghbhatia anmolsinghbhatia self-assigned this Sep 26, 2024
@anmolsinghbhatia anmolsinghbhatia added this to the v0.23-dev milestone Sep 26, 2024
@anmolsinghbhatia anmolsinghbhatia marked this pull request as ready for review September 26, 2024 10:19
Copy link
Contributor

@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: 0

🧹 Outside diff range and nitpick comments (5)
web/core/components/issues/relations/issue-list-item.tsx (2)

98-98: LGTM! Consider adding text truncation.

The removal of line-clamp-1 addresses the overflow issue mentioned in the PR objectives. However, to ensure long issue names don't overflow, consider adding a truncate class to this element or its child elements.

-        className="w-full cursor-pointer"
+        className="w-full cursor-pointer truncate"

126-132: LGTM! Effective solution for event propagation issues.

The addition of the onClick event handler that prevents default actions and stops event propagation effectively addresses the issues mentioned in the PR objectives. This will prevent unwanted redirections when interacting with sub-issues or relations.

Consider extracting the event handler to a separate function for improved readability:

+  const handleRelationIssuePropertyClick = (e: React.MouseEvent) => {
+    e.preventDefault();
+    e.stopPropagation();
+  };
+
   // ... (inside the component's return statement)
   <div
     className="flex-shrink-0 text-sm"
-    onClick={(e) => {
-      e.preventDefault();
-      e.stopPropagation();
-    }}
+    onClick={handleRelationIssuePropertyClick}
   >
web/core/components/issues/sub-issues/issue-list-item.tsx (1)

153-159: Approve IssueProperty wrapper and suggest minor improvement

The addition of a wrapper div with event propagation control around the IssueProperty component is a good improvement. This change addresses the PR objective of controlling event propagation for quick actions in the issue layout, enhancing the user experience.

However, consider extracting the inline click handler to a separate function for better readability and maintainability.

Consider refactoring the click handler as follows:

const handleIssuePropertyClick = (e: React.MouseEvent) => {
  e.preventDefault();
  e.stopPropagation();
};

// Then in the JSX:
<div
  className="flex-shrink-0 text-sm"
  onClick={handleIssuePropertyClick}
>
  <IssueProperty
    // ... props ...
  />
</div>

This refactoring will improve code readability and make it easier to add any additional logic to the handler in the future if needed.

web/core/components/issues/issue-layouts/list/block.tsx (1)

274-277: LGTM! Consider adding a comment for clarity.

The addition of this onClick handler effectively addresses the issue of unwanted redirection when interacting with sub-issues, as outlined in the PR objectives. By preventing the default action and stopping event propagation, it ensures that clicks on this element don't trigger unintended navigation.

Consider adding a brief comment explaining the purpose of this event handler for future maintainability:

 onClick={(e) => {
   e.preventDefault();
   e.stopPropagation();
+  // Prevent navigation when interacting with quick actions
 }}
web/core/components/core/modals/existing-issues-list-modal.tsx (1)

Line range hint 1-324: Consider enhancing accessibility with aria-labels

The component implementation looks good overall and aligns well with the PR objectives. To further improve accessibility, consider adding aria-labels to key interactive elements, such as the search input and the workspace level toggle switch. This will provide better context for screen reader users.

Example:

<Combobox.Input
  aria-label="Search for issues"
  // ... other props
/>

<ToggleSwitch
  aria-label="Toggle workspace level search"
  // ... other props
/>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 150af98 and 90d0d04.

📒 Files selected for processing (4)
  • web/core/components/core/modals/existing-issues-list-modal.tsx (2 hunks)
  • web/core/components/issues/issue-layouts/list/block.tsx (1 hunks)
  • web/core/components/issues/relations/issue-list-item.tsx (2 hunks)
  • web/core/components/issues/sub-issues/issue-list-item.tsx (5 hunks)
🔇 Additional comments (11)
web/core/components/issues/relations/issue-list-item.tsx (3)

103-103: LGTM! Effective solution for text overflow.

The addition of the truncate class effectively addresses the issue of overflowing text mentioned in the PR objectives. Retaining the cursor-pointer class maintains the interactive nature of the element.


123-123: LGTM! Improved handling of long issue names.

The addition of w-full and truncate classes effectively addresses the issue of overflowing text for long issue names, as mentioned in the PR objectives. This change ensures better readability and consistent layout.


Line range hint 1-185: Overall, great implementation addressing the PR objectives.

The changes effectively solve the issues of text overflow and event propagation mentioned in the PR objectives. The code quality is good, with clear and purposeful modifications. The suggestions provided are minor and aimed at further improving readability and consistency.

Remember to test the changes thoroughly, especially focusing on:

  1. The display of long issue names in various sections.
  2. The behavior of sub-issues and relations when interacting with them.
  3. The functionality of quick actions in the issue list layout.

Great job on addressing these UI/UX improvements!

web/core/components/issues/sub-issues/issue-list-item.tsx (5)

89-90: Approve change and verify overflow behavior

The removal of the line-clamp-1 class from the ControlLink component aligns with the PR objective of addressing overflow issues. This change should help prevent the overflow of issue names in the sub-issue and relation sections.

Please verify that this change effectively resolves the overflow issue without introducing any unintended side effects in the UI.


107-109: Approve event propagation control

The addition of e.preventDefault() and e.stopPropagation() in the click event handler effectively addresses the PR objective of preventing unwanted redirection when updating or toggling sub-issues. This change enhances the user experience by ensuring that clicks on sub-issues don't trigger unintended actions in parent components.


130-130: Approve truncate class addition

The addition of the truncate class to the issue name container is a good improvement. This change enhances text overflow management and directly addresses the PR objective of preventing the overflow of issue names in the sub-issue and relation sections.


149-149: Approve tooltip span improvements

The addition of the truncate class and the specific text color class (text-custom-text-100) to the tooltip span for the issue name is a good improvement. These changes enhance visual consistency, improve readability, and further address the overflow issue mentioned in the PR objectives.


Line range hint 1-255: Summary of changes and overall approval

The changes made to the IssueListItem component effectively address the PR objectives:

  1. Overflow issues have been resolved by removing line-clamp-1 and adding truncate classes.
  2. Unwanted redirection has been prevented by adding event propagation control.
  3. Quick actions in the issue layout now have proper event handling.

These modifications improve the overall functionality and user experience of the issue list item component. The code changes are well-implemented and align with the PR's goals.

web/core/components/issues/issue-layouts/list/block.tsx (1)

Line range hint 1-290: Overall implementation looks good. Verify with QA team.

The changes made to the IssueBlock component effectively address the issue of unwanted redirection when updating or toggling sub-issues, as outlined in the PR objectives. The implementation is minimal and focused, without introducing any apparent side effects or breaking changes.

Please ensure that the QA team thoroughly tests the following scenarios:

  1. Updating sub-issues in the Issue Sub-issue section of the Issue Peek Overview.
  2. Toggling sub-issues in the Issue Sub-issue section.
  3. Interacting with quick actions in the issue list layout, particularly the edit and delete modals.

To assist with verification, you can use the following script to locate all usage of the IssueBlock component:

This will help ensure that the changes have the intended effect across all instances where the IssueBlock component is used.

web/core/components/core/modals/existing-issues-list-modal.tsx (2)

Line range hint 252-269: LGTM: Improved text truncation for issue names

The addition of the truncate class to both the container div and the issue name span effectively addresses the overflow issue mentioned in the PR objectives. This change ensures that long issue names will be truncated appropriately, improving the overall layout and readability of the issue list.


274-274: LGTM: Improved layout for issue link icon

The addition of flex-shrink-0 to the a tag prevents the link icon from being compressed when the issue name is long. This change ensures that the icon remains visible and accessible, contributing to the overall improvement of the layout and user experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants