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

refactor: refactor Split component #763

Merged
merged 10 commits into from
Jun 17, 2022
Merged

Conversation

yyllff
Copy link
Collaborator

@yyllff yyllff commented Jun 14, 2022

Description

重构Split组件,精简代码,优化DOM显示结构

Changes

  • 新增showSashes配置,用于控制是否显示滑轴,从而决定Pane是否可改变尺寸
  • allowResize含义变更为:外层容器尺寸改变时(如页面缩放)面板尺寸的变化方式(若为false,面板维持原尺寸;若为true,面板等比缩放)
  • 去掉onResizeStrategy回调,其功能可基于allowResize实现
  • 修复一些小问题:如页面缩放后滑轴的鼠标跟随效果有误差、去掉多余的轴(如默认情况下最左侧会多一个无用的sash)

How Has This Been Tested?

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@wewoor wewoor requested review from mortalYoung and wewoor June 14, 2022 13:51
@wewoor wewoor added this to the 1.0.0 milestone Jun 14, 2022
@wewoor wewoor added the refactoring Refactor label Jun 14, 2022
@wewoor
Copy link
Collaborator

wewoor commented Jun 14, 2022

@yyllff PR 非常棒,然后描述稍微写一下, 新代码的单测、静态检查需要看看。我们尽快 Review

@wewoor wewoor requested a review from mumiao June 14, 2022 13:59
@codecov
Copy link

codecov bot commented Jun 16, 2022

Codecov Report

Merging #763 (5e84a3d) into main (09a5774) will increase coverage by 0.18%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #763      +/-   ##
==========================================
+ Coverage   91.46%   91.64%   +0.18%     
==========================================
  Files         191      191              
  Lines        5984     5866     -118     
  Branches     1440     1404      -36     
==========================================
- Hits         5473     5376      -97     
+ Misses        505      484      -21     
  Partials        6        6              
Impacted Files Coverage Δ
src/workbench/editor/editor.tsx 95.00% <ø> (+8.63%) ⬆️
src/components/collapse/index.tsx 100.00% <100.00%> (+0.74%) ⬆️
src/components/split/SplitPane.tsx 100.00% <100.00%> (+1.31%) ⬆️
src/components/split/base.ts 100.00% <100.00%> (ø)
src/components/split/sash.tsx 100.00% <100.00%> (ø)
src/model/workbench/layout.ts 100.00% <100.00%> (ø)
src/workbench/workbench.tsx 100.00% <100.00%> (+28.84%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 09a5774...5e84a3d. Read the comment docs.

src/components/split/sash.tsx Outdated Show resolved Hide resolved
src/components/split/sash.tsx Outdated Show resolved Hide resolved
@wewoor
Copy link
Collaborator

wewoor commented Jun 16, 2022

image

Explorer 这个功能设计应该是默认不能 Resize@yyllff

src/components/collapse/index.tsx Outdated Show resolved Hide resolved
src/components/collapse/index.tsx Outdated Show resolved Hide resolved
src/components/collapse/index.tsx Show resolved Hide resolved
@yyllff
Copy link
Collaborator Author

yyllff commented Jun 16, 2022

image

Explorer 这个功能设计应该是默认不能 Resize@yyllff

收到 已修复 麻烦再看下哈

src/components/collapse/index.tsx Outdated Show resolved Hide resolved
src/components/collapse/index.tsx Outdated Show resolved Hide resolved
src/components/split/sash.tsx Outdated Show resolved Hide resolved
src/components/split/sash.tsx Show resolved Hide resolved
@wewoor wewoor mentioned this pull request Jun 17, 2022
13 tasks
Copy link
Collaborator

@wewoor wewoor left a comment

Choose a reason for hiding this comment

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

+1

@wewoor wewoor merged commit ff1a27e into DTStack:main Jun 17, 2022
@mumiao
Copy link
Collaborator

mumiao commented Jun 17, 2022

+1

@yyllff
Copy link
Collaborator Author

yyllff commented Oct 11, 2022 via email

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

Successfully merging this pull request may close these issues.

4 participants