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

Find and replace integration #1922

merged 4 commits into from Jan 29, 2019

Find and replace integration #1922

merged 4 commits into from Jan 29, 2019


Copy link

@smashwilson smashwilson commented Jan 28, 2019

Please be sure to read the contributor's guide to the GitHub package before submitting any pull requests.


  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • Suggestion: You can use checklists to keep track of progress for the sections on metrics, tests, documentation, and user research.

Description of the Change

Implement the observeEmbeddedTextEditor() protocol established in atom/find-and-replace#1069 (released in find-and-replace@0.218.0) to support the "find" dialog in diff editors.



Alternate Designs



Large diffs become much more useful when you can find changes within them.

Possible Drawbacks

Attempting to trigger a "replace" causes a stacktrace in the console presently, because our TextEditors are read-only. I'd rather fix this in find-and-replace by disabling the replace controls though.

Applicable Issues

In concert with atom/find-and-replace#1069.




  • Full test coverage of changes



Release Notes

  • "Find" panel works in the changed files, commit detail, commit preview, and pull request "files changed" items.

User Experience Research (Optional)


Copy link

@codecov codecov bot commented Jan 28, 2019

Codecov Report

Merging #1922 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1922      +/-   ##
+ Coverage    92.1%   92.12%   +0.01%     
  Files         189      189              
  Lines       10783    10809      +26     
  Branches     1580     1581       +1     
+ Hits         9932     9958      +26     
  Misses        851      851
Impacted Files Coverage Δ
lib/containers/issueish-detail-container.js 100% <ø> (ø) ⬆️
lib/controllers/issueish-detail-controller.js 100% <ø> (ø) ⬆️
lib/views/pr-detail-view.js 100% <ø> (ø) ⬆️
lib/items/changed-file-item.js 100% <100%> (ø) ⬆️
lib/items/commit-preview-item.js 100% <100%> (ø) ⬆️
lib/items/commit-detail-item.js 100% <100%> (ø) ⬆️
lib/items/issueish-detail-item.js 100% <100%> (ø) ⬆️
lib/views/multi-file-patch-view.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b509125...5555be4. Read the comment docs.

Mostly copy and paste, like the implementations :thinking-face:
@smashwilson smashwilson requested a review from Jan 28, 2019
Copy link

@annthurium annthurium left a comment

very cool, this will be super useful to our users.

Does this gracefully fall back if a user was somehow using an older version of find-and-replace?

@@ -29,6 +29,11 @@ export default class CommitPreviewItem extends React.Component {
this.isDestroyed = false;
this.hasTerminatedPendingState = false;
this.refInitialFocus = new RefHolder();

this.refEditor = new RefHolder();
Copy link

@annthurium annthurium Jan 28, 2019

I see what you mean about cleaning up our items so they aren't so repetitive.

Copy link
Member Author

@smashwilson smashwilson commented Jan 29, 2019

Does this gracefully fall back if a user was somehow using an older version of find-and-replace?

Yup, both ways 👍

  • If find-and-replace is older and github is newer, GitHub package items have a method that's never called.
  • If github is older and find-and-replace is newer, find-and-replace will see that GitHub package items don't implement the observeEmbeddedTextEditors method and continue to ignore them

@smashwilson smashwilson merged commit 8a8bf82 into master Jan 29, 2019
3 checks passed
@smashwilson smashwilson deleted the aw/find-and-replace branch Jan 29, 2019
@kuychaco kuychaco mentioned this pull request Feb 5, 2019
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
No open projects
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants