Skip to content

Rework timeline events rendering #7633

Description

@jmartinesp

Your use case

What would you like to do?

Rework the rendering of timeline events so we don't just have a TextView with spans and a few drawn overlays, but we can actually add interactive components like scrollable or expandable code blocks or quotes, spoiler tags, inline images, etc.

As a bonus, it would also be nice to modernise the Rich Text Editor (RTE) so it uses Compose components instead of a legacy EditText wrapped in a Composable bridge. However, this is orders of magnitudes more complex and is out of scope.

Why would you like to do it?

How would you like to achieve it?

  • Stop using the RTE's HtmlToSpanParser for converting HTML into spanned rich text, and depending in the RTE's renderer altogether for rendering events.
  • Instead, create our own HTML parser that converts those into either a list of composable functions, or some abstractions over the different tags (paragraph, code block, spoiler, quote, etc.) that can be passed around and then turned into composable functions when needed.
  • Stop using TextView to render the data, use rich Compose components with its own logic, and in the case of pure text, move to using the Composable Text function instead with styles.
  • Rewrite the mention/room pills so they work with Text.
  • Still take into account what's the latest composable to render to be able to place the timestamp and resize the message bubble accordingly.

Have you considered any alternatives?

The only alternative would be to keep using the current rendering. Given iOS is already way past this, having interactive code blocks and working on supporting spoiler tags, we should try to reach parity.

Additional context

No response

Are you willing to provide a PR?

Yes

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-EnhancementNew features, changes in functionality, performance boosts, user-facing improvements

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions