damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 6e2c133faa47f198b48ebe521868b3e360af6cd5
parent 9885ff19128ebd68d8bea992394f1f8d77e9e8d8
Author: Daniel D’Aquino <daniel@daquino.me>
Date:   Sat, 13 Jul 2024 00:31:30 +0000

Truncate long text messages on chat event view

Very large messages on the chat event view cause issues with swipe and
long-press interactions, and they might be a nuisance during scrolling.

This commit adds text truncation to the chat event view. The "show
more" button causes the user to navigate to the message, which is
reasonable to avoid overloading too many interactions on the same view
and having a huge text bubble that is difficult to interact with.

Closes: https://github.com/damus-io/damus/issues/2326
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>

Diffstat:
Mdamus/Views/Chat/ChatEventView.swift | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/damus/Views/Chat/ChatEventView.swift b/damus/Views/Chat/ChatEventView.swift @@ -124,13 +124,13 @@ struct ChatEventView: View { } let blur_images = should_blur_images(settings: damus_state.settings, contacts: damus_state.contacts, ev: event, our_pubkey: damus_state.pubkey) - NoteContentView(damus_state: damus_state, event: event, blur_images: blur_images, size: .normal, options: []) + NoteContentView(damus_state: damus_state, event: event, blur_images: blur_images, size: .normal, options: [.truncate_content]) .padding(2) } .frame(minWidth: 5, alignment: is_ours ? .trailing : .leading) .padding(10) } - .tint(is_ours ? Color.white : Color.accentColor) + .tint(Color.accentColor) .overlay( ZStack(alignment: is_ours ? .bottomLeading : .bottomTrailing) { VStack {