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
merged 4 commits into from Jan 29, 2019

Conversation

2 participants
@smashwilson
Copy link
Member

commented Jan 28, 2019

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

Requirements

  • 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.

Screenshot/Gif

find-and-replace

Alternate Designs

N/A

Benefits

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.

Metrics

N/A

Tests

  • Full test coverage of changes

Documentation

N/A

Release Notes

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

User Experience Research (Optional)

N/A

smashwilson added some commits Jan 28, 2019

@codecov

This comment has been minimized.

Copy link

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.

Test coverage for observeEmbeddedTextEditor implementations
Mostly copy and paste, like the implementations :thinking-face:

@smashwilson smashwilson requested a review from atom/github-package Jan 28, 2019

@annthurium
Copy link
Contributor

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();

This comment has been minimized.

Copy link
@annthurium

annthurium Jan 28, 2019

Contributor

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

@smashwilson

This comment has been minimized.

Copy link
Member Author

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

atom.github Build #20190128.6 succeeded
Details
codecov/patch 100% of diff hit (target 92.1%)
Details
codecov/project 92.12% (+0.01%) compared to b509125
Details

@smashwilson smashwilson deleted the aw/find-and-replace branch Jan 29, 2019

@kuychaco kuychaco referenced this pull request Feb 5, 2019

Closed

v0.25.0-0 QA Review #1936

14 of 18 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.