Skip to content

Fix some issues in the new timeline renderer - #7751

Merged
jmartinesp merged 7 commits into
developfrom
fix/issues-with-new-timeline-renderer
Sep 26, 2026
Merged

jmartinesp merged 7 commits into
developfrom
fix/issues-with-new-timeline-renderer

Conversation

@jmartinesp

@jmartinesp jmartinesp commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Content

Fixes some reported issues about the new timeline renderer:

  • ParagraphView having a smaller size than the rest of the timeline contents.
  • Clicking or long pressing on ParagraphView not passing the events to the parent, so long pressing without a URL annotation below had no effect in the message bubble.
  • Mention pills now don't have vertical padding, they're smaller and should look like the old ones did.
  • Code blocks displaying fading edges even when they could not scroll.

Motivation and context

These issues were reported by @frebib .

Screenshots / GIFs

In the PR.

Tests

Enable the feature flag and check these work as expected, I guess?

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • I am aware of the etiquette.
  • This PR was made with the help of AI:
    • Yes. In this case, please request a review by Copilot.
    • No.
  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly defines what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

@jmartinesp jmartinesp added the PR-Bugfix For bug fix label Sep 23, 2026
@jmartinesp jmartinesp changed the title Make ParagraphView follow LocalTextStyle.current Fix some issues in new timeline renderer Sep 23, 2026
@jmartinesp jmartinesp changed the title Fix some issues in new timeline renderer Fix some issues in the new timeline renderer Sep 23, 2026
@jmartinesp
jmartinesp marked this pull request as ready for review September 23, 2026 07:28
@jmartinesp
jmartinesp requested a review from a team as a code owner September 23, 2026 07:28
@jmartinesp
jmartinesp requested review from ganfra and removed request for a team September 23, 2026 07:28
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/AMpguG

@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 4.76190% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.09%. Comparing base (e5c078c) to head (a6dddcd).

Files with missing lines Patch % Lines
...ibraries/htmlrenderer/api/ui/HtmlMessageContent.kt 4.76% 19 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7751      +/-   ##
===========================================
- Coverage    81.11%   81.09%   -0.02%     
===========================================
  Files         2797     2797              
  Lines        82992    83006      +14     
  Branches     11437    11440       +3     
===========================================
  Hits         67316    67316              
- Misses       11273    11287      +14     
  Partials      4403     4403              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This should make them look like they did in the previous renderer
… url annotation is clicked or long clicked

`detectTapGestures` always consumes the touch events, no matter if they are handled or not, blocking these events from reaching parent components.

Should fix the issue of `ParagraphView` blocking the long press action in the message bubbles
@jmartinesp
jmartinesp force-pushed the fix/issues-with-new-timeline-renderer branch from 0be2b99 to bf5af4b Compare September 23, 2026 13:22

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The composer is all kinds of broken in the Added here. Race/timing issue?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In fact, quite a few of the screenshots are like this either before or after. Weird.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jmartinesp jmartinesp Sep 24, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is a problem with recorded screenshots since the last version of paparazzi, which we can't downgrade. It's sadly expected.


// Previews and screenshots can't render the fading edge gradients properly, everything is obscured by them, so we skip them in the preview mode.
if (LocalInspectionMode.current.not()) {
if (LocalInspectionMode.current.not() && scrollState.maxValue > 0) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we not use canScrollForward || canScrollBackward instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I could have sworn last time I tried to use that it didn't work. Maybe the problem was in the previews, but it does work well in an actual device. Will change it.

},
onLongPress = { offset ->
val (url, urlText) = layoutResult.value?.urlAt(offset, text) ?: return@detectTapGestures
awaitEachGesture {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are we moving away from detectTapGestures? I'm not familiar enough with the api, but detectTapGesture is using a loop, here I think we'll mostly drop relevant events? Have you tried on a regular device, not emulator?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Why are we moving away from detectTapGestures?

Because detectTapGestures consumes the events and any touch events that should go to the message bubble are ignored.

detectTapGesture is using a loop, here I think we'll mostly drop relevant events?

I thought so too, but it's working fine. Since we just want to check down -> up, it seems to work. Maybe it won't if there is a move, but I think we might want to ignore those. I can double check.

Have you tried on a regular device, not emulator?

Yes, in fact I only tested it in my test device, I didn't even use the emulator.

if (up.pressed) return@withTimeout null
up.consume()

up.uptimeMillis - down.uptimeMillis > longPressTimeout

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's probably deadcode because of the withTimeout(longPressTimeout)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hmm, true. At first I wanted to trigger this just on the up event, but that led to some weird interactions, so I added the timeout, but having the exact same value as the check before it'll just ignore the up event.

@jmartinesp jmartinesp added Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. and removed Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. labels Sep 24, 2026
@sonarqubecloud

Copy link
Copy Markdown

@jmartinesp
jmartinesp requested a review from ganfra September 24, 2026 13:26

@ganfra ganfra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok let's merge this and continue to iterate!

@jmartinesp
jmartinesp merged commit 4bf2a09 into develop Sep 26, 2026
32 of 34 checks passed
@jmartinesp
jmartinesp deleted the fix/issues-with-new-timeline-renderer branch September 26, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-Bugfix For bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants