Skip to content
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

docs: Add autocomplete info section in FAQ. #1017

Merged
merged 1 commit into from
Jun 26, 2021

Conversation

Ezio-Sarthak
Copy link
Member

@Ezio-Sarthak Ezio-Sarthak commented Apr 29, 2021

This PR adds a section How do I use autocompletes in ZT?, which lists and explains the working of currently supported autocompletes in ZT, grouped by different compose boxes

  • Message body autocompletes
  • Other (Stream/Topic/PM recipients) autocomplete options

NOTE: Currently I'm not sure if the first bullet title is user-friendly, and so would appreciate feedback/suggestions for the same :)

@zulipbot zulipbot added the size: M [Automatic label added by zulipbot] label Apr 29, 2021
@Ezio-Sarthak
Copy link
Member Author

@zulipbot add "area: documentation"

@zulipbot zulipbot added the area: documentation Requires changes in documentation label Apr 29, 2021
@Ezio-Sarthak Ezio-Sarthak force-pushed the docs-autocompletes-in-zt branch 2 times, most recently from 4bfaf27 to ba30283 Compare April 30, 2021 10:22
@zulipbot zulipbot added size: L [Automatic label added by zulipbot] and removed size: M [Automatic label added by zulipbot] labels Apr 30, 2021
Copy link
Member

@prah23 prah23 left a comment

Choose a reason for hiding this comment

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

@Ezio-Sarthak, this looks fairly informative 👍

Leaving a couple of comments inline as suggestions to make this more user oriented, let me know how they sound to you.

docs/FAQ.md Outdated

You could refer to the above section to try out each of the below prefixes!

#### Message write box
Copy link
Member

Choose a reason for hiding this comment

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

This could maybe simply be referred to as "Message compose" or in a verbose manner, "Message compose autocomplete"? Inferring autocomplete that can be used during composing. Since message compose is limited to msg_write_box, it would sound simpler to understand with our intent being conveyed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, I overlapped with that thought too recently. Though since selecting streams and topics may also be considered in "composing a message", I wondered if that's an apt option. Nevertheless, we could explore it with feedback. I'd share this suggestion and one other I had in mind for this in CZO, and would appreciate suggestions from others as well.

docs/FAQ.md Outdated

**NOTE:** Currently, the above autocompletes ignore a text containing whitespaces if it is specified as a prefix for autocompletion. (e.g., `#test he` wouldn't lead to `#**test here**`) See also [#925](https://github.com/zulip/zulip-terminal/issues/925).

#### Other write boxes
Copy link
Member

Choose a reason for hiding this comment

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

Maybe "other autocomplete options"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Seeing your below point, I am a bit more inclined to Other autocomplete fields. What do you think about it?

Copy link
Member

Choose a reason for hiding this comment

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

That seems a little confusing, if you want to go in that direction maybe Other autocomplete-enabled fields?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, that makes sense. Let's go with "Other autocomplete options" then 👍.

docs/FAQ.md Outdated

#### Other write boxes

All other write boxes in compose box don't require a prefix, i.e., the prefix for them is an empty string (`''`). Autocompletes here are contextual and specific to a particular write box.
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest explaining how message recipients work here (stream, topic, pm recipients), as in a mention that we have "headers" or "fields" where we enter these (a screenshot might be helpful here like the GIF you have above), so that it serves as context to the table below, keeping the table compact as it currently stands.

"Fields" is a fairly easy term to understand for something that accepts input.

@Ezio-Sarthak Ezio-Sarthak force-pushed the docs-autocompletes-in-zt branch from ba30283 to 94d3f70 Compare May 5, 2021 13:47
docs/FAQ.md Outdated

**\*** If a PM recipient's name contains comma(s) (`,`), they would be treated as comma-separated recipients.

Stream message compose (for **1** and **2**):
Copy link
Member

@prah23 prah23 May 5, 2021

Choose a reason for hiding this comment

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

Since we're being specific, it might be better if we use specific terms as discussed on the stream, like "specifying/defining stream and topic" and "specifying/defining private message recipients".

The other point I just noticed is, the cursor in your screenshots remains on the message content, could you perhaps put screenshots with the cursor on these header fields? It might help with emphasizing the field we're describing here.

@Ezio-Sarthak Ezio-Sarthak force-pushed the docs-autocompletes-in-zt branch from 94d3f70 to f9b6fed Compare May 5, 2021 14:48
Copy link
Collaborator

@neiljp neiljp left a comment

Choose a reason for hiding this comment

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

@Ezio-Sarthak Apparently I started a review earlier, so here's what I wrote then for reference - I think most points are still relevant.

docs/FAQ.md Outdated
1. Type a prefix designated for an autocomplete (e.g., `:` for autocompleting emojis).
2. Along with the prefix, type the initial letters of the text (e.g., `air` for `airplane`).
3. Now hit the hotkey. You'd see suggestions being listed in the footer (if there are any).
4. Cycle between different suggestions as described in above hotkey section. (Notice that a selected suggestion is colored in **black**)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Black is theme-specific, or not?

Copy link
Member Author

@Ezio-Sarthak Ezio-Sarthak May 6, 2021

Choose a reason for hiding this comment

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

No, I would say. We use the default "code" palette (which is black) for this, uniform throughout all themes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It might be simpler to indicate the selected value is highlighted?

We could also add a 5th entry to indicate that cycling "past the end" goes back to the prefix you enter.

docs/FAQ.md Outdated

|Prefix Type|Prefix text(s)|Autocompleted text format|
| :--- | :---: | :---: |
|Mention a user|`@`, `@**`|`@**User name**`|
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think these two are subtly different, but worth confirming in the code

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah. @** is assigned to autocomplete_users and @ is assigned to autocomplete_mentions. While some are specified explicitly in the autocomplete_map, I see it's better to include the @ to user groups too 👍. Here's what we have:

        autocomplete_map = OrderedDict([
                ('@_', self.autocomplete_users),
                ('@_**', self.autocomplete_users),
                ('@', self.autocomplete_mentions),
                ('@*', self.autocomplete_groups),
                ('@**', self.autocomplete_users),
                ('#', self.autocomplete_streams),
                ('#**', self.autocomplete_streams),
                (':', self.autocomplete_emojis),
            ])

Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if it's worth treating @ with it's own row, indicating it matches users and groups (eg. @term on czo).

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed.

docs/FAQ.md Outdated

**NOTE:** Currently, the above autocompletes ignore a text containing whitespaces if it is specified as a prefix for autocompletion. (e.g., `#test he` wouldn't lead to `#**test here**`) See also [#925](https://github.com/zulip/zulip-terminal/issues/925).

#### Other write boxes
Copy link
Collaborator

Choose a reason for hiding this comment

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

If grouped together, this could be "Message recipients" (as per "current message recipients")

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean grouping the recipient headers (as done currently)?

docs/FAQ.md Outdated

|Box type|Autocompleted text format|
| :--- | :---: |
|Stream|`Stream name`|
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could include a note that the stream box will indicate if it's a valid stream and of what type?

@Ezio-Sarthak Ezio-Sarthak force-pushed the docs-autocompletes-in-zt branch 2 times, most recently from 1b8c7f6 to e92a999 Compare May 6, 2021 15:03
@Ezio-Sarthak Ezio-Sarthak requested a review from neiljp May 6, 2021 15:10
Copy link
Collaborator

@neiljp neiljp left a comment

Choose a reason for hiding this comment

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

@Ezio-Sarthak This is looking close, just rather large and verbose for an FAQ answer, so if we can trim it and keep it accurate and useful, that would be great 👍 (my ideas for that are in the comments)

docs/FAQ.md Outdated
Comment on lines 75 to 77
In ZT, we use `ctrl f` and `ctrl r` for cycling through autocompletes:
* `ctrl f` allows switching between autocomplete suggestions in a forward manner (see the GIF below).
* `ctrl r` does the same job but in reverse manner.
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't need to keep mentioning ZT, and we've duplicated the ctrl-f/r; this might just fit within one sentence, or maybe two bullets if it doesn't look strange. We can emphasize the f=forward and r=reverse by bolding the words.

docs/FAQ.md Outdated
Comment on lines 81 to 83
### Understanding the working

Below are some basic steps to work with autocompletes in ZT (assuming that the user is composing a message):
Copy link
Collaborator

Choose a reason for hiding this comment

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

The text before the numbered list says little except composing text in the "content box", so we can probably combine the section title and this text together.

Maybe: (too long?)
"Example: Using autocomplete to add a recognized emoji in your message body"
(the extra text re the gif could then be removed too)

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense 👍

docs/FAQ.md Outdated
1. Type a prefix designated for an autocomplete (e.g., `:` for autocompleting emojis).
2. Along with the prefix, type the initial letters of the text (e.g., `air` for `airplane`).
3. Now hit the hotkey. You'd see suggestions being listed in the footer (if there are any).
4. Cycle between different suggestions as described in above hotkey section. (Notice that a selected suggestion is colored in **black**)
Copy link
Collaborator

Choose a reason for hiding this comment

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

It might be simpler to indicate the selected value is highlighted?

We could also add a 5th entry to indicate that cycling "past the end" goes back to the prefix you enter.

docs/FAQ.md Outdated
Comment on lines 95 to 97
Now that you have a basic understanding of how autocompletes in ZT work, let's explore what all sorts of autocomplete prefixes ZT support, as of now. Note that the kinds of prefix supported also differ within each compose box. Thus, the prefixes listed below are grouped by type of compose box.

You could refer to the above section to try out each of the below prefixes!
Copy link
Collaborator

Choose a reason for hiding this comment

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

This style of text is probably more appropriate in a tutorial.

Probably all we need is text somewhere which indicates that:

  • in the message body (I don't think that word came up, but it seems OK?) we use prefixes
  • for the recipient boxes (1, 2, 3) the prefixes are assumed

Note that with recipient boxes there is no "prefix" (as above bullets) so perhaps this title could be "Areas with autocomplete support" ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good. I was just framing the two bullets in a similar way. I wanted to query if recipient boxes sound internal? Does "recipient header" make sense?

docs/FAQ.md Outdated

|Prefix Type|Prefix text(s)|Autocompleted text format|
| :--- | :---: | :---: |
|Mention a user|`@`, `@**`|`@**User name**`|
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if it's worth treating @ with it's own row, indicating it matches users and groups (eg. @term on czo).

docs/FAQ.md Outdated
@@ -108,6 +108,29 @@ You could refer to the above section to try out each of the below prefixes!

**NOTE:** Currently, the above autocompletes ignore a text containing whitespaces if it is specified as a prefix for autocompletion. (e.g., `#test he` wouldn't lead to `#**test here**`) See also [#925](https://github.com/zulip/zulip-terminal/issues/925).

#### Other autocomplete options

All other message composing areas that support autocompletion don't require a prefix, i.e., the prefix for them is an empty string (`''`). Autocompletes here are mostly contextual and specific. See the below snapshots to better distinguish between various compose fields.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rather than prefixes being the empty string, we can just not mention prefixes in this case, or that they're taken from the context (you have "contextual" 👍).

docs/FAQ.md Outdated
Comment on lines 115 to 119
|S. No.|Field|Autocompleted text format|
| :---: | :--- | :---: |
|1|Stream|`Stream name`|
|2|Topic|`Topic name`|
|3|PM recipient|`Name <email>`|
Copy link
Collaborator

Choose a reason for hiding this comment

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

Given you have two images for Streams and PMs, I'd suggest skipping the text above and this table, and having two sections referring to 1, 2 and 3 in the text in each section. The table doesn't really give much extra information here.

The notes can also fit into the sections.

@neiljp neiljp added the PR awaiting update PR has been reviewed & is awaiting update or response to reviewer feedback label May 16, 2021
@Ezio-Sarthak Ezio-Sarthak force-pushed the docs-autocompletes-in-zt branch from e92a999 to 1c013ed Compare May 16, 2021 16:03
@Ezio-Sarthak Ezio-Sarthak added PR needs review PR requires feedback to proceed and removed PR awaiting update PR has been reviewed & is awaiting update or response to reviewer feedback labels May 29, 2021
@Ezio-Sarthak Ezio-Sarthak force-pushed the docs-autocompletes-in-zt branch from 1c013ed to 0fcaddd Compare May 29, 2021 08:15
@Ezio-Sarthak Ezio-Sarthak force-pushed the docs-autocompletes-in-zt branch from 0fcaddd to 3e7f2be Compare June 25, 2021 17:22
This commit adds a FAQ entry: `How do I use autocompletes in ZT?`.

* Hotkeys used
* Example guide to using autocomplete to pick a matching emoji
* Support in the message body
* Support in the message recipients (stream/topic/PM recipients)

(minor changes for consistency/structure by neiljp)
@neiljp neiljp force-pushed the docs-autocompletes-in-zt branch from 3e7f2be to c77968e Compare June 26, 2021 05:55
@zulipbot zulipbot added size: M [Automatic label added by zulipbot] and removed size: L [Automatic label added by zulipbot] labels Jun 26, 2021
@neiljp
Copy link
Collaborator

neiljp commented Jun 26, 2021

@Ezio-Sarthak Thanks for this - I'm sure users will benefit from this 👍 Merging this now after your agreement on the minor adjustments I made via the branch I referred to in the stream 🎉

@neiljp neiljp merged commit c3c347b into zulip:main Jun 26, 2021
@neiljp neiljp added this to the Next Release milestone Jun 26, 2021
@neiljp neiljp removed the PR needs review PR requires feedback to proceed label Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: documentation Requires changes in documentation size: M [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants