Skip to content

fix(grid): [grid] fix panel flash in page #1903

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

gimmyhehe
Copy link
Member

@gimmyhehe gimmyhehe commented Aug 14, 2024

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Updated the package version to 3.18.1, including the addition of a license field for clarity on distribution.
    • Improved management of popper elements for better visibility control and resource management.
  • Bug Fixes

    • Enhanced the destruction and initialization logic of popper components to prevent potential issues.
  • Chores

    • Reorganized dependency management for improved clarity and maintainability.

@gimmyhehe gimmyhehe added the bug Something isn't working label Aug 14, 2024
Copy link

coderabbitai bot commented Aug 14, 2024

Walkthrough

The recent updates to the @opentiny/vue-grid package involve a minor version increment, improved dependency management, and enhanced clarity in the component's code. The package.json has been reorganized to better reflect the structure of dependencies and includes the addition of the license field. Changes to the popper element management in the component's lifecycle improve readability and maintainability, demonstrating a commitment to code quality.

Changes

File Path Change Summary
packages/vue/src/grid/package.json Version updated from 3.18.0 to 3.18.1; added license field as "MIT"; reorganized dependencies and devDependencies.
packages/vue/src/grid/src/filter/src/panel.tsx Improved popper management logic; clarified creation and destruction process for the popper instance.

Poem

🐇 In the code, a hop, a skip,
Small updates that make us flip!
Dependencies dance, in tidy rows,
A popper's life, as clarity grows.
With every change, we leap with glee,
For better code is the key, you see! ✨


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

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

Commits

Files that changed from the base of the PR and between 3533664 and 8658f01.

Files selected for processing (2)
  • packages/vue/src/grid/package.json (1 hunks)
  • packages/vue/src/grid/src/filter/src/panel.tsx (2 hunks)
Additional context used
Biome
packages/vue/src/grid/src/filter/src/panel.tsx

[error] 298-301: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

Additional comments not posted (5)
packages/vue/src/grid/package.json (3)

4-4: Version increment is appropriate.

The version change from 3.18.0 to 3.18.1 is suitable for a minor update, indicating bug fixes or minor enhancements.


6-6: License addition is appropriate.

Adding the "MIT" license field clarifies the package's licensing terms.


15-33: Dependency management improvements are appropriate.

The reorganization of dependencies and the addition of @opentiny-internal/vue-test-utils and vitest in devDependencies enhance clarity and support testing.

packages/vue/src/grid/src/filter/src/panel.tsx (2)

291-294: Improved popper destruction logic.

The explicit check and null assignment enhance readability and ensure proper cleanup of resources.


295-308: Improved popper initialization logic.

The visibility check ensures the popper is only created when needed, enhancing performance. The addition of gpuAcceleration: false may affect rendering performance; ensure this change doesn't introduce any issues.

Verification successful

Consistent use of gpuAcceleration: false across the codebase.

The setting gpuAcceleration: false is consistently used in various components, suggesting an intentional choice by the developers. This consistency indicates that its impact on rendering performance has likely been considered and deemed acceptable.

  • Files with gpuAcceleration: false:
    • packages/vue/src/select/src/index.ts
    • packages/vue/src/select-dropdown/src/index.ts
    • packages/vue/src/popover/src/index.ts
    • packages/vue/src/grid/src/filter/src/panel.tsx
    • packages/vue/src/base-select/src/index.ts
    • packages/renderless/src/cascader/vue.ts
    • packages/renderless/src/picker/index.ts
    • packages/renderless/src/common/deps/vue-popper.ts
    • packages/renderless/src/dropdown-menu/index.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of `gpuAcceleration: false` on rendering performance.

# Test: Search for all instances where `gpuAcceleration` is set. Expect: Consistent usage across the codebase.
rg --type tsx 'gpuAcceleration: false'

Length of output: 68


Script:

#!/bin/bash
# Description: Verify the impact of `gpuAcceleration: false` on rendering performance.

# Test: Search for all instances where `gpuAcceleration` is set. Expect: Consistent usage across the codebase.
rg --type ts 'gpuAcceleration: false'

Length of output: 1022

Tools
Biome

[error] 298-301: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

Comment on lines +298 to +301
const reference = targetElemParentTr && targetElemParentTr.querySelector(`svg.tiny-grid-filter__btn.${id}`)
const popper = this.$el

popper.style.zIndex = PopupManager.nextZIndex()
popper.style.zIndex = PopupManager.nextZIndex()
Copy link

Choose a reason for hiding this comment

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

Consider using optional chaining.

Using optional chaining can prevent runtime errors if targetElemParentTr is null.

- const reference = targetElemParentTr && targetElemParentTr.querySelector(`svg.tiny-grid-filter__btn.${id}`)
+ const reference = targetElemParentTr?.querySelector(`svg.tiny-grid-filter__btn.${id}`)
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 reference = targetElemParentTr && targetElemParentTr.querySelector(`svg.tiny-grid-filter__btn.${id}`)
const popper = this.$el
popper.style.zIndex = PopupManager.nextZIndex()
popper.style.zIndex = PopupManager.nextZIndex()
const reference = targetElemParentTr?.querySelector(`svg.tiny-grid-filter__btn.${id}`)
const popper = this.$el
popper.style.zIndex = PopupManager.nextZIndex()
Tools
Biome

[error] 298-301: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

@zzcr zzcr merged commit b5b6cb4 into opentiny:release-3.18.0 Aug 16, 2024
5 of 9 checks passed
kagol pushed a commit that referenced this pull request Sep 6, 2024
* feat: gitHub-action remove runtime script

* fix(anchor): 修复anchor点击后滚动响应滞后的问题,适配saas主题 (#1892)

* feat: update package.json dependencies

* fix(theme): Fixed the issue that multiple root files are generated when the theme is packaged. (#1893)

* fix(theme): 删除无用的error-page文件导致打包多个root的问题

* fix(theme): 优化打包脚本

* fix: fix time-select build error

* fix: split theme build error

* fix(nav-menu): [nav-menu] error occurred when modifying route redirection (#1907)

* fix(nav-menu): [nav-menu] error occurred when modifying route redirection

* fix(nav-menu): [nav-menu] error occurred when modifying route redirection

* fix(grid): [grid] fix panel flash in page (#1903)

* fix(select): fix select for no-match-value 's bug (#1926)

* docs(changelog): update 3.18.0 changelog (#1928)

* fix(link): remove link's emits declare and add e2e test for click event (#1944)

* fix(theme): fix theme dark style (#2019)

* fix(theme): fix theme dark style

* fix(theme): fix theme dark style

* feat(docs): 文档增加切换主题提示 (#2024)

* feat: update docs version

* fix(tree): [tree] fix tree showLine props's bug ,  sometimes the line is too… (#2015)

* fix(tree): fix tree showLine props's bug ,  sometimes the line is too long

* fix(theme): update version

* build(sites): optimize build chunks num (#2028)

* feat: update vue-docs version

* fix(docs): The theme switch prompt is placed in the lower right corner. (#2030)

* fix(docs): 主题切换提示放到右下角

* fix(docs): 增加docs版本

* fix(modal): [modal] after the window size is changed, the window is displayed in the center (#2033)

* fix(modal): [modal]dragging the modal box,will be displayed in the center

* fix: modify review code

* fix(modal): modify review code

* fix: modify renderless of version

* fix(grid): [grid] fix empty slot error when is-center-empty is set (#2051)

* docs: fix demo anchor not correct (#2056)

* feat: update docs version

* Merge branch 'dev' of github.com:opentiny/tiny-vue into sync-3.18.0-to-dev

---------

Co-authored-by: chenxi-20 <76168465+chenxi-20@users.noreply.github.com>
Co-authored-by: wuyiping0628 <42107997+wuyiping0628@users.noreply.github.com>
Co-authored-by: gimmyhehe <975402925@qq.com>
Co-authored-by: 申君健 <40288193@qq.com>
Co-authored-by: chenxi-20 <2465950588@qq.com>
Co-authored-by: James <72028410+James-9696@users.noreply.github.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants