Commit 3f71b0d
committed
fix(conversations): don't re-restore the scroll position on every resume
Returning from a chat to the conversation list made the list visibly
jump shortly after rendering. The saved scroll position was re-armed on
every resume and restored on the next room list emission - which used
to be an immediate local snapshot, making the restore an invisible
no-op. With the list derived reactively from the database, the state
current at resume never re-emits, so the first post-resume emission is
the server sync response seconds later: scrollToItem then re-anchored
an already rendered (and possibly slightly changed) list under the
user's eyes.
Restore the position only once per activity lifetime: after a
recreation the LazyListState is genuinely lost and the first emission -
which the reactive flow now delivers immediately on subscription -
restores it, while a plain resume keeps the retained state's position
naturally, without any late scrollToItem.
Assisted-by: Claude Code:claude-fable-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>1 parent 3ae3b1b commit 3f71b0d
1 file changed
Lines changed: 1 addition & 2 deletions
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
389 | 388 | | |
390 | 389 | | |
391 | 390 | | |
| |||
0 commit comments