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

Improve search for chat messages #4433

Open
mahibi opened this issue Nov 12, 2024 · 4 comments · May be fixed by #4647
Open

Improve search for chat messages #4433

mahibi opened this issue Nov 12, 2024 · 4 comments · May be fixed by #4647
Assignees
Labels
1. to develop Accepted and waiting to be taken care of (should be only set by nextcloud employees)
Milestone

Comments

@mahibi
Copy link
Collaborator

mahibi commented Nov 12, 2024

The message search was never implemented sufficiently.

A user does not always get the result he is looking for, i.e. the message he is looking for is sometimes not found in the chat.

The overview will show the matched results, but when clicking on a result it depends if the message is available in the adapter.

For older messages this is most likely not the case (one would have to scroll very often upwards before searching to have a chance it's included in the adapter), so only the last messages of the chat are shown instead to show the searched message.

Loading all messages into the adapter at once is not an option for performance reasons. Same for doing it in a loop. (It may differ if the message is found in the database for the latest chatblock. Then it might be an option to load a lot of data into the adapter, as it's quicker than doing online requests in a loop. But this might also have limitations).

Talk iOS seems to have the same challenge. The workaround there is to show a snippet of the chat in a search window. So there the searched message is shown and maybe 30(?) messages are shown before and after it, without being able to scroll further.
For talk android this would mean that chatblocks may be created that are not connected to the latest chatblock. This shouldn't be a problem when there is no option to scroll in the search result window.

We should implement the same for android talk or discuss if there are other ways to solve it.

@mahibi mahibi added the 1. to develop Accepted and waiting to be taken care of (should be only set by nextcloud employees) label Nov 12, 2024
@mahibi
Copy link
Collaborator Author

mahibi commented Dec 11, 2024

@Ivansss @SystemKeeper does iOS use the chatmessages/chatblocks from DB at all for this or is it completely independent (=not persistent)?

@Ivansss
Copy link
Member

Ivansss commented Dec 11, 2024

At this moment on Talk iOS, only global (in all conversations) message search can be done from the conversations list view.
In order to perform this search, there should be an internet connection.
If the user then selects any search result, we get a message context for that message and present it in a chat snippet as you noticed:
https://github.com/nextcloud/talk-ios/blob/6d78cf2cabc967e8e5d02e779acc4f0e312bcf47/NextcloudTalk/RoomsTableViewController.m#L1296
So for this process we do not use anything that is stored in the DB and as mentioned before, user would need an internet connection since everything (search results and message context) is fetched from the server.

@mahibi mahibi added this to the 21.0.0 milestone Dec 16, 2024
@rapterjet2004 rapterjet2004 linked a pull request Jan 23, 2025 that will close this issue
21 tasks
@mahibi mahibi modified the milestones: 21.0.0, 21.1.0 Jan 28, 2025
@mahibi
Copy link
Collaborator Author

mahibi commented Feb 18, 2025

So the idea here is to implement this with jetpack compose (to already have message viewholders / recycler /... migrated before applying it to the main chat someday)

@rapterjet2004 As a first step, please first have a close look at https://github.com/android/compose-samples/tree/main/Jetchat and look at implementations of other chat apps

@ksihota
Copy link

ksihota commented Apr 5, 2025

I am not sure if the issue I am having is what is being discussed here or not. On the Android app when I search I get a list of messages that contain the word. When I select the displayed message I am taken to the latest message in my current conversation which is not what I am expecting.
On the Desktop app for windows, the search in the right pane first lists all found messages and when a message is selected it takes me to that message which is the expected result.

On the Android app shouldn't the behaviour be the same as what I see on the Win Desktop app?
Does this work as expected for other users? Maybe its a problem related to my devices?
AFAIK my Nextcloud server is latest version as is the NextCloud Talk component on the server and the apps on the mobile devices.

I assume this thread is based on this one: Message from search is not shown in chat #3527
which indicates messages stored in the "adapter"
Can the number of messages in the "adapter" be altered in the app? What is the default number?

The Search on the win desktop app is also a little strange as there are 3 search locations which are all different. The one on the left (most likely to be used) searches for conversations and users/groups/teams. This search does not search messages.
The other two are in the right panel that may need to be opened. The visible one searches participants and the one that searches through messages of the currently selected conversation requires you to select the search icon before actually doing the search. Basically you have to manually search to find the Search tool.
It will then search for a specific message in the current conversation and will then take you to that message when you click on your choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of (should be only set by nextcloud employees)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants