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

Commit 97f69d3

Browse files
committed
Add replace content with PR #1919
1 parent a601ed1 commit 97f69d3

File tree

2 files changed

+199
-179
lines changed

2 files changed

+199
-179
lines changed

lib/items/mock-item.js

Lines changed: 67 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default class MockItem extends React.Component {
1717
}
1818

1919
didClickLink = (evt) => {
20-
this.props.workspace.open(evt.target.innerText);
20+
this.props.workspace.open(evt.target.dataset.filePath);
2121
}
2222

2323
render() {
@@ -32,182 +32,106 @@ export default class MockItem extends React.Component {
3232
</header>
3333
<main className="github-Reviews-container">
3434

35-
36-
<div className="github-Review">
37-
<header className="github-Review-header">
38-
<span className="github-Review-icon icon icon-alert"></span>
39-
<img className="github-Review-avatar" src="https://api.adorable.io/avatars/285/george.png"/>
40-
<span className="github-Review-type">recommended changes <span className="github-Review-timeAgo">2 days ago</span></span>
41-
</header>
42-
43-
<div className="github-Review-summary is-requesting-changes">
44-
I have a minor suggestion, otherwise this seems good to merge.
45-
</div>
46-
47-
<details className="github-Review-thread" open>
48-
<summary className="github-Review-threadHeader">
49-
<span className="github-Review-file" onClick={this.didClickLink}>lib/models/repository-states/present.js</span>
50-
<span className="github-Review-line">350</span>
51-
</summary>
52-
<main className="github-Review-comments">
53-
<div className="github-Review-comment">
54-
<img className="github-Review-avatar" src="https://api.adorable.io/avatars/285/george.png"/>
55-
<span className="github-Review-commentText">Mind adding a space after the comma?</span>
56-
<span className="github-Review-timeAgo">4 hours ago</span>
57-
</div>
58-
<div className="github-Review-comment">
59-
<img className="github-Review-avatar" src="https://api.adorable.io/avatars/285/jonsnow.png"/>
60-
<span className="github-Review-commentText">Thanks, right.</span>
61-
<span className="github-Review-timeAgo">1 minute ago</span>
62-
</div>
63-
<div className="github-Review-reply">
64-
<img className="github-Review-avatar" src="../../github/img/avatars/14.png"/>
65-
<textarea className='github-Review-replyInput input-textarea native-key-bindings' placeholder='Reply...'></textarea>
66-
</div>
67-
<div className="github-Review-actions">
68-
<button className="github-Review-commentButton btn" title="Add your comment">Comment</button>
69-
<button className="github-Review-commentButton btn btn-primary icon icon-check" title="Mark this comment as resolved">Mark as resolved</button>
70-
</div>
71-
</main>
72-
</details>
73-
74-
<details className="github-Review-thread">
75-
<summary className="github-Review-threadHeader">
76-
<span className="github-Review-path">lib/models/repository-states/</span>
77-
<span className="github-Review-file">present.js</span>
78-
<span className="github-Review-line">420</span>
79-
</summary>
80-
<main className="github-Review-comments">
81-
<div className="github-Review-comment">
82-
<img className="github-Review-avatar" src="https://api.adorable.io/avatars/285/george.png"/>
83-
<span className="github-Review-commentText">Great solution! 🤘</span>
84-
<span className="github-Review-timeAgo">3 days ago</span>
85-
</div>
86-
<div className="github-Review-reply">
87-
<img className="github-Review-avatar" src="../../github/img/avatars/14.png"/>
88-
<textarea className='github-Review-replyInput input-textarea native-key-bindings' placeholder='Reply...'></textarea>
89-
</div>
90-
<div className="github-Review-actions">
91-
<button className="github-Review-commentButton btn" title="Add your comment">Comment</button>
92-
<button className="github-Review-commentButton btn btn-primary icon icon-check" title="Mark this comment as resolved">Mark as resolved</button>
93-
</div>
94-
</main>
95-
</details>
96-
97-
<details className="github-Review-thread">
98-
<summary className="github-Review-threadHeader">
99-
<span className="github-Review-path">/</span>
100-
<span className="github-Review-file">package.json</span>
101-
<span className="github-Review-line">4</span>
102-
</summary>
103-
<main className="github-Review-comments">
104-
<div className="github-Review-comment">
105-
<img className="github-Review-avatar" src="https://api.adorable.io/avatars/285/george.png"/>
106-
<span className="github-Review-commentText">I think we should only release this as a patch.</span>
107-
<span className="github-Review-timeAgo">4 days ago</span>
108-
</div>
109-
<div className="github-Review-actions">
110-
<span className="github-Review-infoText">This comment is resolved</span>
111-
<button className="github-Review-commentButton btn" title="Mark this comment as unresolved">Mark as unresolved</button>
112-
</div>
113-
</main>
114-
</details>
115-
116-
</div>
117-
118-
11935
<div className="github-Review">
12036
<header className="github-Review-header">
12137
<span className="github-Review-icon icon icon-comment"></span>
122-
<img className="github-Review-avatar" src="https://api.adorable.io/avatars/285/arya.png"/>
123-
<span className="github-Review-type">left review comments <span className="github-Review-timeAgo">2 days ago</span></span>
38+
<img className="github-Review-avatar" src="https://avatars.githubusercontent.com/u/e?email=annthurium%40github.202132.xyz&s=32"/>
39+
<a className="github-Review-username" href="https://github.com/annthurium">annthurium</a>
40+
<span className="github-Review-type">left review comments</span>
41+
<span className="github-Review-timeAgo">1 hour ago</span>
12442
</header>
12543

12644
<details className="github-Review-thread" open>
12745
<summary className="github-Review-threadHeader">
128-
<span className="github-Review-path">lib/views/</span>
129-
<span onClick={this.didClickLink} className="github-Review-file">lib/containers/issueish-detail-container.js</span>
130-
<span className="github-Review-line">238</span>
46+
<span className="github-Review-resolvedIcon icon icon-check"></span>
47+
<span onClick={this.didClickLink} data-file-path="lib/models/patch/builder.js">
48+
<span className="github-Review-path">lib/models/patch/</span>
49+
<span className="github-Review-file">builder.js</span>
50+
</span>
51+
<span className="github-Review-lineNr">12</span>
13152
</summary>
53+
<pre className="github-Review-diff">
54+
<div className="github-Review-diffLine is-added">{ 'export const DEFAULT_OPTIONS = {' }</div>
55+
<div className="github-Review-diffLine is-added">{ ' // Number of lines after which we consider the diff "large"' }</div>
56+
<div className="github-Review-diffLine is-added">{ ' // TODO: Set this based on performance measurements' }</div>
57+
<div className="github-Review-diffLine is-added">{ ' largeDiffThreshold: 100,' }</div>
58+
</pre>
13259
<main className="github-Review-comments">
13360
<div className="github-Review-comment">
134-
<img className="github-Review-avatar" src="https://api.adorable.io/avatars/285/arya.png"/>
135-
<span className="github-Review-commentText">Do we know how this effects our rate-limit overhead? The way that GraphQL queries are rate-limited is a bit unexpected. Individual calls cannot request more than 500,000 total nodes.
136-
137-
I would guess that we could drop the review and review comment page sizes to drop our computed node total without impacting the vast majority of review scenarios.
138-
139-
Maybe @telliott27 has some idea of the distribution of number of reviews and number of comments within a review and could help us find a lower limit that would still capture ~70% or ~80% of requests in a single page... ?</span>
140-
<span className="github-Review-timeAgo">4 hours ago</span>
61+
<header className="github-Review-commentHeader">
62+
<img className="github-Review-avatar" src="https://avatars.githubusercontent.com/u/e?email=annthurium%40github.202132.xyz&s=32"/>
63+
<a className="github-Review-username" href="https://github.com/annthurium">annthurium</a>
64+
<span className="github-Review-commentTimeAgo">4 hours ago</span>
65+
</header>
66+
<div className="github-Review-commentText"><a href="https://github.com/simurai">@simurai</a>: how many lines do you think constitutes a large diff? Not just from a performance perspective, but from a user experience perspective. Like how many lines is disruptive to a user when they're trying to read, because often large diffs are the result of auto generated code.</div>
14167
</div>
14268
<div className="github-Review-comment">
143-
<img className="github-Review-avatar" src="https://api.adorable.io/avatars/285/jonsnow.png"/>
144-
<span className="github-Review-commentText">I pulled some distribution stats for number of reviews and number of review comments here: https://ghe.io/telliott27/reports/tree/master/Notebooks/PR%20Review%20Comments#pr-reviews-and-comments-percentiles
145-
146-
The TL;DR is that it is rare for a PR to have more than 10 reviews, and for reviews to have more than 10 comments.</span>
147-
<span className="github-Review-timeAgo">3 hours ago</span>
148-
</div>
149-
<div className="github-Review-comment">
150-
<img className="github-Review-avatar" src="https://api.adorable.io/avatars/285/nina.png"/>
151-
<span className="github-Review-commentText">Is there a large pull request with many comments we can test on? I'm still worried about performance.</span>
152-
<span className="github-Review-timeAgo">6 minutes ago</span>
69+
<header className="github-Review-commentHeader">
70+
<img className="github-Review-avatar" src="https://avatars.githubusercontent.com/u/e?email=simurai%40github.202132.xyz&s=32"/>
71+
<a className="github-Review-username" href="https://github.com/simurai">simurai</a>
72+
<span className="github-Review-commentTimeAgo">4 hours ago</span>
73+
</header>
74+
<div className="github-Review-commentText">Hmmm.. will large diffs be collapsed by default or there is a "load" button? Maybe if the diff is so large that it fills the whole scroll height. Then I can uncollapse only if I'm really interested in that file. 100 seems fine. 👍</div>
15375
</div>
15476
<div className="github-Review-comment">
155-
<img className="github-Review-avatar" src="https://api.adorable.io/avatars/285/arya.png"/>
156-
<span className="github-Review-commentText">For now we decided that if the active repository is removed from the project, we will set the active repository to be <code>null</code> rather than iterating through the project to find another repository to set as active. We may opt to change this and fall through to another active repository when we have built out more UI to indicate which project folder is the active repository. For now the only indication is the active pane item and since the active pane item no longer belongs to a folder in the project, there is no valid git repo associated with it and we set the active repository to be <code>null</code>.</span>
157-
<span className="github-Review-timeAgo">6 minutes ago</span>
77+
<header className="github-Review-commentHeader">
78+
<img className="github-Review-avatar" src="https://avatars.githubusercontent.com/u/e?email=annthurium%40github.202132.xyz&s=32"/>
79+
<a className="github-Review-username" href="https://github.com/annthurium">annthurium</a>
80+
<span className="github-Review-commentTimeAgo">4 hours ago</span>
81+
</header>
82+
<div className="github-Review-commentText"><a href="https://github.com/kuychaco">@kuychaco</a> <a href="https://github.com/vanessayuenn">@vanessayuenn</a> <a href="https://github.com/smashwilson">@smashwilson</a> care to weigh in?</div>
15883
</div>
84+
15985
<div className="github-Review-reply">
160-
<img className="github-Review-avatar" src="../../github/img/avatars/14.png"/>
86+
<img className="github-Review-avatar" src="https://avatars.githubusercontent.com/u/e?email=annthurium%40github.202132.xyz&s=32"/>
16187
<textarea className='github-Review-replyInput input-textarea native-key-bindings' placeholder='Reply...'></textarea>
162-
</div>
163-
<div className="github-Review-actions">
164-
<button className="github-Review-commentButton btn" title="Add your comment">Comment</button>
165-
<button className="github-Review-commentButton btn btn-primary icon icon-check" title="Mark this comment as resolved">Mark as resolved</button>
88+
<button className="github-Review-replyButton btn" title="Add your comment">Comment</button>
16689
</div>
16790
</main>
91+
<footer className="github-Review-footer">
92+
<button className="github-Review-resolveButton btn btn-primary icon icon-check" title="Mark this comment as resolved">Mark as resolved</button>
93+
</footer>
16894
</details>
16995

170-
<details className="github-Review-thread">
96+
<details className="github-Review-thread is-resolved">
17197
<summary className="github-Review-threadHeader">
172-
<span className="github-Review-file" onClick={this.didClickLink}>lib/controllers/commit-detail-controller.js</span>
173-
<span className="github-Review-line">26</span>
98+
<span className="github-Review-resolvedIcon icon icon-check"></span>
99+
<span onClick={this.didClickLink} data-file-path="lib/models/patch/builder.js">
100+
<span className="github-Review-path">lib/models/patch/</span>
101+
<span className="github-Review-file">builder.js</span>
102+
</span>
103+
<span className="github-Review-lineNr">280</span>
174104
</summary>
105+
<pre className="github-Review-diff">
106+
<div className="github-Review-diffLine is-added">{ ' /*' }</div>
107+
<div className="github-Review-diffLine is-added">{ ' * Construct a String containing diagnostic information about the internal state of this FilePatch.' }</div>
108+
<div className="github-Review-diffLine is-added">{ ' */' }</div>
109+
<div className="github-Review-diffLine is-added">{ ' inspect(opts = {}) {' }</div>
110+
</pre>
175111
<main className="github-Review-comments">
176112
<div className="github-Review-comment">
177-
<img className="github-Review-avatar" src="https://api.adorable.io/avatars/285/arya.png"/>
178-
<span className="github-Review-commentText">Why not use just a plain 64-bit integer?</span>
179-
<span className="github-Review-timeAgo">4 days ago</span>
180-
</div>
181-
<div className="github-Review-comment">
182-
<img className="github-Review-avatar" src="https://api.adorable.io/avatars/285/jonsnow.png"/>
183-
<span className="github-Review-commentText">Hm, good point, I was worried about some ORMs that register lots of classes, but I just calculated that it will take million years to reach the maximum value even if 1000 classes are registered every second.</span>
184-
<span className="github-Review-timeAgo">4 days ago</span>
113+
<header className="github-Review-commentHeader">
114+
<img className="github-Review-avatar" src="https://avatars.githubusercontent.com/u/e?email=annthurium%40github.202132.xyz&s=32"/>
115+
<a className="github-Review-username" href="https://github.com/annthurium">annthurium</a>
116+
<span className="github-Review-commentTimeAgo">4 hours ago</span>
117+
</header>
118+
<div className="github-Review-commentText">nice! This is going to be so useful when we are trying to debug the marker layer on a text buffer.</div>
185119
</div>
120+
186121
<div className="github-Review-reply">
187-
<img className="github-Review-avatar" src="../../github/img/avatars/14.png"/>
122+
<img className="github-Review-avatar" src="https://avatars.githubusercontent.com/u/e?email=annthurium%40github.202132.xyz&s=32"/>
188123
<textarea className='github-Review-replyInput input-textarea native-key-bindings' placeholder='Reply...'></textarea>
189-
</div>
190-
<div className="github-Review-actions">
191-
<button className="github-Review-commentButton btn" title="Add your comment">Comment</button>
192-
<button className="github-Review-commentButton btn btn-primary icon icon-check" title="Mark this comment as resolved">Mark as resolved</button>
124+
<button className="github-Review-replyButton btn" title="Add your comment">Comment</button>
193125
</div>
194126
</main>
127+
<footer className="github-Review-footer">
128+
<span className="github-Review-resolveText"><a href="https://github.com/annthurium">annthurium</a> marked this as resolved</span>
129+
<button className="github-Review-resolveButton btn" title="Mark this comment as unresolved">Mark as unresolved</button>
130+
</footer>
195131
</details>
196132

197133
</div>
198134

199-
200-
<div className="github-Review">
201-
<header className="github-Review-header">
202-
<span className="github-Review-icon icon icon-check"></span>
203-
<img className="github-Review-avatar" src="https://api.adorable.io/avatars/285/nina.png"/>
204-
<span className="github-Review-type">approved these changes <span className="github-Review-timeAgo">4 days ago</span></span>
205-
</header>
206-
<div className="github-Review-summary is-approved">
207-
Looks good! Ship it!
208-
</div>
209-
</div>
210-
211135
</main>
212136
</div>
213137

0 commit comments

Comments
 (0)