Skip to content

Conversation

jmattheis
Copy link
Member

@jmattheis jmattheis commented Sep 20, 2025

To reproduce, create messages with varying height with and without images.

$ echo '\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na![](https://placehold.co/650x452)' | gotify push --url 'http://localhost:8080' --token 'A.S0nAhucR2JCBN' --contentType text/markdown
$ echo '\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na' | gotify push --url 'http://localhost:8080' --token 'A.S0nAhucR2JCBN' --contentType text/markdown
$ echo '\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na\n\na' | gotify push --url 'http://localhost:8080' --token 'A.S0nAhucR2JCBN' --contentType text/markdown

@eternal-flame-AD, could you give this a try?

Fixes #846

The detection if the read-more button is necessary happened once at
render and wasn't recalculated after images loaded. This caused hidden
message overflow without a read more button.
Using index is bad practice: https://react.dev/learn/rendering-lists#rules-of-keys

We don't recalculate the overflow state once the message is overflown.
When using the index as key, then when a new message is added at the top
of the array at index 0. The overflow state from the previous message at
index 0 is kept. The overflow state shouldn't be reused.
@jmattheis jmattheis requested a review from a team as a code owner September 20, 2025 11:38
Copy link

codecov bot commented Sep 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.77%. Comparing base (4329e57) to head (9ff713c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #848   +/-   ##
=======================================
  Coverage   78.77%   78.77%           
=======================================
  Files          56       56           
  Lines        2671     2671           
=======================================
  Hits         2104     2104           
  Misses        476      476           
  Partials       91       91           

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Member

@eternal-flame-AD eternal-flame-AD left a comment

Choose a reason for hiding this comment

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

lgtm

@jmattheis jmattheis merged commit f77d404 into master Sep 21, 2025
4 checks passed
@jmattheis jmattheis deleted the fix-read-more branch September 21, 2025 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Read more button not showing when message contains images

2 participants