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 branch menu #518

Merged
merged 129 commits into from
Feb 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
87e11f9
Add Git branch icons
kgryte Jan 1, 2020
8c0e5a2
Adjust icons
kgryte Jan 2, 2020
37ac57b
Add icon variables and rearrange variables in alphabetical order
kgryte Jan 2, 2020
2f5d676
Rename file
kgryte Jan 2, 2020
e7eee3a
Fix paths
kgryte Jan 2, 2020
58af806
Rename component and associated files
kgryte Jan 2, 2020
65c0bff
Move inline callbacks to private class methods
kgryte Jan 2, 2020
2527a7e
Remove empty lines
kgryte Jan 2, 2020
f957b78
Rename exports
kgryte Jan 2, 2020
b16bc79
Refactor and consolidate styles
kgryte Jan 2, 2020
36870b3
Add branch button
kgryte Jan 2, 2020
cbe54a8
Adjust margins
kgryte Jan 2, 2020
cbca7d0
Reorder classes
kgryte Jan 2, 2020
76cf533
Update title attribute
kgryte Jan 2, 2020
f0370cd
Toggle branch menu upon click
kgryte Jan 2, 2020
9b7c516
Rename variable and refactor logic
kgryte Jan 2, 2020
462f3d9
Stub BranchMenu component
kgryte Jan 2, 2020
072b033
Add render method
kgryte Jan 2, 2020
c15546c
Bind the extension model
kgryte Jan 2, 2020
4286a95
Listen to change event directly
kgryte Jan 2, 2020
fb7d9f9
Stub branch menu styles
kgryte Jan 3, 2020
65fd8e8
Merge branch 'master' of https://github.com/jupyterlab/jupyterlab-git…
kgryte Jan 3, 2020
e9da457
Add material-ui deps
kgryte Jan 3, 2020
9123ed9
Stub branch menu filter
kgryte Jan 3, 2020
354180b
Refactor menu buttons (WIP)
kgryte Jan 3, 2020
e66886a
Adjust styling
kgryte Jan 3, 2020
7abd65e
Update component state when updating filter
kgryte Jan 3, 2020
c0c6b3d
Add new branch button and adjust styles
kgryte Jan 4, 2020
c70fd9a
Fix filter clear icon layout
kgryte Jan 4, 2020
969f7cd
Adjust margin
kgryte Jan 4, 2020
fafdc95
Add icon to each list item
kgryte Jan 4, 2020
7b0f661
Fix font color in dark mode and adjust padding
kgryte Jan 4, 2020
97a0bd4
Add desktop icon
kgryte Jan 4, 2020
0b67d59
Add icon to menu button
kgryte Jan 4, 2020
6e0ca49
Adjust margin
kgryte Jan 4, 2020
19451ad
Add support for basic branch name filtering
kgryte Jan 4, 2020
b5cdcf7
Add note
kgryte Jan 4, 2020
0c42994
Add menu and close icons
kgryte Jan 4, 2020
947de30
Add support for switching the current branch
kgryte Jan 4, 2020
8c216ad
Use explicit promise handling
kgryte Jan 4, 2020
931aae6
Adjust styles for small panel widths
kgryte Jan 4, 2020
658d4f7
Adjust layout for narrow panel widths
kgryte Jan 4, 2020
ae3fe93
Add menu icon for repo menu dropdown
kgryte Jan 4, 2020
bf72d93
Highlight the active branch in the branch menu
kgryte Jan 4, 2020
ca99f93
Add support for showing a dialog for creating a new branch (WIP)
kgryte Jan 5, 2020
bd3eeee
Adjust dialog styles
kgryte Jan 5, 2020
a75b83d
Provide visual indication when input element focused
kgryte Jan 5, 2020
a94698f
Adjust styles
kgryte Jan 5, 2020
8c874af
Move dialog logic to separate component
kgryte Jan 5, 2020
cd8c32d
Rename classes and adjust styles
kgryte Jan 5, 2020
561a26c
Enable branch creation
kgryte Jan 5, 2020
cf8a709
Remove obsolete component and logic
kgryte Jan 5, 2020
19fd461
Add support for disabling branching
kgryte Jan 5, 2020
13a53be
Adjust tab styles and remove unused classes
kgryte Jan 6, 2020
fbc9688
Switch tab order
kgryte Jan 6, 2020
5192293
Refactor panel tabs
kgryte Jan 6, 2020
599ecd3
Refactor render method into smaller private methods
kgryte Jan 6, 2020
018f763
Remove comments
kgryte Jan 6, 2020
8953cc3
Set title attribute
kgryte Jan 7, 2020
fa216d3
Add title attribute tests
kgryte Jan 7, 2020
0a0c636
Add linebreaks
kgryte Jan 7, 2020
63f2aa3
Rename file and refactor tests
kgryte Jan 7, 2020
8edacf4
Refactor and add tests
kgryte Jan 7, 2020
ad66d44
Split rendering logic into separate private methods
kgryte Jan 7, 2020
a484cf9
Add tests
kgryte Jan 7, 2020
b1ec472
Add tests
kgryte Jan 7, 2020
6d2ccf7
Set state rather than force update
kgryte Jan 8, 2020
1924375
Listen to model changes
kgryte Jan 8, 2020
a8a8b69
Listen to model changes
kgryte Jan 8, 2020
d9aab89
Listen for status changes
kgryte Jan 8, 2020
1299846
Add log statements
kgryte Jan 8, 2020
68b6321
Set state to render upon model changes
kgryte Jan 8, 2020
4afed4a
Update tests
kgryte Jan 8, 2020
885cc1e
Add debug statements
kgryte Jan 8, 2020
28462dc
Remove debug statements
kgryte Jan 8, 2020
1fafb0a
Prevent memory leaks by removing event listeners
kgryte Jan 8, 2020
b2c0430
Provide the `this` context when removing listeners
kgryte Jan 8, 2020
1c8efe4
Refresh both status and branches on poll
kgryte Jan 8, 2020
5124f33
Merge branch 'master' of https://github.com/jupyterlab/jupyterlab-git…
kgryte Jan 8, 2020
205496a
Replace function expressions
kgryte Jan 8, 2020
404c3c4
Replace function expressions
kgryte Jan 8, 2020
b82efa9
Replace function expressions
kgryte Jan 8, 2020
2d3db26
Replace function expressions
kgryte Jan 8, 2020
ea2d0e4
Replace function expressions
kgryte Jan 8, 2020
7fdaa68
Revert to function expressions for event handlers
kgryte Jan 8, 2020
d380337
Revert to function expressions for event handlers using `this` context
kgryte Jan 8, 2020
6f6bfff
Revert to function expressions for event handlers
kgryte Jan 8, 2020
5735b13
Revert to function expressions for event handlers
kgryte Jan 8, 2020
f9e20f7
Revert to function expressions for event handlers
kgryte Jan 8, 2020
c9bdc28
Adjust tab height
kgryte Jan 8, 2020
7b897e0
Ensure minimum container height for displaying changed files
kgryte Jan 8, 2020
887dcac
Remove top margin and ensure minimum container height for history
kgryte Jan 8, 2020
9215318
Remove bottom margin for branch menu
kgryte Jan 8, 2020
cf20b93
Reduce min button height
kgryte Jan 8, 2020
7794eca
Add return type
kgryte Jan 8, 2020
9f1eaa4
Merge branch 'master' of https://github.com/jupyterlab/jupyterlab-git…
kgryte Jan 8, 2020
f1f2cf2
Add a border to the branch list
kgryte Jan 9, 2020
6009bae
Remove unused styles and remove min height requirement
kgryte Jan 9, 2020
55b7da2
Sort branches to ensure current branch listed first
kgryte Jan 9, 2020
a756c3f
Add frontend support for branching from an arbitrary branch
kgryte Jan 9, 2020
5542797
Add backend support for branching from an arbitrary branch
kgryte Jan 9, 2020
3ba0bf5
Avoid resetting the "base" branch each time the status updates
kgryte Jan 9, 2020
b67ed78
Add support for filtering branch menu
kgryte Jan 9, 2020
1f9e6ca
Fix styling for dark mode
kgryte Jan 9, 2020
b9ab321
Enforce light theming for the new branch dialog
kgryte Jan 10, 2020
a0099b1
Reset the filter upon creating a new branch
kgryte Jan 10, 2020
0bf96b7
Reset state upon closing dialog to create branch
kgryte Jan 10, 2020
5c96dd7
Add variable for explicitly targeting light theme
kgryte Jan 10, 2020
4269965
Use branch name for element key
kgryte Jan 25, 2020
dabd739
Remove duplicate state
kgryte Jan 25, 2020
ac75121
Remove listener for repository changes
kgryte Jan 25, 2020
87f144d
Move listener binding to lifecycle method
kgryte Jan 25, 2020
9bdb8f3
Remove listener and move listener binding to lifecyle method
kgryte Jan 25, 2020
1f940fc
Remove listener and move listener binding to lifecyle method
kgryte Jan 25, 2020
cb77764
Update comments
kgryte Jan 25, 2020
0aeaa16
Use branch name as element key
kgryte Jan 25, 2020
db804ce
Add title attribute
kgryte Jan 25, 2020
1bd564b
Ensure consistent container height for branch menu and file list
kgryte Jan 25, 2020
fcb6b42
broad stroke fixes for dark mode new branch dialog; still needs tweaks
telamonian Feb 7, 2020
c61f247
Update return types
kgryte Feb 12, 2020
1f4078a
Update descriptions
kgryte Feb 12, 2020
50470ce
Add return type and update description
kgryte Feb 12, 2020
f2a410e
Add return types and update descriptions
kgryte Feb 12, 2020
bb906e2
Add return value types and update descriptions
kgryte Feb 12, 2020
f1a692a
Add return value types and update descriptions
kgryte Feb 12, 2020
063c9f8
Remove aria attributes
kgryte Feb 12, 2020
95ea190
Disable button and remove button hint icon
kgryte Feb 12, 2020
45b4a30
Update dark theme dialog styling
kgryte Feb 12, 2020
f75c2a6
split out enabled style for branch select button
telamonian Feb 14, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions jupyterlab_git/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,12 +606,13 @@ def reset_to_commit(self, commit_id, top_repo_path):
)
return my_output

def checkout_new_branch(self, branchname, current_path):
def checkout_new_branch(self, branchname, startpoint, current_path):
"""
Execute git checkout <make-branch> command & return the result.
"""
cmd = ["git", "checkout", "-b", branchname, startpoint]
p = Popen(
["git", "checkout", "-b", branchname],
cmd,
stdout=PIPE,
stderr=PIPE,
cwd=os.path.join(self.root_dir, current_path),
Expand Down
2 changes: 1 addition & 1 deletion jupyterlab_git/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def post(self):
if data["checkout_branch"]:
if data["new_check"]:
my_output = self.git.checkout_new_branch(
data["branchname"], top_repo_path
data["branchname"], data["startpoint"], top_repo_path
)
else:
my_output = self.git.checkout_branch(data["branchname"], top_repo_path)
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
"@jupyterlab/services": "^4.1.0",
"@jupyterlab/terminal": "^1.1.0",
"@jupyterlab/ui-components": "^1.1.0",
"@material-ui/core": "^4.8.2",
"@material-ui/icons": "^4.5.1",
"@phosphor/widgets": "^1.8.0",
"diff-match-patch": "^1.0.4",
"nbdime": "~5.0.1",
Expand Down
213 changes: 0 additions & 213 deletions src/components/BranchHeader.tsx

This file was deleted.

Loading