File tree Expand file tree Collapse file tree
test/features/channels/channel_detail_page_test Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,14 +41,15 @@ class InitialThreadTailSettle {
4141 if (_isComplete) return ;
4242
4343 final generation = ++ _generation;
44- if (targetIndex == null ) {
45- _isComplete = true ;
46- onSettled ();
47- return ;
48- }
49-
5044 WidgetsBinding .instance.addPostFrameCallback ((_) {
5145 if (! context.mounted || generation != _generation) return ;
46+ // Report readiness after build, including empty threads. A synchronous
47+ // hook update can otherwise leave the just-built visibility value stale.
48+ if (targetIndex == null ) {
49+ _isComplete = true ;
50+ onSettled ();
51+ return ;
52+ }
5253
5354 // Let events received during hydration rebuild the list before committing
5455 // the target. That rebuild schedules a new generation at the current tail.
Original file line number Diff line number Diff line change @@ -284,14 +284,11 @@ class ThreadDetailPage extends HookConsumerWidget {
284284 ? settledImeLift
285285 : 0 );
286286 final navigationBottomInset = composerDockHeight.value + settledImeLift;
287- // Keep the route snapshot usable while the relay query is pending. Once
288- // authoritative replies arrive, suppress only the frame(s) used to place
289- // the hydrated target. An ordinary empty thread has no target to place:
290- // keep its original message visible across hydration.
287+ // Keep the route snapshot usable during loading. While the hydrated list
288+ // settles, the message-list view keeps the original message visible and
289+ // reveals the positioned list in one frame, for empty and populated threads.
291290 final threadViewportVisible =
292- ! relayRepliesAvailable ||
293- (initialMessageId == null && replies.isEmpty) ||
294- initialViewportReady.value;
291+ ! relayRepliesAvailable || initialViewportReady.value;
295292
296293 // Item 0 is the thread head; reply `i` lives at `i + 1`.
297294 const headIndex = 0 ;
You can’t perform that action at this time.
0 commit comments