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

Autocomplete for topic to send to #310

Open
gnprice opened this issue Sep 22, 2023 · 4 comments · May be fixed by #627
Open

Autocomplete for topic to send to #310

gnprice opened this issue Sep 22, 2023 · 4 comments · May be fixed by #627
Labels
a-compose Compose box, autocomplete, attaching files/images

Comments

@gnprice
Copy link
Member

gnprice commented Sep 22, 2023

We should offer autocompletion in the topic input of the compose box. (When that topic input exists, i.e. for interleaved narrows.)

This is a step on the way to:

and an element we'll almost surely want in any UX solution we choose there.

Not to be confused with autocomplete for mentioning a topic inside the content of a message:

@gnprice gnprice added the a-compose Compose box, autocomplete, attaching files/images label Sep 22, 2023
@gnprice gnprice added this to the Beta milestone Sep 22, 2023
@gnprice gnprice modified the milestones: Beta 1, Beta 2 Nov 8, 2023
@gnprice gnprice modified the milestones: Beta 2, Beta 3 Nov 22, 2023
@Khader-1
Copy link
Collaborator

Khader-1 commented Apr 2, 2024

I've reviewed this task, and I believe it's one step up compared to my previous contributions. I am confident I can tackle it effectively.
To address this, I propose the following steps:

  • Implementing a new API call to retrieve data from https://chat.zulip.org/api/users/me/:stream_id/topics
  • Modifying the widget structure to incorporate autocomplete functionality, similar to the message compose input
  • Developing a view model and a controller similar to those used for the compose input

I am keen to take on this task and intend to start by creating an initial prototype before requesting formal assignment.

@gnprice
Copy link
Member Author

gnprice commented Apr 2, 2024

@Khader-1 Sounds good! Please go ahead.

@timabbott
Copy link
Sponsor Member

This data structure is likely a thing that will end up being used for other things. stream_topic_history.ts in the Zulip web app may be a useful reference. There are some messy/subtle problems with how it tries to live-update, detailed in zulip/zulip#29015, so a lot of the current complexity is wrong. But specifically the logic in stream_topic_history_util.ts might be a helpful reference for how the web app does fetch-on-demand these data, and caches it.

(It can take like 0.5s to get a response in a stream with thousands of topics).

@gnprice
Copy link
Member Author

gnprice commented Apr 4, 2024

Thanks Tim!

For a solution for this issue, I think I'd be happy with a version where the list of topics for a given stream is only cached for the lifetime of a given autocomplete interaction — that is, for the lifetime of a given topic input field.

In particular that avoids most of the complexity of maintaining the data structure, because it's OK if it doesn't stay accurately in sync in subtle edge cases (and really it's 95% OK if it doesn't get updated at all), because not many changes will happen during its lifetime.

The main cost is that 0.5s lag to get the list of topics. But we'd have that anyway the first time a user goes to compose in a given stream, so I'm not sure there's a huge difference between that and every time.

Hmm, though I guess one benefit of keeping it around longer is that we could be more eager about fetching it — like when you view a given stream narrow, rather than when you start composing. Then you might rarely actually see the 0.5s latency.


In any case: for when we do tackle this data structure (as part of this issue or later), see also RecentDmConversationsView. That's our efficient data structure for maintaining the list of your recent DM conversations; I think one wants basically the same data structure for that as for topics in a stream. (The event handling will be a bit different, though, and the event handling we have already for DMs is likely incomplete anyway.)

So I'd want to factor that out into a somewhat more generic list-of-recent-conversations data structure, with RecentDmConversationsView as a wrapper around that, and then add the recent-topics-per-stream data structure as another such wrapper.

Khader-1 added a commit to Khader-1/zulip-flutter that referenced this issue Apr 30, 2024
@Khader-1 Khader-1 linked a pull request Apr 30, 2024 that will close this issue
Khader-1 added a commit to Khader-1/zulip-flutter that referenced this issue May 27, 2024
Khader-1 added a commit to Khader-1/zulip-flutter that referenced this issue May 27, 2024
Khader-1 added a commit to Khader-1/zulip-flutter that referenced this issue May 29, 2024
Khader-1 added a commit to Khader-1/zulip-flutter that referenced this issue May 29, 2024
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: No status
Development

Successfully merging a pull request may close this issue.

3 participants