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

perf: skip message skeleton if it is cached #10750

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

st3iny
Copy link
Member

@st3iny st3iny commented Feb 25, 2025

Resolves #10749

Cache messages in the frontend directly. Only show the skeleton if message is not yet cached.

I also delayed the skeleton animation by 200 milliseconds as we also do HTTP level caching. To prevent flickering in case the message is not cached in the frontend but by the browser.

Screencasts

No browser cache + extremely slow connection

2025-02-25.21-33-00.mp4

Browser cache + normal connection (localhost)

2025-02-25.21-35-27.mp4

let loadingTimeout
const isCached = !!this.mainStore.getMessage(this.envelope.databaseId)
if (!isCached) {
loadingTimeout = setTimeout(() => this.loading = Loading.Skeleton, 200)
Copy link
Member

Choose a reason for hiding this comment

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

eslint complains about the assignment as only expression of the array function

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.

Don't show loading skeleton each time a known message is opened
2 participants