-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Edit Comments #2320
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
Merged
Merged
Edit Comments #2320
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
b318a69
Edit Comments - fundamental API portions, version allows to edit to a…
yuwenmemon 41e885d
Get dirty editing UI in place
yuwenmemon 8f1fb48
Fix conflicts?
yuwenmemon 94053ea
reall fix conflicts
yuwenmemon bf1e59c
Really non-performant comment editing
yuwenmemon 8500513
Make sure we have reportID in grouped report action item
yuwenmemon 8f8fd1c
Fix the stylings for a message being edited
yuwenmemon 00fae5d
Make it so that clicking the edit comment button again cancels the edit
yuwenmemon e967c38
Add keypress handlers
yuwenmemon f94a9c4
Fix conflicts
yuwenmemon cc295ae
Revert some unneccessary measureContent crap I edited out
yuwenmemon 235cf83
Fix a couple bugs
yuwenmemon 40c7c30
Add edited indicator
yuwenmemon ca5d13e
Add some comments, get this in more a polished state, PR comments
yuwenmemon 32103ae
Fix conflicts
yuwenmemon 5d0536f
hidePopover
yuwenmemon 2594d4f
Fix conflicts
yuwenmemon ce406cd
Playing around with ReportScrollManager
yuwenmemon a29f272
Scroll touch screens to comment when editing a comment
yuwenmemon da33bc6
Show/hide compose box when focusing on editing comment in mobile
yuwenmemon 1ef1bce
Linting
yuwenmemon ffe69f1
PR Comments
yuwenmemon 1aca583
Remove uneccessary blur event
yuwenmemon e1185d2
Fix Conflicts
yuwenmemon 4fd791d
Update when recieving an edited message via pusher event
yuwenmemon 243819e
Hide report compose when editing comment on all small screens
yuwenmemon 4809f11
Line length
yuwenmemon 12ce6e8
Fix conflicts
yuwenmemon a2259c2
Add doc for scrollToIndex
yuwenmemon 932565a
Fix conflictrs
yuwenmemon dfae939
Dumb auto styling fix
yuwenmemon e7abc09
PR Comments
yuwenmemon f4156d0
Make sure we have a reportActionID if we're going to allow you to edi…
yuwenmemon 89f7537
Resolve console error when textInput has no focus method
yuwenmemon 8011820
Keyboard persists taps handled
yuwenmemon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
|
||
// This ref is created using React.createRef here because this function is used by a component that doesn't have access | ||
// to the original ref. | ||
const flatListRef = React.createRef(); | ||
|
||
/** | ||
* Scroll to the provided index. On non-native implementations we do not want to scroll when we are scrolling because | ||
* we are editing a comment. | ||
* | ||
* @param {Object} index | ||
* @param {Boolean} isEditing | ||
*/ | ||
function scrollToIndex(index, isEditing) { | ||
if (isEditing) { | ||
return; | ||
} | ||
|
||
flatListRef.current.scrollToIndex(index); | ||
} | ||
|
||
export { | ||
flatListRef, | ||
scrollToIndex, | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
|
||
// This ref is created using React.createRef here because this function is used by a component that doesn't have access | ||
// to the original ref. | ||
const flatListRef = React.createRef(); | ||
|
||
/** | ||
* Scroll to the provided index. | ||
* | ||
* @param {Object} index | ||
*/ | ||
function scrollToIndex(index) { | ||
roryabraham marked this conversation as resolved.
Show resolved
Hide resolved
|
||
flatListRef.current.scrollToIndex(index); | ||
} | ||
|
||
export { | ||
flatListRef, | ||
scrollToIndex, | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Onyx from 'react-native-onyx'; | ||
import ONYXKEYS from '../ONYXKEYS'; | ||
|
||
export default (shouldShowComposeInput, isSmallScreenWidth) => { | ||
if (isSmallScreenWidth) { | ||
Onyx.merge(ONYXKEYS.SESSION, {shouldShowComposeInput}); | ||
} | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.