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

Conversation

@smashwilson
Copy link
Contributor

@smashwilson smashwilson 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 [email protected]) 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

@codecov
Copy link

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 a team January 28, 2019 15:59
Copy link

@annthurium annthurium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

this.hasTerminatedPendingState = false;
this.refInitialFocus = new RefHolder();

this.refEditor = new RefHolder();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@smashwilson
Copy link
Contributor Author

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
@smashwilson smashwilson deleted the aw/find-and-replace branch January 29, 2019 17:49
@kuychaco kuychaco mentioned this pull request Feb 5, 2019
18 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants