element-android icon indicating copy to clipboard operation
element-android copied to clipboard

Added lab feature to pin/unpin messages

Open cintek opened this issue 2 years ago • 12 comments

Type of change

  • [x] Feature
  • [ ] Bugfix
  • [ ] Technical
  • [ ] Other :

Content

This PR adds a new feature so users can (un)pin messages and open a timeline where only the pinned messages are visible. The feature can be found and activated in the "Labs" settings.

Details of this feature:

  • It is possible to (un)pin messages
  • Users can open a timeline with all pinned messages
  • Users can jump to a specific messages from the pinned messages timeline to the "normal" timeline
  • Users have to have the necessary role to (un)pin messages

Little background: Currently, if pinned messages are missing the client will load chunks of older messages like it does in the "normal" timeline until all pinned messages are available. This is not very efficient but it works for now.

Motivation and context

Solves #5933 and #357

Screenshots / GIFs

Here you can see the context menu which includes a button to pin a message. When a message is pinned already a button to do the opposite will be shown. context_menu

When there are pinned messages available a button to open a timeline with these messages appears at the top right corner. open_pinned_messages

Tests

  • (Un)Pinned messages and compared result with web client

Tested devices

  • [x] Physical
  • [ ] Emulator
  • OS version(s): Android 12

Checklist

  • [x] Changes has been tested on an Android device or Android emulator with API 21
  • [x] UI change has been tested on both light and dark themes
  • [ ] Accessibility has been taken into account. See https://github.com/vector-im/element-android/blob/develop/CONTRIBUTING.md#accessibility
  • [x] Pull request is based on the develop branch
  • [x] Pull request includes a new file under ./changelog.d. See https://github.com/vector-im/element-android/blob/develop/CONTRIBUTING.md#changelog
  • [x] Pull request includes screenshots or videos if containing UI changes
  • [x] Pull request includes a sign off
  • [ ] You've made a self review of your PR
  • [ ] If you have modified the screen flow, or added new screens to the application, you have updated the test UiAllScreensSanityTest.allScreensTest()

Signed-off-by: Christoph Klassen [email protected]

cintek avatar Dec 10 '22 19:12 cintek

@bmarty thanks for your review! I edited the things you marked and also did some additional refactoring (renamed files and variables to have more consistency). Since I was already working on the edits I also made the icons (to pin/unpin events) in the context menu bigger so their size fits better to the other ones.

cintek avatar Dec 16 '22 08:12 cintek

In case that someone wants to know where the icons which are used in this PR come from : They are from Microsoft's Fluent Icons.

cintek avatar Dec 16 '22 09:12 cintek

@bmarty I removed the property -XX:MaxPermSize=2048m in gradle.properties (diff) because I'm using a newer version of Java JDK which was complaining that this property is deprecated. If you want I will add it again. I just forgot to add it again before commiting.

cintek avatar Dec 16 '22 09:12 cintek

Waiting for this to be merged, it's a very useful feature. Right now I have to explore the room data and copy out the pin IDs, then check them one by one. It isnt very convenient at all

catfromplan9 avatar Apr 20 '23 09:04 catfromplan9

@bmarty I removed the property -XX:MaxPermSize=2048m in gradle.properties

I'd also vote for removing the MaxPermSize property (which has been deprecated since Java 1.8), as the source / target compatibility is at 11 anyway:

https://github.com/vector-im/element-android/blob/591b08f1ff426d5d7a5ee6e60599d809f45bbcc4/dependencies.gradle#L5-L6

sschuberth avatar May 23 '23 16:05 sschuberth

@bmarty any updates?

artempas avatar Oct 20 '23 13:10 artempas

nice feature here! Does it need more changes before merging it @bmarty ?

grvn-ht avatar Apr 26 '24 05:04 grvn-ht

BTW: In Element X for Android this feature is already included and since today enabled as default: https://github.com/element-hq/element-x-android/releases/tag/v0.6.0.

cintek avatar Sep 12 '24 14:09 cintek

BTW: In Element X for Android this feature is already included and since today enabled as default: https://github.com/element-hq/element-x-android/releases/tag/v0.6.0.

I'd rather not use element X, can you update this PR with the necessary changes and get it merged?

catfromplan9 avatar Sep 16 '24 12:09 catfromplan9

I'd rather not use element X, can you update this PR with the necessary changes and get it merged?

I implemented all requested changes already and don't know if there is anything from my side that has to be done for a merge.

cintek avatar Sep 16 '24 12:09 cintek

I'd rather not use element X, can you update this PR with the necessary changes and get it merged?

I implemented all requested changes already and don't know if there is anything from my side that has to be done for a merge.

It says reviews are pending with changes requested, @bmarty any updates on this? I really like this client and want to continue using it for the forseeable future

catfromplan9 avatar Sep 16 '24 15:09 catfromplan9

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Sep 25 '24 12:09 CLAassistant

Any updates on this? It's been a month and everything seems to be about to come to a happy end, but it still doesn't. Thanks in advance.

Metrasher avatar Oct 29 '24 22:10 Metrasher