-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Display and autocomplete PM recipients name along with their emails #877
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prah23 I just gave this a go and it works fairly well for autocomplete, but I've noticed a few important issues:
x
causes a crash pretty reliably- validation appears to be less effective than currently; if a user deletes some of the email address, then
tab
just moves to the content, whereas before it complained it wasn't valid
I was thinking of merging the first commit, as it's a good standalone refactor in a direction I know we want to move, but I noticed that you've not changed the calling location in that commit?
83f5d58
to
d2f6a75
Compare
@neiljp The refactor commit has been modified to update the calling function as well. |
ea9b911
to
40a1037
Compare
@neiljp I've modified the
|
@zulipbot remove "PR needs update" |
@zulipbot add "PR needs review" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prah23 I've cherry-picked the first commit now, and the x
issue appears to be resolved 👍
For the remaining commits I have some practical feedback from manual testing, separate to the code right now:
- I just noticed this crashes when resuming a draft. Given this and the previous issue with
x
, can we tidy up the code somehow to improve upon finding other similar issues? (this occurs at least from the first remaining commit) - It seems OK that the name and angle brackets (
<>
) around the email are not validated in the first remaining commit, as we're just showing extra information. However, users can edit around the email and it still look OK; ideally it would be good to autocomplete "around" the email text after a good validation, replacing the recipient text with a newly polished version, eg.an 1 <[email protected]
->Human 1 <[email protected]>
- For the autocomplete, it's confusing to have the first email work and not later - it actually stops users typing in names? So, I'd prefer that to be in the last commit too.
The show-name commit is already an improvement, and particularly if we can get the 'validation polishes to-field' (which could be a separate commit) then we can merge that incrementally before the full autocomplete.
Other possible improvements you could include here or follow-up work, that I don't think we have noted in issues yet:
- Place the
To:
in a column, like @Ezio-Sarthak did with the stream markers - that makes a good clean separation between user details and the title/caption, particularly with multiple/long users/emails on narrower terminals - Try to keep parts of user full names together, and possibly on the same line as the email addresses; this needs to be 'soft' to allow names to wrap in the long-name/email case, but has the potential to make the list of user names tidier.
- style the user name and email differently? Style the 'To:' differently, maybe?
We could definitely refine the design further. I'll open a separate PR for that once this is done, since that seems to be a design change, and this work is majorly on a structural change. |
40a1037
to
52ad9d0
Compare
2a5b281
to
73ee19d
Compare
@zulipbot remove "PR needs update" |
@zulipbot add "PR needs review" |
73ee19d
to
ef18640
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prah23 Thanks for working on this step by step 👍
I've given this a try and it looks good, but it asserts the text is wrong with anything but the full original text, which is a regression from this step to what we had before - there's text (ie. not the raw email) that is now important only for display (not delivery) which I can delete and be unable to use the UI. I know you said you'd skipped autocomplete at this stage, but can we validate just on the email for now? That is, if I pressed R
and ended up with some user <a@b>
, I could delete parts of the text including up to everything except a@b
and have it still work?
I know this is now one commit, but you have multiple things happening in it and it would be clearer if split. In particular you have
This commit also tidies up the private_box_view() method by typing emails as List[str], and updating the corresponding calls.
That would be a good first separate refactor commit, then followed by a commit which does the 'feature' part:
Currently, PM narrows only display the delivery emails of the users. This
commit modifies the to_write_box to also display the names of the users
along with their emails.
That split allows you to focus each commit title and text on one change, and makes it easier to review :)
I'll take a closer look at each part again, ideally after splitting, and such splitting may make it easier to eg. merge the refactor separately to the second commit (though that's not always the case, as refactors can be just to make adding a feature easier, so may be merged at the same time)
0d2de7b
to
b7d25df
Compare
@neiljp Thank you for your patience and quick response! |
@zulipbot remove "PR needs update" |
@zulipbot add "PR needs review" |
b7d25df
to
ba8e43b
Compare
ba8e43b
to
72d4f41
Compare
9fa4fdc
to
2646ea3
Compare
Currently, the emails are passed in as a string, including for huddles where emails are passed in as a single string separated by ', '. This commit tidies up the private_box_view() method by typing emails as List[str], and updating the corresponding calls. Tests updated.
Currently, PM narrows only display the delivery emails of the users. This commit modifies the to_write_box to also display the names of the users along with their emails in the 'name <email>' format. Only the emails are validated while cycling out of the to_write_box. Tests updated.
This commit adds a helper function that parallels match_user() but also considers the combination of user name and email in the 'name <email>' format, which is to be used by the autocomplete for the to_write_box.
Currently, the to_write_box does not support autocomplete for PM recipients. This commit adds a function for the autocomplete and also enables it in the to_write_box for PM recipients. Tests added.
2646ea3
to
1f5d0c9
Compare
@prah23 Thanks for working on this - I've just merged this and it will be great to have this feature! It's present in the repo as the 4 commits ending with b03d371 🎉 I've merged it manually to make some minor changes, mainly just layout changes, using list comprehensions, and removing an unnecessary fixture. Plus this fixes #587 so I indicated that in the text of the commit that fixes it 🎉 |
Modified the display to use names along with delivery emails, and enabled the autocomplete for the
to_write_box
.The commits do the following (in order):
emails
parameter of theprivate_box_view()
asList[str]
.name <email>
format.