diff --git a/src/components/explore/ExploreReelsView.tsx b/src/components/explore/ExploreReelsView.tsx index 74b6c87..7d4155d 100644 --- a/src/components/explore/ExploreReelsView.tsx +++ b/src/components/explore/ExploreReelsView.tsx @@ -406,6 +406,13 @@ export default function ExploreReelsView({ { + if (!scrollRef.current || index + 1 >= items.length) return; + scrollRef.current.scrollTo({ + top: (index + 1) * getReelsStepHeight(scrollRef.current), + behavior: "smooth", + }); + }} /> ) : ( { + if (!scrollRef.current || index + 1 >= displayPosts.length) return; + scrollRef.current.scrollTo({ + top: (index + 1) * getReelsStepHeight(scrollRef.current), + behavior: "smooth", + }); + }} /> ); diff --git a/src/components/posts/ReelsPostCard.tsx b/src/components/posts/ReelsPostCard.tsx index babeae9..487c2c9 100644 --- a/src/components/posts/ReelsPostCard.tsx +++ b/src/components/posts/ReelsPostCard.tsx @@ -68,6 +68,8 @@ interface ReelsPostCardProps { isActive?: boolean; postPage?: boolean; preloadPriority?: VideoPreloadPriority; + /** وقتی پیمایش خودکار فعاله و این ریلز (فعال) به انتهای ویدیو رسید */ + onRequestNext?: () => void; } export default function ReelsPostCard({ @@ -75,6 +77,7 @@ export default function ReelsPostCard({ isActive = false, postPage = false, preloadPriority = "idle", + onRequestNext, }: ReelsPostCardProps) { const { t } = useTranslation("common"); const { @@ -146,6 +149,11 @@ export default function ReelsPostCard({ const social = usePostSocialState(postData); const requireAuth = useRequireAuth(); const chromeHidden = exploreUi ? exploreUi.chromeHidden : uiHidden; + // اطلاعات کاربر/کپشن هم باید با دکمه‌ی جمع‌کردن آیکون‌ها مخفی بشن، نه فقط با + // hold روی تصویر (chromeHidden) — قبلاً این بلوک فقط chromeHidden رو چک می‌کرد + const actionsExpanded = exploreUi ? exploreUi.actionsExpanded : true; + const autoScrollEnabled = exploreUi ? exploreUi.autoScrollEnabled : false; + const playbackSpeed = exploreUi ? exploreUi.playbackSpeed : 1; const allowSave = postData.author_allow_save !== false; const useCommentsSheet = !postPage; @@ -155,7 +163,8 @@ export default function ReelsPostCard({ videoDuration > LONG_VIDEO_SEC && isActive && !chromeHidden && - !anyCommentsOpen; + !anyCommentsOpen && + actionsExpanded; const mediaFiles = files?.map((file) => ({ @@ -315,6 +324,12 @@ export default function ReelsPostCard({ setVideoPaused(false); }, [videoSrc]); + //