Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

feat(post): truncate long posts #396

Closed
wants to merge 4 commits into from

Conversation

FineFindus
Copy link

@FineFindus FineFindus commented Jan 30, 2023

Closes #215.

Adds the feature to truncate posts. Post are truncate by default, and can be expanded by tapping on them.

The current maximum posts length before truncating them is set to 666, the exact length is not important (as it is just a rough estimation of the length), but I set it to a value above the default 500 character limit with a bit of room to spare.
Translate post are not truncate, since it can be safely assumed, if a user translates a post, they want to read the whole post.

post_truncated.mp4

This pr is not yet finished, there are probably a couple of places I missed when testing. Also, I wasn't sure if it should be possible to expand a post in the timeline? And how could be integrated into the UI.

@FineFindus
Copy link
Author

FineFindus commented Jan 30, 2023

I just realized, that this implementation will only apply to text posts and won't work on the other types of posts. I didn't see any long post that were not only text posts, so I did not notice this oversight.

Since all the display items treat text the same way, it should take long to implement truncation for them

@FineFindus
Copy link
Author

I just realized, that this implementation will only apply to text posts and won't work on the other types of posts. I didn't see any long post that were not only text posts, so I did not notice this oversight.

I double-checked, this is not the case, I all post types work.

I think this is ready for a first review now.

@FineFindus FineFindus marked this pull request as ready for review January 31, 2023 15:18
@sk22
Copy link
Owner

sk22 commented Feb 3, 2023

okay, so - thanks a lot for your efforts! i just implemented that functionality myself, but adding some more functionality (button to expand a post instead of opening it) and making the text fade out at the bottom.

@sk22 sk22 closed this Feb 3, 2023
@FineFindus FineFindus deleted the feat/truncate-posts branch February 3, 2023 22:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Truncate long posts
2 participants