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

Find a solution for flutter_mentions #1853

Open
gnunicorn opened this issue Jun 19, 2024 · 4 comments
Open

Find a solution for flutter_mentions #1853

gnunicorn opened this issue Jun 19, 2024 · 4 comments
Assignees
Labels
bug Something isn't working s-chat Features and Bugs related to the chat section

Comments

@gnunicorn
Copy link
Contributor

gnunicorn commented Jun 19, 2024

We have several issue that seem to directly come from our usage of flutter_mentions. The dependency is clearly not maintained at this point and we need to decide what we want to do about it.

Most notably it seems to cause:

@gnunicorn gnunicorn added bug Something isn't working s-chat Features and Bugs related to the chat section labels Jun 19, 2024
@gnunicorn
Copy link
Contributor Author

We are going to fork flutter tagger into our repo and start working from there replacing the existing mentions with our own implementation.

@gnunicorn
Copy link
Contributor Author

so, experimented with TypeAhead as an alternative, also pretty nice. However we face a similar issue here: We have to load the entire list of userIDs and displayNames once and check for them, thus potentially being a lot slower in even displaying the first set of items. If we were to use a riverpod-ish system though, we could have first checks go to ref.watch(memberDisplayName(..)).valueOrNull and whenever the becomes available re-evaluate it. that'd actually be nicer.

@gnunicorn
Copy link
Contributor Author

also as a reference point, this has some nice usage pattern: https://pub.dev/packages/multi_trigger_autocomplete

@gnunicorn
Copy link
Contributor Author

gnunicorn commented Jun 27, 2024

but purely technically speaking, what do we need/care about at this point?

  1. we want to notice certain characters being typed (for now @ does it)
  2. if that happens, we want to have Flutter Overlay appear showing us options, matching the list to the input
  3. when a user selects any of them, we replace the content of the textfield with the corresponding match

The list in 2 should probably just be a simple widget that we can then feed a riverpod consumer into so we can live update and don't have to wait for avatar data and stuff.

nice to have, follow up after:

  • up and down arrows in the text field select items in the view, pressing enter selects it.
  • render the entry in the box differentely (user-pill with avatar and display name instead of the regular content)
  • other inputs we replace (e.g. emoji, and # to search rooms)

@gtalha07 gtalha07 self-assigned this Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working s-chat Features and Bugs related to the chat section
Projects
Status: Next
Development

No branches or pull requests

2 participants