From a120dfa6c59ae42253bda3d1d9ace981991a5066 Mon Sep 17 00:00:00 2001 From: Wukong Sun Date: Wed, 24 Jun 2026 17:28:12 +0800 Subject: [PATCH] fix: mf-6769 keep timeline post stable on show more expand --- .../site-adaptors/twitter.com/collecting/post.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/mask/content-script/site-adaptors/twitter.com/collecting/post.ts b/packages/mask/content-script/site-adaptors/twitter.com/collecting/post.ts index 10bd1d7c6cd..274d879a371 100644 --- a/packages/mask/content-script/site-adaptors/twitter.com/collecting/post.ts +++ b/packages/mask/content-script/site-adaptors/twitter.com/collecting/post.ts @@ -129,7 +129,11 @@ function registerPostCollectorInner( // To distinguish tweet nodes between timeline and detail page const isDetailPage = isDetailTweet(tweetNode) const isCollapsed = !!tweetNode.querySelector('[data-testid="tweet-text-show-more-link"]') - return `${isDetailPage ? 'detail' : 'normal'}/${parentTweetId}/${tweetId}/collapse:${isCollapsed}` + // Keep the collapse suffix only on the detail page (MF-5908): changing the key forces + // Mask content to re-inject when a collapsed tweet expands there. On the timeline the key + // change unmounts+remounts the whole post card on expand (flicker), so the post stays stable + // and onNodeMutation updates its content in place (MF-6769). + return `${isDetailPage ? 'detail' : 'normal'}/${parentTweetId}/${tweetId}${isDetailPage ? `/collapse:${isCollapsed}` : ''}` }) .startWatch(250, cancel) }