Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Basic diff visualisation for plain text edits #3238

Merged
merged 3 commits into from
Jul 19, 2019

Conversation

bwindels
Copy link
Contributor

@bwindels bwindels requested a review from a team July 19, 2019 14:11
Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

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

Thanks, looks quite cool! 😁

@@ -115,16 +126,36 @@ export default class EditHistoryMessage extends React.PureComponent {
);
}

_diffIt(oldBody, newBody) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Maybe just _diff? Unsure why this method would use an It suffix...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, forgot to rename after prototype code :)

function isPlainMessage(event) {
const content = getReplacedContent(event);
return content.msgtype === "m.text" && !content.format;
}

export default class EditHistoryMessage extends React.PureComponent {
static propTypes = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add missing prop types.

@@ -66,6 +66,7 @@
"classnames": "^2.1.2",
"commonmark": "^0.28.1",
"counterpart": "^0.18.0",
"diff-match-patch": "^1.0.4",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this a big dependency by any chance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's 75kb of JS.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay, I assume that's not too much in the scheme of things...

@bwindels bwindels requested a review from jryans July 19, 2019 14:35
@bwindels bwindels merged commit c335c04 into develop Jul 19, 2019
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.

2 participants