mlem
mlem copied to clipboard
[2.x] PostWrapper
Currently, we use a CommentWrapper defined in Mlem that wraps Comment2 and conforms to Comment2Providing. The class stores Mlem-specific information about the comment, such as its collapse state.
At some we could consider making a PostWrapper for posts. Some examples of information we might want to store:
- Whether the user has tapped to un-blur an NSFW image. Currently, if you tap to un-blur and then open the post in expanded view, the image is blurred again in the expanded view. This isn't ideal UX. #1153.
- Translation text (#928). If the user translates a post, we'd want to remember that information when they open the expanded post rather than re-translating.
- Markdown node trees (maybe)? Currently we're parsing as the user is scrolling. Parsing ahead of time and storing the tree in
PostWrappermight be beneficial performance-wise. - This may also be needed for multi-accounts. We could conform
PostWrappertoPost2Providing, and it's computed properties (votes,savedetc) could choose a value from one of several storedPost2instances.