Skip to content

@-mention typeahead/autocomplete #49

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

Closed
gnprice opened this issue Apr 4, 2023 · 2 comments · Fixed by #207
Closed

@-mention typeahead/autocomplete #49

gnprice opened this issue Apr 4, 2023 · 2 comments · Fixed by #207
Assignees
Labels
a-compose Compose box, autocomplete, attaching files/images
Milestone

Comments

@gnprice
Copy link
Member

gnprice commented Apr 4, 2023

This Zulip feature: https://zulip.com/help/mention-a-user-or-group#from-the-compose-box

For a first prototype, it's fine to cover only the most prototypical user @-mentions, without (a) groups, (b) wildcards, or (c) silent mentions. If in our first PR implementing this feature, handling any or all of those would add complexity and not just fall out naturally, then we'll leave them aside and open new issues for them.

In addition to being a valuable feature for users, part of the value of this feature for the prototype is that it gives a workout to some of the trickier aspects of a text input — useful for #47:

  • We'll be using the TextEditingController: noticing when the user has started typing an @-mention, and then writing the @-mention back into the text when they select from the autocompletion box.
  • Ideally, we'd show the list of options just above or below where the user's cursor is in the text input.
    • In the RN app, this is difficult because the editing is handled over on the platform side, so the React/JS side doesn't know where the cursor is. (Even if we added plumbing to try to tell React/JS where the cursor is, it'd probably be tough to avoid jank.) We settle for having the list of options above the entire input. That works, but is less good when the input gets tall. It's especially less good if the input grows to most of the height on the screen.

    • If we end up going for a platform-native text input (Experiment with a native iOS text input #48), then we'd probably be in the same boat as in RN.

    • With the Flutter text input, though, it should definitely be possible in principle to do this and have it work smoothly. It might even be easy; or it might require getting our hands deep inside the EditableText implementation.

      If we don't find a way to make this easy, then we should leave it out of the first version of autocomplete and settle for putting the box above the whole input, like in the RN app. We'll then file an issue to revisit it.

chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this issue May 1, 2023
This is a small step toward zulip#49, without changing any UI. Here we
have a simple function `testUser` to test whether a given User
matches a query.

Related: zulip#49
chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this issue May 4, 2023
This is a small step toward zulip#49, without changing any UI. Here we
have a simple function `testUser` to test whether a given User
matches a query.

Related: zulip#49
chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this issue May 4, 2023
This is a small step toward zulip#49, without changing any UI. Here we
have a simple function `testUser` to test whether a given User
matches a query.

Related: zulip#49
chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this issue May 5, 2023
This is a small step toward zulip#49, without changing any UI. Here we
have a simple function `testUser` to test whether a given User
matches a query.

Related: zulip#49
@gnprice gnprice added the a-compose Compose box, autocomplete, attaching files/images label May 26, 2023
@gnprice gnprice added this to the Alpha milestone May 27, 2023
@gnprice gnprice removed the m-alpha label May 27, 2023
@chrisbobbe
Copy link
Collaborator

For the UI, I might first try experimenting with Flutter's Autocomplete widget.

@gnprice
Copy link
Member Author

gnprice commented Jun 7, 2023

For the UI, I might first try experimenting with Flutter's Autocomplete widget.

Interesting find!

Discussion thread in chat: https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/autocomplete.20UI/near/1588095

chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this issue Jul 4, 2023
chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this issue Jul 8, 2023
The UI for now is kept simple; the optionsViewBuilder closely
follows the one in the Material library's `Autocomplete`, which
thinly wraps `RawAutocomplete`:
  https://api.flutter.dev/flutter/material/Autocomplete-class.html

Fixes: zulip#49
Fixes: zulip#129
chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this issue Jul 8, 2023
The UI for now is kept simple; the optionsViewBuilder closely
follows the one in the Material library's `Autocomplete`, which
thinly wraps `RawAutocomplete`:
  https://api.flutter.dev/flutter/material/Autocomplete-class.html

Fixes: zulip#49
Fixes: zulip#129
chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this issue Jul 8, 2023
The UI for now is kept simple; the optionsViewBuilder closely
follows the one in the Material library's `Autocomplete`, which
thinly wraps `RawAutocomplete`:
  https://api.flutter.dev/flutter/material/Autocomplete-class.html

Fixes: zulip#49
Fixes: zulip#129
chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this issue Jul 19, 2023
The UI for now is kept simple; the optionsViewBuilder closely
follows the one in the Material library's `Autocomplete`, which
thinly wraps `RawAutocomplete`:
  https://api.flutter.dev/flutter/material/Autocomplete-class.html

Fixes: zulip#49
Fixes: zulip#129
chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this issue Jul 20, 2023
The UI for now is kept simple; the optionsViewBuilder closely
follows the one in the Material library's `Autocomplete`, which
thinly wraps `RawAutocomplete`:
  https://api.flutter.dev/flutter/material/Autocomplete-class.html

Fixes: zulip#49
Fixes: zulip#129
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-compose Compose box, autocomplete, attaching files/images
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants