gurk-rs icon indicating copy to clipboard operation
gurk-rs copied to clipboard

Incorrect message selection due to non-message separators

Open hrdl-github opened this issue 1 year ago • 3 comments

Separator's in a channel's message view such as date separators or the new messages separator each increase an unwanted message offset by one, causing the wrong message to be returned. Example:

Message 1 (selection can return a message before this that is not being displayed)
Message 2 (selection can return a message before this that is not being displayed)
==== Some date ==== (selection returns Message 1)
Message 3 (selection returns Message 2)
---- new messages ---- (selection returns Message 3)
Message 4 (selection returns Message 4)

There might be some other issues, e.g. messages not being displayed.

hrdl-github avatar Sep 28 '24 14:09 hrdl-github

This created also a problems previously when answering to messages. Maybe, for now it is a good idea to disable this feature and rethink the design.

boxdot avatar Sep 28 '24 14:09 boxdot

I can try to implement something that is consistent and a bit more flexible. I want to implement a marking mechanism (in addition to cursor selection) of multiple messages to implement actions like copy_message marked and delete_message marked.

hrdl-github avatar Sep 28 '24 15:09 hrdl-github

I think iamb's approach in https://github.com/ulyssa/iamb/blob/9a9bdb4862646da3b03490ab250feb62df7ea468/src/windows/mod.rs and https://github.com/ulyssa/iamb/blob/9a9bdb4862646da3b03490ab250feb62df7ea468/src/windows/room/scrollback.rs would be suitable for gurk, too. It avoids the brittle index-based logic and is should be flexible to accommodate e.g. multiple selection or handling of list items of different types (e.g. messages, date separators, error messages, unread indicators).

hrdl-github avatar Nov 03 '24 14:11 hrdl-github