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

POC: Add detailed membership change summaries à la element-web #4221

Closed

Conversation

Johennes
Copy link
Contributor

@Johennes Johennes commented Apr 14, 2021

This is a proof-of-concept for replacing the generic "x membership changes" messages with detailed summaries analogous to element-web.

The implementation utilizes the JavaScript code used in element-web and executes it in a JSContext. I'm interested to hear thoughts on whether this would be considered a viable approach.

Before

Simulator Screen Shot - iPhone 12 Pro Max - 2021-04-14 at 19 27 12

After

Simulator Screen Shot - iPhone 12 Pro Max - 2021-04-14 at 19 26 14

(Note that the "... 1 times" suffixes result from the matrix-react-sdk translations not being used in this POC.)

The native code needed to enable this turned out to be rather minimal. In fact, most of the code in this PR is infrastructure code, that could be reused when integrating further pieces of matrix-react-sdk. If this type of reuse was employed at larger scale, it might make it more easy for element-ios to catch up with element-web features.

The biggest downside is that the JavaScript code is a bit of a black box from the native perspective and rather hard to debug. This is mitigated, however, by having test coverage in matrix-react-sdk and could be further alleviated by adding tests on the native side as well.

Things left to do for making the POC production-ready

  • Integrate translations
    This involves programmatically extracting the strings used in the extracted JavaScript code and converting the respective pieces of the localization JSONs to string dicts.
  • Automate consumption
    For the POC, I compiled all of matrix-react-sdk with yarn build and then combined the needed .js files with Browserify. For frequent usage, this should be optimized (to only compile the needed JavaScript sources) and automated (e.g. via a script).

Depends on: matrix-org/matrix-react-sdk#5867
Closes: #4102
Signed-off-by: Johannes Marbach n0-0ne+github@mailbox.org

Pull Request Checklist

  • I read the contributing guide
  • UI change has been tested on both light and dark themes, in portrait and landscape orientations and on iPhone and iPad simulators
  • Pull request is based on the develop branch
  • Pull request updates CHANGES.rst
  • Pull request includes screenshots or videos of UI changes
  • Pull request includes a sign off

This replaces the generic "x membership changes" messages with detailed
summaries analogous to element-web. The implementation uses the same code
used on element-web, executed in a `JSContext`.

Closes: element-hq#4102
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
@Johennes Johennes changed the title Add detailed membership change summaries à la element-web POC: Add detailed membership change summaries à la element-web Apr 18, 2021
@Johennes
Copy link
Contributor Author

Johennes commented Apr 7, 2022

Looks like with the new / better Rust SDK approach this will be obsolete. 🚀

@Johennes Johennes closed this Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invites are collapsed incorrectly
2 participants