Skip to content

Conversation

@slowscript
Copy link
Contributor

I've added the ability to send and receive text messages. This could be useful for quickly sending URLs and tokens between devices and would fix #105
warpinator-msg_2

The messages can be selected and copied (selection, or whole message using the button). Up to 4 lines or first 120 characters are shown, although sometimes 4 lines can be exceeded due to wrapping. Unfortunately I did not figure out how to convince Gtk to properly ellipsize it, suggestions are welcome. Wrapping the text manually by inserting newlines looks the best, but then selecting and copying a part of it also includes the newlines... Another option would be to put the label in a ScrolledWindow, but I don't think that looks good. I think limiting the visible length in some way is needed to avoid having one message take up the whole window.

It also shows a notification:
msg-notification

I will add an identical feature to the Android and Windows versions later.

Copy link

@M0-find-U M0-find-U left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beenden

@M0-find-U
Copy link

I've added the ability to send and receive text messages. This could be useful for quickly sending URLs and tokens between devices and would fix #105

warpinator-msg_2

The messages can be selected and copied (selection, or whole message using the button). Up to 4 lines or first 120 characters are shown, although sometimes 4 lines can be exceeded due to wrapping. Unfortunately I did not figure out how to convince Gtk to properly ellipsize it, suggestions are welcome. Wrapping the text manually by inserting newlines looks the best, but then selecting and copying a part of it also includes the newlines... Another option would be to put the label in a ScrolledWindow, but I don't think that looks good. I think limiting the visible length in some way is needed to avoid having one message take up the whole window.

It also shows a notification:

msg-notification

I will add an identical feature to the Android and Windows versions later.

"Delete all"

@M0-find-U
Copy link

I've added the ability to send and receive text messages. This could be useful for quickly sending URLs and tokens between devices and would fix #105

warpinator-msg_2

The messages can be selected and copied (selection, or whole message using the button). Up to 4 lines or first 120 characters are shown, although sometimes 4 lines can be exceeded due to wrapping. Unfortunately I did not figure out how to convince Gtk to properly ellipsize it, suggestions are welcome. Wrapping the text manually by inserting newlines looks the best, but then selecting and copying a part of it also includes the newlines... Another option would be to put the label in a ScrolledWindow, but I don't think that looks good. I think limiting the visible length in some way is needed to avoid having one message take up the whole window.

It also shows a notification:

msg-notification

I will add an identical feature to the Android and Windows versions later.

@mtwebster mtwebster requested a review from clefebvre June 5, 2025 15:32
@mtwebster
Copy link
Member

Hi, I tested this out, some feedback:

  • We need to be able to detect that a remote has messaging capability (maybe our ServiceInfo needs to have an extra field to declare this?), and hide/disable messaging features if appropriate.
    image

  • New messages trigger a notification, but not a highlighting of the remote from the main view.
    image

  • I'm not a fan of having a popup to send a message - it's too many steps I think. What about having an entry at the bottom of the remote's page?
    (quick glade mock-up)
    image

  • Maybe we can improve the display of the received message to allow it to be wider:
    image
    You could hide the transfer_size_label for messages and add a new op_status_stack page with another, wider label (the one you're using now is 30px wide fixed).

I'd like to wait for @clefebvre's opinion on all of this stuff though - opinions tend to vary :)

Thanks!

@clefebvre clefebvre changed the title Ability to send text messages [WIP] Ability to send text messages Jul 25, 2025
@clefebvre
Copy link
Member

Same as @mtwebster, I think it's better to have an entry at the bottom.

To show the message in the window, you can hide more columns. You don't need to mention "Text message", a chat bubble icon would be explicit enough imo.

Display text message as a transfer in UI, show notification, allow copy text
Send message button and dialog
@slowscript
Copy link
Contributor Author

Thanks for the feedback and sorry for taking so long to address it. I didn't have much time over the summer and then I sort of forgot about it.

The messaging capability is now communicated in new a feature_flags bitfield as part of RemoteMachineInfo. I think this is a better place than increasing the size of the mDNS record.

New message now also triggers highlighting of the remote, this was a one line change.

I have also removed the popup for entering the messages and now they can be send directly from the main window (by clicking the button or Ctrl+Enter)
obrazek

The messages now show up in a new 80 char wide label. It turns out that a Gtk.Label does not handle limiting number of lines well when the text contains newlines. I tried to fix that by subclassing it and limiting the height by overriding get_height_for_width, but that sometimes (randomly) resulted in the text being drawn outside of the extents of the label. I wasn't able to solve this, so I decided to ellipsize the text being put into the label manually.
obrazek

@mtwebster
Copy link
Member

Thanks, trying this now. I'll have a look at the label issue also.

@clefebvre clefebvre changed the title [WIP] Ability to send text messages Ability to send text messages Nov 20, 2025
@mtwebster
Copy link
Member

I see what you mean about the label height. It's possible the 'correct' behavior (set lines and ellipsize and be done) is broken by the fact it's part of a GtkListBox.

There's an issue with the fixed width of the text box, I'm not sure that's necessary - I don't think we need to be too strict with how many lines actually end up getting shown as long as we put some limit on newlines (so long lines can wrap, and unwrap if the user resizes the window).

@mtwebster mtwebster merged commit b539df2 into linuxmint:master Nov 21, 2025
2 checks passed
@mtwebster
Copy link
Member

Simplified the label a bit and added url detection:
2f089ca

We can see how this goes and adjust things if we need.

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Send text

5 participants