Skip to content

Refactor compact post view#1723

Merged
hjiangsu merged 2 commits intodevelopfrom
refactor/compact-post-view
Mar 6, 2025
Merged

Refactor compact post view#1723
hjiangsu merged 2 commits intodevelopfrom
refactor/compact-post-view

Conversation

@hjiangsu
Copy link
Copy Markdown
Member

@hjiangsu hjiangsu commented Mar 4, 2025

Pull Request Description

This PR refactors parts of the compact post view card to improve readability and potentially performance! Similar to the MediaView refactor, there may be follow-up PRs for additional changes. For now, the main updates include:

  • Renamed TypeBadge to MediaTypeBadge and applied some optimizations.
  • Extracted ThumbnailPreview into its own file (previously in post_card_view_compact.dart) and renamed it to CompactThumbnailPreview. Like MediaView, this widget no longer depends on PostViewMedia.
  • Introduced a new PostStatusIcon widget (and additionally, a new enum PostStatus) to handle post statuses (e.g., locked, hidden, deleted, removed) next to the post title. This can later be used in the card post view widget to reduce code duplication.
  • Introduced a new PostCardTitle widget which generates the entire post title (alongside the statuses using PostStatusIcon) - this can eventually be shared with all the different post card types (e.g., card, compact)

Issue Being Fixed

Issue Number: N/A

Screenshots / Recordings

Checklist

  • If a new package was added, did you ensure it uses an appropriate license and is actively maintained?
  • Did you use localized strings (and added appropriate descriptions) where applicable?
  • Did you add semanticLabels where applicable for accessibility?

@hjiangsu hjiangsu marked this pull request as ready for review March 5, 2025 16:04
@hjiangsu
Copy link
Copy Markdown
Member Author

hjiangsu commented Mar 6, 2025

I'll be merging this in first - do let me know if there's any issues with this @micahmo!

@hjiangsu hjiangsu merged commit b9bad07 into develop Mar 6, 2025
1 check passed
@hjiangsu hjiangsu deleted the refactor/compact-post-view branch March 6, 2025 15:46
@hjiangsu hjiangsu mentioned this pull request Mar 7, 2025
3 tasks
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.

1 participant