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

Feature/condensed post body #994

Merged
merged 4 commits into from
Jan 3, 2024

Conversation

micahmo
Copy link
Member

@micahmo micahmo commented Dec 18, 2023

Pull Request Description

This PR introduces a new view type for post bodies. Inspired by Relay, this allows the post body to be condensed, meaning that any link or image previews will remain as a small thumbnail on the side. Text posts are still fully expanded (and collapsible).

The use case here is that you've already viewed the image/link from the main feed, so now you want to jump right to the comments. Seeing the full image again is often unnecessary.

Note

I removed the duplicate "Show Cross Posts" setting from the General page, and made a new section on the Appearance > Posts page for post body settings.

P.S. If there is a better name than "Card View" for the default post body appearance, let me know!

Issue Being Fixed

Issue Number: N/A

Screenshots / Recordings

qemu-system-x86_64_mGcC5dkilz.mp4

Checklist

  • Did you update CHANGELOG.md?
  • Did you use localized strings where applicable?
  • Did you add semanticLabels where applicable for accessibility?

@hjiangsu
Copy link
Member

hjiangsu commented Dec 19, 2023

Thanks for this, this is really cool!

I just have one discussion about architecture for this. Since we're starting to add new views to the post body, I'm thinking this is a good chance to make the setting as adaptable as possible to any potential future post view types. Instead of using useCompactPostBodyView, what are your thoughts on changing it to something more flexible like postBodyViewType?

Then, we can store an enum value (e.g., PostBodyViewType.condensed, or PostBodyViewType.mediaPreview) and use that to build this new view. The benefit here is that we are no longer restricted to using a boolean, so we can add in more variations of views to the post body (e.g., default could be PostBodyViewType.expanded, a future one could be something like PostBodyViewType.gallery, etc.).

I know I used useCompactView for the feed (which admittedly was not the best way to do it in hindsight 😅) which is why I wanted to bring it up! This is also something I eventually want to do with the feed view types as well so that we can add in more types of views (e.g., gallery view, etc).

@micahmo
Copy link
Member Author

micahmo commented Dec 19, 2023

Instead of using useCompactPostBodyView, what are your thoughts on changing it to something more flexible like postBodyViewType?

Great idea! All done!

setting_refactor.mp4

@micahmo micahmo force-pushed the feature/condensed-post-body branch from 44ef10d to 6553d10 Compare December 19, 2023 20:14
@micahmo
Copy link
Member Author

micahmo commented Dec 19, 2023

Sorry I slightly misunderstood your comment and I used condensed and mediaPreview as the two options. I just pushed another change to make the options condensed and expanded!

image

Copy link
Member

@hjiangsu hjiangsu left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for changing it :D

I'll hold off on merging this until I get the 0.2.7 general release out

@hjiangsu hjiangsu merged commit 17d5e1d into thunder-app:develop Jan 3, 2024
1 check passed
@micahmo micahmo deleted the feature/condensed-post-body branch January 3, 2024 21:15
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.

2 participants