Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WEB-2316] chore: Change kanban group virtualization logic #5664

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

rahulramesha
Copy link
Contributor

@rahulramesha rahulramesha commented Sep 20, 2024

This PR has changes to change the Render if visible logic to improve kanban group virtualization.

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced visibility handling in the RenderIfVisible component for improved styling based on visibility states.
  • Bug Fixes

    • Adjusted vertical positioning in the KanBan component to improve layout and visibility of issues.
  • Refactor

    • Removed the issueIds property from multiple components (IssueBlockRoot, IssueBlocksList, SpreadsheetIssueRow, and SpreadsheetTable) to streamline functionality and reduce confusion.

These updates aim to enhance user experience and improve component efficiency within the application.

Copy link
Contributor

coderabbitai bot commented Sep 20, 2024

Walkthrough

The changes in this pull request primarily focus on modifications to the visibility logic and properties of several components related to issue layouts. Key adjustments include the alteration of conditions for styling in the RenderIfVisible component, the removal of the issueIds property from various components, and updates to the vertical positioning within the KanBan component. These changes streamline the components and enhance their functionality based on visibility and layout requirements.

Changes

File Path Change Summary
web/core/components/core/render-if-visible-HOC.tsx Updated visibility logic in RenderIfVisible to check shouldRecordHeights instead of placeholderChildren.
web/core/components/issues/issue-layouts/kanban/default.tsx Changed verticalOffset in RenderIfVisible from 0 to 100, affecting layout in the Kanban view.
web/core/components/issues/issue-layouts/list/block-root.tsx Removed issueIds prop from IssueBlockRoot component, simplifying its props.
web/core/components/issues/issue-layouts/list/blocks-list.tsx Removed issueIds from props passed to IssueBlockRoot instances.
web/core/components/issues/issue-layouts/spreadsheet/issue-row.tsx Removed issueIds from SpreadsheetIssueRow props, streamlining the component.
web/core/components/issues/issue-layouts/spreadsheet/spreadsheet-table.tsx Removed issueIds from props in SpreadsheetTable, indicating it is no longer utilized.

Possibly related PRs

Suggested labels

⚡performance

Poem

🐇 In the fields where bunnies play,
Changes sprout like flowers in May.
Visibility shifts, layouts align,
With each hop, our code will shine!
So let’s celebrate, with joy and cheer,
A cleaner path for all to steer! 🌼


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a4933b5 and 6eb7c03.

Files selected for processing (6)
  • web/core/components/core/render-if-visible-HOC.tsx (1 hunks)
  • web/core/components/issues/issue-layouts/kanban/default.tsx (1 hunks)
  • web/core/components/issues/issue-layouts/list/block-root.tsx (0 hunks)
  • web/core/components/issues/issue-layouts/list/blocks-list.tsx (0 hunks)
  • web/core/components/issues/issue-layouts/spreadsheet/issue-row.tsx (0 hunks)
  • web/core/components/issues/issue-layouts/spreadsheet/spreadsheet-table.tsx (0 hunks)
Files not reviewed due to no reviewable changes (4)
  • web/core/components/issues/issue-layouts/list/block-root.tsx
  • web/core/components/issues/issue-layouts/list/blocks-list.tsx
  • web/core/components/issues/issue-layouts/spreadsheet/issue-row.tsx
  • web/core/components/issues/issue-layouts/spreadsheet/spreadsheet-table.tsx
Additional comments not posted (2)
web/core/components/core/render-if-visible-HOC.tsx (1)

78-78: Approve the change in the style object logic.

The modification to the style object logic aligns with the PR objective of enhancing the virtualization of kanban groups by improving the "Render if visible" logic.

Please ensure that this change does not introduce any unintended side effects or break existing functionality. Verify the impact of this change on the rendering behavior and functionality of the component, especially in scenarios where shouldRecordHeights is false.

You can use the following script to search for usages of the RenderIfVisible component and analyze how the change affects the rendering behavior:

Verification successful

Verify the change: Impact on rendering behavior is as intended

The modification to the RenderIfVisible component's style calculation, which now considers both isVisible and shouldRecordHeights, aligns with the PR objective of enhancing virtualization for kanban groups. The shouldRecordHeights prop is being used intentionally in different scenarios:

  • Enabled for mobile views in list layout
  • Disabled for spreadsheet views
  • Default behavior (true) for other cases, including kanban layout

This change provides more flexibility in controlling when heights should be recorded, which can improve performance in specific use cases.

No apparent issues or unintended side effects are observed from the current usage across the codebase. The change appears to be implemented correctly and consistently.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for usages of the `RenderIfVisible` component and analyze the impact of the change.

# Test: Search for the component usage. 
# Expect: Identify places where `shouldRecordHeights` prop is used and set to `false`.
rg --type typescript -A 5 $'RenderIfVisible'

Length of output: 78


Script:

#!/bin/bash
# Description: Search for usages of the RenderIfVisible component and analyze the impact of the change.

# Search for RenderIfVisible usage in TypeScript files
echo "Searching for RenderIfVisible usage:"
rg -t ts -t tsx -A 10 -B 5 'RenderIfVisible'

# Search for shouldRecordHeights prop usage
echo "\nSearching for shouldRecordHeights prop usage:"
rg -t ts -t tsx 'shouldRecordHeights'

# Search for potential issues or side effects related to the change
echo "\nSearching for potential issues or side effects:"
rg -t ts -t tsx 'isVisible.*shouldRecordHeights'

Length of output: 514


Script:

#!/bin/bash
# Description: Search for usages of the RenderIfVisible component and analyze the impact of the change.

# Search for RenderIfVisible usage in TypeScript and TSX files
echo "Searching for RenderIfVisible usage:"
fd -e ts -e tsx | xargs rg -A 10 -B 5 'RenderIfVisible'

# Search for shouldRecordHeights prop usage
echo "\nSearching for shouldRecordHeights prop usage:"
fd -e ts -e tsx | xargs rg 'shouldRecordHeights'

# Search for potential issues or side effects related to the change
echo "\nSearching for potential issues or side effects:"
fd -e ts -e tsx | xargs rg 'isVisible.*shouldRecordHeights'

Length of output: 21930

web/core/components/issues/issue-layouts/kanban/default.tsx (1)

186-186: Verify the reasoning behind increasing the verticalOffset value.

Increasing the verticalOffset value from 0 to 100 means that the KanbanGroup component will start rendering earlier when it is further away from the visible viewport. This change may impact performance by triggering the rendering of the component earlier than necessary.

Consider using a smaller verticalOffset value to optimize performance and avoid unnecessary rendering of the KanbanGroup component when it is not yet visible to the user. Alternatively, provide justification for the increased value if there are specific reasons for this change.

To verify the impact on performance, you can use browser developer tools to profile the rendering behavior and measure the performance impact of different verticalOffset values.


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.

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

Successfully merging this pull request may close these issues.

2 participants