Skip to content

Performance optimizations and scroll and jump fixes#789

Draft
7w1 wants to merge 28 commits intodevfrom
fix-various-optimizations
Draft

Performance optimizations and scroll and jump fixes#789
7w1 wants to merge 28 commits intodevfrom
fix-various-optimizations

Conversation

@7w1
Copy link
Copy Markdown
Member

@7w1 7w1 commented May 11, 2026

Description

Numerous patches.

The largest change, is yet another timeline rewrite this time aimed at ripping it apart into smaller files, adding some tests for general behavior, and fixing the damn scroll and jump mechanics once and for all.

Secondly, many, many things have been slightly adjusted to just be lazy loaded, including various components that aren't necessary on boot (swipeable chat wrappers, sentry, modals, the monospace font), and some prefetching when you hover over settings buttons/other stuff so that the fact that its being loaded on the fly is barely noticable, and I'll try to do even more before this PR is finished. End result, initial boot is slightly faster, swapping rooms and spaces is substantially faster (also added better placeholders so it feels faster, even when its not).

Finally, fixed a nonfunctional audio embed showing up for some dumb reason when your homeserver fails to fetch image/video previews for a link.

Some issues i’m still working on:

  • Sometimes, on some pagination loads, the timeline either jumps to the bottom or to wherever those loaded messages are, particularly right when you open a room or right after you jump to a message and scroll.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change - I'm like positive somethings gonna break lmao
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

AI disclosure:

  • Partially AI assisted (clarify which code was AI assisted and briefly explain what it does).
  • Fully AI generated (explain what all the generated code does in moderate detail).

Tests were fully AI generated, the timeline scroll chaos was quite heavily AI assisted during the development phases, although the final product that remains is mostly me (through picking and choosing pieces and doing heavy testing to ensure its working properly). Getting scroll working smoothly and properly is a pain that I don't have enough experience with to truly fix on my own, so it involved a lot of token spamming.

For the most part, basic scrolling behavior is offloaded to virtua, but with a few specific patches, in particular a patch was added to make sure when you swap rooms you're clamped down to the bottom of the view as embeds load and shift the timeline and the timeline properly clamps around the jumped-to message so that when new content loads it doesn't shift the jumped-to message around, and finally finally the timeline actually remains clamped to that jumped to message instead of jumping back to the bottom when the content isn't yet cached locally.

7w1 added 28 commits May 9, 2026 19:24
i dont think this actually improves performance though :/
doubt these ones make much difference if any
dont tell anyone but i didn't test this
dear god this is a mess, despite that, it is in a workable state that I can hopefully refine further
still gotta fix all the linting i ignored in my desperate attempts to make it work
hopefully the last fix...
stuff broke time for more patches!
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Missing changeset

This pull request does not include a changeset. Please add one before requesting review so the change is properly documented and included in the release notes.

How to add a changeset:

  1. Run pnpm run document-change (interactive) and commit the generated file, or
  2. Manually create .changeset/<descriptive-name>.md:
---
default: patch
---

Short user-facing summary of the change.

Replace patch with major, minor, patch, docs, or note as appropriate.

📖 Read more in CONTRIBUTING.md.

If this PR is internal/maintenance with no user-facing impact, a maintainer can add the internal label to skip this check.

@github-actions
Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

Status Preview URL Commit Alias Updated (UTC)
✅ Deployment successful! https://pr-789-sable.raspy-dream-bb1d.workers.dev 58bc414 pr-789 Mon, 11 May 2026 04:22:08 GMT

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.

1 participant