This repository was archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 406
Commit Preview #1767
Merged
Merged
Commit Preview #1767
Changes from all commits
Commits
Show all changes
416 commits
Select commit
Hold shift + click to select a range
45c2ddf
Patch tests are :white_check_mark: :fireworks:
smashwilson dc0c14d
Adapt callers to changed buildStagePatchForLines() return value
smashwilson c148a8d
Catch that other "getFilePatchesContaining() returns a Set" call
smashwilson 188d2ea
Cover the last few Patch methods
smashwilson 2fff972
Bring NullPatch up to date
smashwilson 462dffd
missed a rename oops
vanessayuenn 6b1744b
FilePatch tests :white_check_mark: + coverage
smashwilson c8c0ef0
:fire: dot only
smashwilson 772c36d
:fire: another dot only
smashwilson bbfd510
getpatchlayer
vanessayuenn ae8a4fb
WIP MultiFilePatch tests
smashwilson 2b1b4a9
probably should be for..in since we're interating through an array
vanessayuenn 1418498
fix ChangedFileContainer tests
8d7e965
Merge branch 'commit-preview' of github.com:atom/github into pr-1767/…
vanessayuenn 4b12015
Merge remote-tracking branch 'origin' into pr-1767/atom/commit-preview
8a49372
fix some of the RootController tests
680f373
WIP - why `RootController` tests no worky
1513921
fix test syntax oops
43199ee
Correctly invalidate cache in `applyPatchToIndex` based on MFP file p…
kuychaco 05dff68
:fire: duplicate `getPatchLayer`
kuychaco 15039ba
:fire: unused import
kuychaco 344f4b9
Clear and remark patch layer in `adoptBufferFrom`
kuychaco eb714c5
Add missing methods to NullPatch
kuychaco 8d9aa25
Restyle file and hunk headers
simurai 1b1cbd2
Remove long-obsolete .setState() calls in RootController tests
smashwilson 8c004aa
Update RootController discard and undo tests to use MultiFilePatches
smashwilson f3809cb
Accept a MultiFilePatch in Present::applyPatchToWorkdir()
smashwilson 86a8da1
Construct partial stage patches on an existing non-empty TextBuffer
smashwilson 181adf8
Passing test for cross-file partial stage patch generation
smashwilson 972cab7
Preserve FilePatch order in getFilePatchesContaining()
smashwilson 836207f
make CommitPreviewContainer tests pass
07cee58
fix nullpatch being displayed
vanessayuenn ddd0630
fix commitpreviewitem tests
vanessayuenn 6bfe025
Turns out we don't actually need that Set
smashwilson 1eff20f
We actually care about typechanges, not just having a symlink
smashwilson ccd4eb6
MultiFilePatch tests: (un)staged patch generation, predicates
smashwilson d52b987
filePatch is soooo last week; we are on multiFilePatch now. 🆒
vanessayuenn d03c37c
we don't care about active/inactive anymore... i think.
vanessayuenn 467a33e
no `.only`
vanessayuenn ea76f59
Full MultiFilePatch coverage for everything but getNextSelectionRange()
smashwilson c6a8aa0
new clone method for MFP
vanessayuenn 4ac8af8
use the new clone method in MFP view test
vanessayuenn 3908ffc
import the right thing
vanessayuenn 44bc9b7
use this.constructor.name for metrics
bc86c23
replace usages of old clone method with those of the new one
vanessayuenn 634a391
One more thing...
vanessayuenn 973566d
Make the MultiFilePatch constructor like the others
smashwilson a3ef82a
Return real Ranges
smashwilson 37de91a
Use .clone() within MultiFilePatch
smashwilson ccced0b
Test fixture builders for the MultiFilePatch models
smashwilson 5294545
Default newFile to oldFile because they're almost always the same
smashwilson 8fc07fa
Can't use the same names for properties and methods
smashwilson 483c69f
Forgot the first argument to .appendMarked()
smashwilson 8547505
First batch of examples that use the builder API
smashwilson f3a8b1f
Build real Ranges in Patch methods
smashwilson b6176ec
Delegate getFirstChangeRange() to the Patch
smashwilson 566b9e9
Forward .status() and .addHunk() to PatchBuilder
smashwilson 73d88c0
fix MultiFilePatchController tests
e62f508
:fire: mount
e6561aa
I fuck up partial staging more often than not.
1ece7eb
:shirt:
513e83c
it was the missing brackets in the parlor with the lead pipe.
4f80490
that's not how you get the hunks
f9930e5
Add more spacing between files
simurai dfdbd47
Make text selections blue
simurai 8da27e6
Remove background color from hunks
simurai 70b4dee
Fix cursor line on diffs
simurai 4280a30
Add borders to hunk buttons
simurai c898ad6
:fire: Remove gutter background
simurai 53177a8
Mark regions with exclusive: true to avoid stretching markers
smashwilson 5bebe03
It helps if you actually call that block
smashwilson 9b69f0e
Initialize default regions before computing hunk row counts
smashwilson e7feca7
Compute valid hunk start rows
smashwilson 1475fce
It helps if you call methods that actually exist
smashwilson c514170
Mark to the end of the previous line
smashwilson d81a9cc
Allow nullFiles in FilePatches
smashwilson e5d0b95
Another method/property name collision
smashwilson b7a4dc7
fix exec mode change tests
vanessayuenn ec70e50
fix hunk headers test
vanessayuenn e0855f6
Allow empty blocks for addHunk() and addFilePatch() to accept defaults
smashwilson 1fd0b0d
Right right that expects an Array
smashwilson cd4ec37
fix hunk lines tests
vanessayuenn 13ad648
That rename we were just talking about
smashwilson cca116e
MultiFilePatch tests so far
smashwilson 3c3d8ba
use the new shiny `multiFilePatchBuilder` ✨
vanessayuenn 5a16641
replace old buildMultiPatch method with multiFilePatchBuilder
vanessayuenn 6679c9c
nonewline is its own special ting
vanessayuenn fc1faa7
greenify open file tests
vanessayuenn a142e52
remove old builder methods from mfp view test suite
vanessayuenn c0a296e
fix hunk navigation tests
vanessayuenn 2bb78b0
fix typo in patch building for mfp file opening tests
1fc0d85
Break out of the correct loop
smashwilson 3603a76
getNextSelectionRange() tests :tada:
smashwilson 201033e
:fire: unused imports, beforeEach, and lets
smashwilson 02407d3
Fix MultiFilePatchController tests
kuychaco 11e78f4
Test coverage for .clone()
smashwilson c667d3e
getFirstChangeRange() returns a real Range object
smashwilson aa1e8bf
Implement .isEqual() on MultiFilePatch the dumbest possible way
smashwilson e686a1f
The method is called .anyPresent() on a MultiFilePatch
smashwilson ce8363b
Reword spec names to reflect MultiFilePatches being returned
smashwilson d12e3fd
fix buildFilePatch null patch test
47aeebe
watchWorkspaceItem tests :white_check_mark: + :100:
smashwilson a7a345b
Use `anyPresent` instead of `isPresent`
kuychaco 0c8f000
Check status on individual filePatch instead of MFP
kuychaco 7cd5cfd
Set pull.rebase config to false in `setUpLocalAndRemoteRepositories`
kuychaco 4886129
Move coveralls report to after_script
smashwilson 7b4078f
Only call `discardLines` if MFP has a single file patch
kuychaco 3908db1
Fix `buildFilePatch`
kuychaco 37967ee
Fix `buildMultiFilePatch` tests
kuychaco 3a3c68a
Fix `Open in File` and make it work for multiple files
kuychaco 52634b9
workshopping button text
73f5d69
Finish up that question/comment...
kuychaco dc1c009
Fix `undoLastDiscard`
kuychaco 6ab88e8
:memo: add new components to React atlas
a92f21c
Fix `undoLastDiscard` test for MultiFilePatchView
kuychaco a2d5c99
Update button text in tests
kuychaco a60cfc5
Fix tests for opening file when there is only a single file patch
kuychaco 1c711f0
:fire: console.logs
kuychaco 36e1e5f
:shirt: don't shadow `fp`
kuychaco 54b23c9
Make commit preview button styled as `secondary` rather than `primary`
kuychaco fd800ef
:fire: dot only
smashwilson 005e56f
Merge branch 'master' into commit-preview
smashwilson 2640e81
Merge branch 'master' of github.com:atom/github into commit-preview
smashwilson 549bd86
:fire: dead code in patch models
smashwilson 7f3af52
Delete unused Region range accessors
smashwilson 0875df3
Explicitly construct empty Patches
smashwilson 44d7245
Cover remaining lines in MultiFilePatchView::componentDidMount()
smashwilson a207ad2
Cover FilePatchHeaderView action properties
smashwilson ade143e
Symlink changes apply to typechange patches, not any patch with a sym…
smashwilson 01358f4
Test coverage for bulk typechange and mode change patch toggling
smashwilson 474c25f
Turns out .findMarkers({intersectsRow}) normalizes its argument
smashwilson 7209488
Cover that last line in MultiFilePatchController
smashwilson 08fa778
Always require a layeredBuffer
smashwilson 4783803
More unused isEqual methods
smashwilson cca1ab5
Remove unused-slash-broken FilePatch forwarding methods
smashwilson 3180f44
Unit tests for commit preview stub item creation
smashwilson c3e6d89
No need for a default arg there
smashwilson 35a7aaa
Register github:toggle-commit-preview in non-dev-mode
smashwilson 058dd0f
Test coverage for RootController change
smashwilson 5d30f13
fix bug in discardRows
vanessayuenn 50232b0
test was setup incorrectly too :ohno:
vanessayuenn e364b0c
Those tests worky now :wink:
smashwilson e8a911a
Test for RootController::discardLines() with multiple patches
smashwilson 21c91d8
Coverage for timing-dependent bits of Repository::saveDiscardHistory()
smashwilson e58e8b0
`github:open-file` --> `github:jump-to-file`
kuychaco d517b2e
Rename context menu item from "Open File" to "Jump to File"
kuychaco f58035a
:art: test description wording
kuychaco aadfc9c
MultiFilePatch predicate to determine if a set of rows spans files
smashwilson f9c2ebc
Track selections that span file patches in the MultiFilePatchController
smashwilson 2d7e71a
Notify the selectedRowsChanged prop with file-spanning selection status
smashwilson f61d5dd
"Jump to file" or "Jump to files" button caption
smashwilson a9ed6cb
:fire: unused import
smashwilson c068bbf
Accept a pending argument in openFile action method
smashwilson b653c0f
Unit tests for opening multiple files
smashwilson 65a8c22
Update file spanning state when manipulating selected rows manually
smashwilson a367b78
Jump to correct file if there is no diff selection for file
kuychaco 7a18876
Jump to first changed line
kuychaco 7bd749c
Drop the rest in an `else` clause
kuychaco 1685f11
Check for existence of `selectedFilePatch` before accessing methods o…
kuychaco bed19dc
Don't mistake filePatch param with command event
kuychaco 2a70de1
Oops we want to be getting the keys of `cursorsByFilePatch`
kuychaco 62be5a4
Pass the right argument for pending panes
kuychaco 18a08d9
Add tests for jumping to file from header button
kuychaco 4fe18c5
:art: test to get us back to 100% test coverage of new lines
kuychaco c3a1d78
:shirt:
smashwilson 5b6f364
Merge branch 'master' into commit-preview
smashwilson df837c8
Delete extraneous test that slipped in with the merge conflict
smashwilson 5e123b5
Move test changes into MultiFilePatchController
smashwilson 0adec32
Fix error where getFilePath is not a function on a CommitPreviewItem
3a62b79
props only work if you pass them to child components
bc58a8a
:art: Make UI more consistent
f49d4db
we don't need to test for no stinkin tooltips
1fc35c4
Explicitly only render Undo Discard button if ChangedFileItem
kuychaco c7535ce
Explicitly only render Undo Discard button if ChangedFileItem
kuychaco 1f68596
Add `itemType` prop types for :shirt:
kuychaco 4b53ba7
Make basename bold in FilePatchHeaderView
kuychaco ea07e4d
Fix tests to include itemType
kuychaco 5bfd3d0
Update docs/react-component-atlas.md
kuychaco 989c90d
Update docs/react-component-atlas.md
kuychaco a16e7f2
:world: CommitPreviewItem is beneath RootController, not GitHubTabItem
smashwilson 64c9608
Use an object spread for that data why not
smashwilson 9aa1a60
Pass a Decoration's className to the created DOM element
smashwilson 3d63ab0
Set and style a more specific CSS class for control blocks
smashwilson 90295f4
File.modes constants for well-known file modes
smashwilson 8fc267f
Use File mode constants where possible
smashwilson 0ec9039
Go into more detail on why that opener is necessary
smashwilson 707f136
tweak symlink changes styles
43c16bf
executable mode change styling tweaks
04ed3c8
:fire: unused cache key for stagedChangesSinceParentCommit
kuychaco b48fceb
Use `path.sep` to join dirname and basename
smashwilson 209961d
Merge branch 'master' of github.com:atom/github into commit-preview
smashwilson da9fe4c
Avoid double "\\ No newline at end of file"
smashwilson 6147c86
Skip filesystem events with no path
smashwilson f6f56d6
Remove unnecessary <Fragment>
smashwilson b7049ee
Wait for new unstaged patch to arrive
smashwilson 83ccf8f
Adapt the expected path separator to the current platform
smashwilson 1325650
Default itemType to avoid the PropTypes warning
smashwilson da87fa7
Workspace item watcher only cares about active items
kuychaco 098edb4
:fire: props that aren't used in `CommitPreviewItem`
kuychaco 8362279
:fire: mysterious handleClick prop in MultiFilePatchController
kuychaco 7eb7db0
Invalidate `stagedChanges` key when undoing last commit or head moves
kuychaco cd7003a
:fire: useEditorAutoHeight since we are now using a single editor
kuychaco 218d6cb
Actually we want autoHeight set to false on AtomTextEditor
kuychaco 1c1b2d2
:fire: .only
kuychaco 3b5d030
📝 comment for `intersectRows`
vanessayuenn d599b3c
:fire: unnecessary button class name
d360bd5
compare multifilepatches with toString()
vanessayuenn 111108e
change variable name to make the logic more clear
vanessayuenn 42f957b
Activate the commit preview on cmd-left from the button
smashwilson 9ebb954
MultiFilePatchView prop rename
smashwilson 2c89cdb
Pass surface callback through MultiFilePatchController
smashwilson 7c59876
Bring the keymap up to date
smashwilson 71f9da7
ChangedFileController to control surfacing behavior for ChangedFileItems
smashwilson 1bc9688
CommitPreviewController to interpret surface as surfaceToCommitPreview
smashwilson dd90907
Render a ChangedFileController within the container
smashwilson 55b6f9e
Destroy the atomEnv
smashwilson 4061824
Render a CommitPreviewController within CommitPreviewContainer
smashwilson 48ea0b5
Add missing PropTypes to the CommitPreviewItem
smashwilson 9b4ffc4
Unconditional CommitPreviewItem activation for github:dive binding
smashwilson fe3aa61
Imperatively select the commit preview button
smashwilson 97f803e
GitTabView commit preview focusing
smashwilson e809b5e
Forward surfaceToCommitPreviewButton to the GitTabController
smashwilson f4e844a
Method to surface and focus the commit preview button
smashwilson 632349f
:fire: debugger
smashwilson 7282f0f
Revert "compare multifilepatches with toString()"
kuychaco a0dafda
package-lock updates
kuychaco 1685484
Add logic to `getNextSelectionRange` so that selection remains at bot…
kuychaco 8be43e5
Test that bottom-most line is selected after staging bottom-most line
kuychaco c4d0dec
Add more comments to explain logic in `getNextSelectionRange`
kuychaco d16b900
WIP Fix one thing, break another =/. Fix marker for patches w/ no hunks
kuychaco 111c0c7
Add test for marker range for a patch with no hunks
kuychaco c5c2c89
Ensure that marker range for no-hunk patch is not affected by hunks a…
kuychaco 1acd91e
Throw error if too many markers found (to help with debugging)
kuychaco d33f3e9
:fire: .only
kuychaco e34e46a
Revert "Throw error if too many markers found (to help with debugging)"
smashwilson 5f1f65d
add missing props to CommitPreviewItem tests
d02451e
fix integration tests for file patch
764b6e8
add test for `surfaceToCommitPreviewButton` in `RootController`
9b15735
test that getFileMode returns the correct file mode for symlinks
3c97dca
test file mode for executable files in git-strategies test
f8e4aae
test that repository.updateCommitMessageAfterFileSystemChange handles…
bfaacb4
maybe make windows filemode happy?
358adbb
istanbul ignore test-only code
1a3e5a4
Test that getPanesWithStalePendingFilePatchItem ignores CommitPreview…
kuychaco f51c570
:shirt:
e03ce4d
fix misaligned line numbers in file mode changes
27373b4
Check that `getFileMode` works for untracked symlink files
kuychaco 27ca512
Fix `undoLastDiscardFromCoreUndo` for keyboard users
kuychaco 7b5935d
Fix test for undoing last discard from `core:undo`
kuychaco 8e5d9ee
Restyle mode changes
simurai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import yubikiri from 'yubikiri'; | ||
|
|
||
| import ObserveModel from '../views/observe-model'; | ||
| import LoadingView from '../views/loading-view'; | ||
| import CommitPreviewController from '../controllers/commit-preview-controller'; | ||
|
|
||
| export default class CommitPreviewContainer extends React.Component { | ||
| static propTypes = { | ||
| repository: PropTypes.object.isRequired, | ||
| } | ||
|
|
||
| fetchData = repository => { | ||
| return yubikiri({ | ||
| multiFilePatch: repository.getStagedChangesPatch(), | ||
| }); | ||
| } | ||
|
|
||
| render() { | ||
| return ( | ||
| <ObserveModel model={this.props.repository} fetchData={this.fetchData}> | ||
| {this.renderResult} | ||
| </ObserveModel> | ||
| ); | ||
| } | ||
|
|
||
| renderResult = data => { | ||
| if (this.props.repository.isLoading() || data === null) { | ||
| return <LoadingView />; | ||
| } | ||
|
|
||
| return ( | ||
| <CommitPreviewController | ||
| stagingStatus={'staged'} | ||
| {...data} | ||
| {...this.props} | ||
| /> | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
|
|
||
| import MultiFilePatchController from './multi-file-patch-controller'; | ||
|
|
||
| export default class ChangedFileController extends React.Component { | ||
| static propTypes = { | ||
| repository: PropTypes.object.isRequired, | ||
| stagingStatus: PropTypes.oneOf(['staged', 'unstaged']), | ||
| relPath: PropTypes.string.isRequired, | ||
|
|
||
| workspace: PropTypes.object.isRequired, | ||
| commands: PropTypes.object.isRequired, | ||
| keymaps: PropTypes.object.isRequired, | ||
| tooltips: PropTypes.object.isRequired, | ||
| config: PropTypes.object.isRequired, | ||
|
|
||
| destroy: PropTypes.func.isRequired, | ||
| undoLastDiscard: PropTypes.func.isRequired, | ||
| surfaceFileAtPath: PropTypes.func.isRequired, | ||
| } | ||
|
|
||
| render() { | ||
| return ( | ||
| <MultiFilePatchController | ||
| surface={this.surface} | ||
| {...this.props} | ||
| /> | ||
| ); | ||
| } | ||
|
|
||
| surface = () => this.props.surfaceFileAtPath(this.props.relPath, this.props.stagingStatus) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
|
|
||
| import MultiFilePatchController from './multi-file-patch-controller'; | ||
|
|
||
| export default class CommitPreviewController extends React.Component { | ||
| static propTypes = { | ||
| repository: PropTypes.object.isRequired, | ||
| stagingStatus: PropTypes.oneOf(['staged', 'unstaged']), | ||
|
|
||
| workspace: PropTypes.object.isRequired, | ||
| commands: PropTypes.object.isRequired, | ||
| keymaps: PropTypes.object.isRequired, | ||
| tooltips: PropTypes.object.isRequired, | ||
| config: PropTypes.object.isRequired, | ||
|
|
||
| destroy: PropTypes.func.isRequired, | ||
| undoLastDiscard: PropTypes.func.isRequired, | ||
| surfaceToCommitPreviewButton: PropTypes.func.isRequired, | ||
| } | ||
|
|
||
| render() { | ||
| return ( | ||
| <MultiFilePatchController | ||
| surface={this.props.surfaceToCommitPreviewButton} | ||
| {...this.props} | ||
| /> | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.