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: use built-in splitPane component in collapse and editor #510

Merged
merged 5 commits into from
Nov 19, 2021

Conversation

mortalYoung
Copy link
Collaborator

简介

主要变更

  • 重构 Collapse 组件,暴露外部的接口基本不变
  • 优化 layout 的数据类型,由于底层的 Split 是基于 absolute 布局的,所以拿到的 sizes 都是 number 类型,所以类型需要改成 (number | string)[],而 controller 直接面对组件的接口的数据类型改为 number
  • 优化 sidebar 的隐藏方式,原先是通过 display:none 来实现的,但该缺点会导致切换的时候,无法获取到高度,导致 collapse 的位置计算出现问题,需要大量的改动,不如直接讲 sidebar 的隐藏方式改为 visibility
  • 重构 workbench 中的 Split 组件

@mortalYoung mortalYoung changed the title refactor: use built-in splitPane component in collapse and editor [WIP]: refactor: use built-in splitPane component in collapse and editor Nov 15, 2021
@mortalYoung mortalYoung requested a review from wewoor November 15, 2021 11:57
@mortalYoung mortalYoung self-assigned this Nov 15, 2021
@mortalYoung mortalYoung added the refactoring Refactor label Nov 15, 2021
@mortalYoung mortalYoung force-pushed the refactor/split branch 2 times, most recently from 14250fa to e522305 Compare November 17, 2021 06:11
@mortalYoung mortalYoung changed the title [WIP]: refactor: use built-in splitPane component in collapse and editor refactor: use built-in splitPane component in collapse and editor Nov 19, 2021
@mortalYoung
Copy link
Collaborator Author

应该没问题了,先合并过去了

@mortalYoung mortalYoung merged commit cab7688 into feat/split Nov 19, 2021
@mortalYoung mortalYoung deleted the refactor/split branch November 19, 2021 12:59
mortalYoung added a commit that referenced this pull request Dec 1, 2021
* refactor: use built-in splitPane component in collapse and editor

* feat: improve collapse

* feat: support resize strategy for Split Pane

* test: update tests

* test: add unit tests for Collapse Component
mortalYoung added a commit that referenced this pull request Dec 2, 2021
* refactor: use built-in splitPane component in collapse and editor

* feat: improve collapse

* feat: support resize strategy for Split Pane

* test: update tests

* test: add unit tests for Collapse Component
wewoor pushed a commit that referenced this pull request Feb 24, 2022
* feat: develop a Split Pane component

* feat: improve Split

* feat: support to set resize strategy for panes

* test: add unit tests for SplitPane

* feat: add exports in components/index

* test: update tests

* refactor: use built-in splitPane component in collapse and editor (#510)

* refactor: use built-in splitPane component in collapse and editor

* feat: improve collapse

* feat: support resize strategy for Split Pane

* test: update tests

* test: add unit tests for Collapse Component

* fix: editor cannot resize

* test: update snapshots

* feat: support to set minSize and maxSize

* feat: support maxSize and minSize in Pane

* feat: improve Split

* test: fix circular dependency

* test: update tests

* test: update snapshots

* docs: add Split component stories

* fix: improve the mouse move function in SplitPane

* test: update tests

* fix: replace react-split-pane in editor group

* test: update tests

* fix: fix the first editor in group can resize

* fix: fix unrelated size changed will trigger resize

* test: update tests

* fix: improve resize stratygy on editor groups

* fix: remove useless style

* fix: use focusBorder as the backup of sash.hoverBorder
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.

1 participant