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

Insert pill onClick of timeline profile #1239

Merged

Conversation

lukebarnard1
Copy link
Contributor

When clicking someone in the timeline, insert a user pill instead of the plaintext "displayname:"

Luke Barnard added 4 commits July 20, 2017 15:46
When clicking someone in the timeline, insert a user pill instead of the plaintext "displayname:"
This has the advantage of us not reimplementing things and fixing the same bugs twice.
Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

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

otherwise lgtm

dis.dispatch({
action: 'insert_displayname',
displayname: name.replace(' (IRC)', ''),
user_id: mxEvent.getSender(),
Copy link
Member

Choose a reason for hiding this comment

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

if you're changing this dispatch in a breaking way anyway, might be nice t o rename it to insert_mention or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SGTM

// paths for inserting a user pill is not fun
const selection = this.state.editorState.getSelection();
const member = this.props.room.getMember(payload.user_id);
const completion = member ? member.name : payload.user_id;
Copy link
Member

Choose a reason for hiding this comment

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

This'll lose the behaviour of stripping the ' (IRC)' suffix - is that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, I shall add it back in

@dbkr dbkr assigned lukebarnard1 and unassigned dbkr Jul 20, 2017
@lukebarnard1 lukebarnard1 assigned dbkr and unassigned lukebarnard1 Jul 20, 2017
@dbkr dbkr assigned lukebarnard1 and unassigned dbkr Jul 20, 2017
@lukebarnard1 lukebarnard1 merged commit 8c531a8 into develop Jul 21, 2017
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