Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

View commit details in pane #1807

Merged
merged 220 commits into from
Dec 11, 2018
Merged
Show file tree
Hide file tree
Changes from 207 commits
Commits
Show all changes
220 commits
Select commit Hold shift + click to select a range
5abde1f
Add GSOS#getDiffsForCommit and test
kuychaco Nov 21, 2018
45d1a45
Wire up `getCommit`
kuychaco Nov 21, 2018
dacd2f0
Add the framework for displaying commit details
kuychaco Nov 21, 2018
3f69279
Get CommitDetailItem to actually render!
kuychaco Nov 21, 2018
2bdf25a
Clean up prop errors in the console
kuychaco Nov 21, 2018
31ed5f4
Display some commit metadata (needs prettifying!)
kuychaco Nov 21, 2018
c557149
Render co-authors
kuychaco Nov 21, 2018
fffd2cb
Render author number count if co-authors present
kuychaco Nov 21, 2018
200f0e7
add height so commit shows up
Nov 22, 2018
70bf465
Add scrolling
simurai Nov 22, 2018
8fbb4fc
Style CommitDetail header
simurai Nov 22, 2018
507ea96
Click on a recent commit to reveal `CommitDetailItem`
vanessayuenn Nov 22, 2018
6914f2e
telemetry event
vanessayuenn Nov 22, 2018
5bb6158
fix date
vanessayuenn Nov 22, 2018
4735bad
selected state for each recent commit
vanessayuenn Nov 23, 2018
140dc25
visually show selected state
vanessayuenn Nov 23, 2018
8a76a61
match sha better
vanessayuenn Nov 23, 2018
41eb1c3
stop propagation after undoing last commit
vanessayuenn Nov 23, 2018
c9c1c07
disable most of the file patch header functionality when it's in a co…
vanessayuenn Nov 23, 2018
b80ee27
same for hunk header
vanessayuenn Nov 23, 2018
80a923f
➕ CommitDetailContainer test
vanessayuenn Nov 26, 2018
70a707b
🔥 `.only`
vanessayuenn Nov 26, 2018
369ee23
➕ [wip] CommitDetailController test
vanessayuenn Nov 26, 2018
a9c40ef
more tests
vanessayuenn Nov 26, 2018
dbe16e2
add test for co-authored commits
vanessayuenn Nov 26, 2018
ef7e68a
verify multifilepatchcontroller better
vanessayuenn Nov 26, 2018
934a856
fix arguments passed during serialization
vanessayuenn Nov 27, 2018
1057245
get started with `CommitDetailItem` tests
vanessayuenn Nov 27, 2018
b75bab6
add several more tests
vanessayuenn Nov 27, 2018
5add640
and MOAR
vanessayuenn Nov 27, 2018
81315d2
add sha accessor
vanessayuenn Nov 27, 2018
7a10d03
i *think* this is it for `CommitDetailItem` tests??? :thinking:
vanessayuenn Nov 27, 2018
ae89396
Add focus styling to selections
simurai Nov 28, 2018
cdbe9ea
Add hover styles to recent commits
simurai Nov 28, 2018
a537d84
Allow the FilePatchView to control scrolling within the AtomTextEditor
smashwilson Nov 28, 2018
5c7aa08
remove jump to file
vanessayuenn Nov 28, 2018
fc6ca8a
Cover that last line in CommitDetailItem
smashwilson Nov 28, 2018
b61b9ae
:fire: dot only
smashwilson Nov 28, 2018
867397f
Ensure we return a valid Commit to suppress console errors
smashwilson Nov 28, 2018
b277446
remove `disableStageUnstage` flag and use `itemType` as checker instead
vanessayuenn Nov 28, 2018
e8620da
use `itemType` in hunk headers too!
vanessayuenn Nov 28, 2018
22718c2
Totally arbitrary "long commit message threshold"
smashwilson Nov 28, 2018
8434c08
CommitDetailController is only responsible for message collapse state
smashwilson Nov 28, 2018
23ed35b
Builder for creating test Commits
smashwilson Nov 28, 2018
d123752
setMultiFileDiff() to construct a Commit's diff
smashwilson Nov 28, 2018
a22b692
CoAuthor construction
smashwilson Nov 28, 2018
942e7dc
PropTypes shuffle :dancer:
smashwilson Nov 28, 2018
1a28b7d
Ported CommitDetailView tests, all passing
smashwilson Nov 28, 2018
4d8737c
Failing tests and initial implementation of abbreviatedBody()
smashwilson Nov 28, 2018
4ceba4b
Pending tests for collapsing and uncollapsing message bodies
smashwilson Nov 28, 2018
38b0fa9
:fire: autoHeight as a prop since it's always false
Nov 28, 2018
205c437
collapse and uncollapse commit message bodies
Nov 28, 2018
ec10f48
return null if we're not gonna render the commit message body
Nov 28, 2018
e1102d0
style the button
Nov 28, 2018
1af8a5d
:fire: some dead code
Nov 29, 2018
6a3d65c
unit tests for commit message collapsibility
Nov 29, 2018
8e7561f
:fire: unnecessary console logging
Nov 29, 2018
414390d
don't render staging/unstaging buttons for mode and symlink changes
Nov 29, 2018
1467db2
Wrap whitespace in commit body
simurai Nov 29, 2018
e1de077
Move sha into CommitDetailView-meta
simurai Nov 29, 2018
85d0f16
Restyle header
simurai Nov 29, 2018
2cc14b1
add test to ensure buttons don't get rendered when inside a CommitDet…
vanessayuenn Nov 28, 2018
e0d97ab
Fixed it all on the first go apparently
smashwilson Nov 29, 2018
94b5b96
`getRemoteForBranch` now gets the remote from its remoteSet
vanessayuenn Nov 29, 2018
6ee4dd4
remove unused improts
vanessayuenn Nov 29, 2018
4655dd3
[wip] render dotcom link
vanessayuenn Nov 29, 2018
da43129
Toggle between an abbreviated commit message body and the full one.
smashwilson Nov 29, 2018
c58c540
fix: wrong conditional in hunk header
vanessayuenn Nov 29, 2018
e110282
add `getBranchesWithCommit` method
vanessayuenn Nov 29, 2018
2184380
add option to show local only or remote only or both
vanessayuenn Nov 29, 2018
adef37c
don't use short ref
vanessayuenn Nov 29, 2018
ff235a5
`isCommitPushed` to find out if a commit exists on remote tracking br…
vanessayuenn Nov 29, 2018
011a3be
Enable hunk headers for CommitDetailItem
smashwilson Nov 29, 2018
c54195a
Let that CSS actually target the avatar element
smashwilson Nov 29, 2018
fb2ec26
Fussing with button styles since I moved it
smashwilson Nov 29, 2018
312eccc
Move the "Show More" button back to the header.
smashwilson Nov 29, 2018
2b7ed73
still show sha when it cannot be linked
vanessayuenn Nov 29, 2018
aedb076
Turn that back to a left margin :art:
smashwilson Nov 29, 2018
d007a34
Drop LONG_MESSAGE_THRESHOLD to 500 and prepare newline counting
smashwilson Nov 29, 2018
682503c
Armor the abbreviation logic against messages with many short lines
smashwilson Nov 29, 2018
aff05e5
Allow the CommitDetailView header to focus and use native bindings
smashwilson Nov 29, 2018
5b0c75a
set a max-height on the commit message body text.
Nov 29, 2018
5fa5e65
update function name in state
vanessayuenn Nov 29, 2018
dfa6c6a
add isCommitPushed to default returns a null object test
vanessayuenn Nov 29, 2018
b7ef5ed
after undoing a commit, close corresponding commit item pane, if opened.
vanessayuenn Nov 29, 2018
9341c95
Move "show more" button
simurai Nov 30, 2018
99ba3bc
[wip] keyboard navigability in RecentCommitsView
Nov 30, 2018
2bed5f1
Display co-author information
kuychaco Nov 30, 2018
d5efe90
Add test for RecentCommitsController#openCommit, including event reco…
kuychaco Nov 30, 2018
8b3c568
Add tests for OpenCommitDialog
kuychaco Nov 30, 2018
994525d
Add tests for OpenIssuishDialog
kuychaco Nov 30, 2018
664b7a9
Open CommitDetailItem from RecentCommitView as pending item
kuychaco Nov 30, 2018
0203476
Open CommitDetailItem from PrCommitView
kuychaco Nov 30, 2018
72b6b10
:shirt:
kuychaco Nov 30, 2018
bc4c08f
Some nitpicky updates to the RecentCommitController tests
smashwilson Nov 30, 2018
5f6970e
Rest in peace autobind
smashwilson Nov 30, 2018
e523e69
selectNextCommit and selectPreviousCommit in controller
smashwilson Nov 30, 2018
aa8ab59
Forward the static focus prop from RecentCommitsView to the controller
smashwilson Nov 30, 2018
6fd2eb5
Touch up PropTypes in CommitDetail components
smashwilson Nov 30, 2018
5c1389c
Forward focus management from RecentCommitsController to its view
smashwilson Nov 30, 2018
333958b
Optionally preserve keyboard focus when opening commit details
smashwilson Nov 30, 2018
d1be87d
Use the CommitBuilder in RecentCommitView tests
smashwilson Nov 30, 2018
1cea7a5
RecentCommitView keyboard navigation
smashwilson Nov 30, 2018
3cafdc1
Forgot to commit part of this test, whoops
smashwilson Nov 30, 2018
c90e2a5
Scroll commits into view as you select them
smashwilson Nov 30, 2018
a37a3c8
Keymap entries for diving and surfacing from commits
smashwilson Nov 30, 2018
643c7fd
Use github:dive instead of core:confirm for consistency
smashwilson Nov 30, 2018
4852d70
Focus and select the current recent commit
smashwilson Nov 30, 2018
2a2b9b0
Set and remember focus on the RecentCommitView
smashwilson Nov 30, 2018
74ef8a8
Focus refInitialFocus even if it isn't available right away
smashwilson Nov 30, 2018
3e65b6e
slight styling for title of commit in PR to look clickable
vanessayuenn Nov 30, 2018
51bd40d
add oid field to pr commit query & rename abbreviatedOid to shortSha …
vanessayuenn Nov 30, 2018
0bed1f6
fix test
vanessayuenn Nov 30, 2018
7b8e564
use the long sha for opening commit item
vanessayuenn Nov 30, 2018
d868567
clickable styling should only apply to clickable nodes! DUH!
vanessayuenn Nov 30, 2018
4cf2d29
add tests for opening commits from PR view
vanessayuenn Nov 30, 2018
b720c7d
Incremental improvement to GitTab focus
smashwilson Nov 30, 2018
447c9c5
Focus a recent commit if the commit button is disabled
smashwilson Nov 30, 2018
f1375b7
Adaptively focus the last enabled element in a CommitView
smashwilson Nov 30, 2018
32604d5
Bind tab and shift-tab in the RecentCommitsView
smashwilson Nov 30, 2018
8859df5
That needs to return a boolean
smashwilson Nov 30, 2018
e5a0b46
Select the first commit when tabbing in
smashwilson Nov 30, 2018
9c84314
Style a selected and focused recent commit
smashwilson Nov 30, 2018
d128b51
rename oid to sha
vanessayuenn Nov 30, 2018
f8d1341
drill em props!
vanessayuenn Nov 30, 2018
e5d4317
open commit detail item when commit header is clicked from PR timeline.
vanessayuenn Nov 30, 2018
a2babbb
add some clickable styling
vanessayuenn Nov 30, 2018
2aea51b
Fix CommitView tests
kuychaco Nov 30, 2018
2b8696a
Fix CommitDetailContainer test
kuychaco Dec 1, 2018
109c4d1
Fix GitStrategies test
kuychaco Dec 1, 2018
0584567
:fire: unnecessary focus test
kuychaco Dec 1, 2018
dca78bc
Fix HunkHeaderView test
kuychaco Dec 1, 2018
2275448
Fix GitTabView focus tests
kuychaco Dec 1, 2018
75062d9
:shirt:
kuychaco Dec 1, 2018
5416306
Add OpenCommitDialog tests
kuychaco Dec 1, 2018
5aae2c5
Clean up OpenCommitDialog test
kuychaco Dec 1, 2018
1de27ca
:fire: unnecessary code in OpenCommitDialog
kuychaco Dec 1, 2018
a71ce14
Add tests for OpenIssueishDialog
kuychaco Dec 1, 2018
5d90e5b
:fire: unnecessary check for commit sha. Handled by disabled button
kuychaco Dec 1, 2018
f3f392d
unneccessary prop
vanessayuenn Dec 3, 2018
a830581
get boolean properly
vanessayuenn Dec 3, 2018
d5fa650
sha not oid
vanessayuenn Dec 3, 2018
28dd5ce
sha not oid x2
vanessayuenn Dec 3, 2018
24a5fae
Test coverate for RecentCommitController's workspace tracking
smashwilson Dec 3, 2018
8afc601
Full coverage for RecentCommitsController
smashwilson Dec 3, 2018
480b4bf
Uncovered line in RootController tests
smashwilson Dec 3, 2018
02e6b20
Cover GSOS::getBranchesWithCommit()
smashwilson Dec 3, 2018
f5ca14c
Remove unused variables
smashwilson Dec 3, 2018
1e59224
Cover CommitDetailItem::focus()
smashwilson Dec 3, 2018
2012434
Programming tip of the day: describe() is not it()
smashwilson Dec 3, 2018
8a27e4d
Cover that last line in FilePatchMetaView
smashwilson Dec 3, 2018
cdc21b9
Get rid of unreachable branch
smashwilson Dec 3, 2018
3f6e980
Test for clicking on a commit in a PR timeline
smashwilson Dec 3, 2018
3212d06
:shirt:
smashwilson Dec 3, 2018
8b5353e
De-copy-pastify OpenCommitDialog and test coverage
smashwilson Dec 3, 2018
1606869
Add `includePatch` option to GSOS#getCommits()
kuychaco Dec 4, 2018
248ad74
Modify Repository#getCommit to use only GSOS#getCommits with `include…
kuychaco Dec 4, 2018
1ba66a0
:fire: getDiffsForCommit
kuychaco Dec 4, 2018
6e7be8a
:shirt:
kuychaco Dec 4, 2018
1aaf59b
Unbreak all the tests
kuychaco Dec 4, 2018
4f63b43
Better way to unbreak tests
kuychaco Dec 4, 2018
0ac23c3
Unbreak more tests
kuychaco Dec 4, 2018
6b902c7
Use Lodash's isEqualWith instead of isEqual
smashwilson Dec 4, 2018
401b5e5
Implement isEqual to compare Commits logically
smashwilson Dec 4, 2018
6a2eb58
Explicitly unmount to cover that componentWillUnmount method
smashwilson Dec 4, 2018
516fbcc
Cover the remaining new lines in Commit
smashwilson Dec 4, 2018
16e97bf
Coverage for GitTabController
smashwilson Dec 4, 2018
e0f60a9
Only you can prevent PropTypes errors
smashwilson Dec 4, 2018
d351586
Cover IssueishDetailController::openCommit()
smashwilson Dec 4, 2018
e54ecb3
P r o p T y p e s
smashwilson Dec 4, 2018
cf31a2b
Remote is never falsy, it's a nullRemote when it's missing
smashwilson Dec 4, 2018
add8a6b
Coverage for CommitDetailView
smashwilson Dec 4, 2018
6003ede
Cover stub item creation in GithubPackage
smashwilson Dec 4, 2018
c5c0956
add check to ensure that commit exists in repository
Dec 4, 2018
c0fef56
be more specific about error type
Dec 4, 2018
9afe819
:art: better error message
Dec 5, 2018
3df4e6d
add test for non existent commit
Dec 5, 2018
bc8405d
:shirt:
Dec 5, 2018
c1debd0
Cover that last branch in OpenCommitDialog
smashwilson Dec 5, 2018
8b5cb6c
Apparently we didn't have a test for that
smashwilson Dec 5, 2018
ffea274
Merge remote-tracking branch 'origin/master' into ku-commit-item
smashwilson Dec 5, 2018
c1b2642
Cover the default parameter in WorkdirCache's constructor
smashwilson Dec 5, 2018
69d31e2
Cover locating a workdir from within a .git/ directory
smashwilson Dec 5, 2018
688ea96
Shhh istanbul. That one's too much of a pain to mock
smashwilson Dec 5, 2018
b8e9998
Full test coverage for CreatePullRequestTile
smashwilson Dec 5, 2018
03032bc
Fill out the rest of that TODO test
smashwilson Dec 5, 2018
5d43910
Deleted resolved TODO
smashwilson Dec 5, 2018
fe5dc9b
add CommitDetail react tree to component atlas.
Dec 5, 2018
3b2fa6d
Merge branch 'master' into ku-commit-item
kuychaco Dec 5, 2018
72b38bb
fix `IssueishDetailController` tests
Dec 5, 2018
2cd4304
Merge branch 'master' into ku-commit-item
kuychaco Dec 6, 2018
e8a6ecd
Make CheckoutState a little more obviously an enum class
smashwilson Dec 6, 2018
9914d56
The more direct way :wink:
smashwilson Dec 6, 2018
0ffd895
Tests for the onBranch prop passed to PrDetailView's children
smashwilson Dec 6, 2018
8400808
Change the element type from <span> to <button> when onBranch
smashwilson Dec 6, 2018
99dc47c
Remove unreferenced CSS
smashwilson Dec 6, 2018
1123c7b
Whitespace touchups :art:
smashwilson Dec 6, 2018
091f1a7
:shirt:
smashwilson Dec 6, 2018
da711b7
Imperatively prevent focus grabbing in a CommitDetailItem
smashwilson Dec 6, 2018
9d038ef
Call preventFocus() on the opened CommitDetailItem
smashwilson Dec 6, 2018
0256c3d
apply `not-:poop: true` in CSS
Dec 6, 2018
a75512d
nit for component atlas
Dec 6, 2018
5d5862a
also style clickable commits in the timeline view
Dec 6, 2018
25a5a44
rename `item` to `commit` as per Katrina's suggestion
Dec 6, 2018
94b60a3
fix commit-view tests
Dec 6, 2018
5196c83
clean up commit-view tests a bit
Dec 6, 2018
1c67319
:shirt: love when my in-editor linting stops working mysteriously
Dec 6, 2018
9f7b337
Style commit buttons
simurai Dec 7, 2018
4dda18c
No need to have those props optional right now
smashwilson Dec 7, 2018
63747af
Leave CommitDetailItems open during undo
smashwilson Dec 7, 2018
65222d6
Forgot a word in there
smashwilson Dec 7, 2018
e2cfa62
:fire: unnecessary `autoHeight={false}`
kuychaco Dec 11, 2018
140bc97
:art: pass `isValidEntry` prop to OpenCommitDialog rather than reposi…
kuychaco Dec 11, 2018
8df2aaf
Fix OpenCommitDialog tests (use `isValidEntry` rather than repository)
kuychaco Dec 11, 2018
b329b41
Add RootController tess for `isValidCommit`
kuychaco Dec 11, 2018
5c851d7
Allow any valid Git ref to be entered in OpenCommitDialog
kuychaco Dec 11, 2018
d387391
Add clarifying comment
kuychaco Dec 11, 2018
d66a68f
Fix borken test
kuychaco Dec 11, 2018
ac3e0b4
Drop the long commit message and newline thresholds
smashwilson Dec 11, 2018
9f6ad40
Bring abbreviatedBody()'s message up to date
smashwilson Dec 11, 2018
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
7 changes: 7 additions & 0 deletions docs/react-component-atlas.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ This is a high-level overview of the structure of the React component tree that
> > [`<IssueDetailView>`](/lib/views/issue-detail-view.js)
> > [`<PullRequestDetailView>`](/lib/views/pr-detail-view.js)
> >
> > The workspace-center pane item that appears when looking at all the changes
> > associated with a single commit that already exists in the current repository.
> > [`<CommitDetailItem>`](/lib/items/issueish-detail-item.js)
> > [`<CommitDetailContainer>`](/lib/containers/commit-detail-container.js)
> > [`<CommitDetailController>`](/lib/controllers/commit-detail-controller.js)
> > [`<CommitDetailView>`](/lib/views/commit-detail-controller.js)
> >
> > The workspace-center pane that displays information about a pull request or issue ("issueish", collectively) from github.com.
> >
> > > [`<IssueTimelineController>`](/lib/controllers/issue-timeline-controller.js)
Expand Down
12 changes: 12 additions & 0 deletions keymaps/git.cson
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,25 @@
'.github-CommitView-editor atom-text-editor:not([mini])':
'cmd-enter': 'github:commit'
'ctrl-enter': 'github:commit'
'tab': 'core:focus-next'
kuychaco marked this conversation as resolved.
Show resolved Hide resolved
'shift-tab': 'core:focus-previous'

'.github-CommitView-commitPreview':
'cmd-left': 'github:dive'
'ctrl-left': 'github:dive'
'enter': 'native!'

'.github-RecentCommits':
'enter': 'github:dive'
'cmd-left': 'github:dive'
'ctrl-left': 'github:dive'
'tab': 'core:focus-next'
'shift-tab': 'core:focus-previous'

'.github-CommitDetailView':
'cmd-right': 'github:surface'
'ctrl-right': 'github:surface'

'.github-FilePatchView atom-text-editor:not([mini])':
'cmd-/': 'github:toggle-patch-selection-mode'
'ctrl-/': 'github:toggle-patch-selection-mode'
Expand Down

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions lib/containers/commit-detail-container.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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 CommitDetailController from '../controllers/commit-detail-controller';

export default class CommitDetailContainer extends React.Component {
static propTypes = {
repository: PropTypes.object.isRequired,
sha: PropTypes.string.isRequired,
itemType: PropTypes.func.isRequired,
}

fetchData = repository => {
return yubikiri({
commit: repository.getCommit(this.props.sha),
currentBranch: repository.getCurrentBranch(),
currentRemote: async query => repository.getRemoteForBranch((await query.currentBranch).getName()),
isCommitPushed: repository.isCommitPushed(this.props.sha),
});
}

render() {
return (
<ObserveModel model={this.props.repository} fetchData={this.fetchData}>
{this.renderResult}
</ObserveModel>
);
}

renderResult = data => {
if (this.props.repository.isLoading() || data === null || !data.commit.isPresent()) {
return <LoadingView />;
}

return (
<CommitDetailController
{...data}
{...this.props}
/>
);
}
}
4 changes: 4 additions & 0 deletions lib/containers/issueish-detail-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export default class IssueishDetailContainer extends React.Component {

switchToIssueish: PropTypes.func.isRequired,
onTitleChange: PropTypes.func.isRequired,

workspace: PropTypes.object.isRequired,
}

constructor(props) {
Expand Down Expand Up @@ -169,6 +171,8 @@ export default class IssueishDetailContainer extends React.Component {
addRemote={repository.addRemote.bind(repository)}
onTitleChange={this.props.onTitleChange}
switchToIssueish={this.props.switchToIssueish}
workdirPath={repository.getWorkingDirectoryPath()}
workspace={this.props.workspace}
/>
);
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading