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

[KED-2633] Add split panel component and implement into sidebar #448

Merged
merged 5 commits into from
May 18, 2021

Conversation

bru5
Copy link
Contributor

@bru5 bru5 commented May 14, 2021

Description

Adds a new split panel component and splits the current sidebar into two sections.

split-panel-2

Development notes

There is a new generic SplitPanel component, which implements user resizing.

The existing sidebar has been split into two panels, the elements section is now in the top and the categories are in the bottom panel.

This work is the first part of a series of design changes coming to the sidebar.

QA notes

Other than the split panel, functionality is the same as existing, including all existing search and filters which should be tested through and compared to the previous release.

Usability should also be tested, focus and keyboard arrows are implemented.

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added new entries to the RELEASE.md file
  • Added tests to cover my changes

Legal notice

  • I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":

  • I submit this contribution under the Apache 2.0 license and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.

  • I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorised to submit this contribution on behalf of the original creator(s) or their licensees.

  • I certify that the use of this contribution as authorised by the Apache 2.0 license does not violate the intellectual property rights of anyone else.

@bru5 bru5 self-assigned this May 14, 2021
@bru5 bru5 requested a review from comym May 14, 2021 14:07
@bru5 bru5 requested a review from limdauto as a code owner May 17, 2021 12:57
@limdauto limdauto force-pushed the feature/split-panel branch from aeeffe8 to 6eb3c1f Compare May 17, 2021 14:26
@@ -1,4 +1,4 @@
semver~=2.10 # Needs to be at least 2.10.0 to get VersionInfo.match
Flask>=1.0, <2.0
Flask>=2.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this change related to / required by this PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just saw the commit history and it looks like this has been updated yesterday from lim - perhaps this should be introduced in a seperate PR?

Copy link
Contributor Author

@bru5 bru5 May 18, 2021

Choose a reason for hiding this comment

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

Yeah this was a temporary fix by @limdauto, I think this is resolved in the main branch now though which I've merged here.

handle: handleRef.current?.getBoundingClientRect(),
});

const clampSplit = (value) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I know it's hard to find a good variable name for this, but clampSplit sounds a bit confusing - perhaps calling it 'calculateSplitorcalculateXX` ( whatever it is trying to calculate) would be more intuitive?

Copy link
Contributor Author

@bru5 bru5 May 18, 2021

Choose a reason for hiding this comment

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

Fair enough if clamp seems to clash with split I guess, I've refactored this to just clamp then as calculate doesn't really provide any information on what it does.

* @param {?number} [splitMax=1] A number [0...1] as the maximum % split position
* @param {?number} [keyboardStep=0.025] A number [0...1] as the % step to move split when using keyboard
* @param {?string} [orientation='vertical'] Only 'vertical' currently supported.
* @return {object} The rendered children
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be more clear to add some example of what the children usually is and any expected format of the children in the comment, such as the react component it is encapsulating, etc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure I've improved the documentation in this file, including a note that the test file serves as a reference usage.

Copy link
Contributor

@studioswong studioswong left a comment

Choose a reason for hiding this comment

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

Really great work @bru5 , tested across browsers and also on the lib-test, works well in all cases. Well done 👍

@bru5 bru5 merged commit 9672894 into main May 18, 2021
@bru5 bru5 deleted the feature/split-panel branch May 18, 2021 15:47
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.

4 participants