Repository navigation
fix(ios): the chat list no longer jumps right after launch - #61
Merged
Merged
Conversation
Two header rows appeared about a second after the app started and pushed every chat down: - Stories: the feed comes from the server after login, so the stories row was inserted above search, shifted the list by its height for a frame and snapped back when hideStoriesIfAtTop hid it 60 ms later. The row now takes its hidden place in the same layout pass when the list is at the very top (ChatListScroll.rowLaidOut). - Folders: the core keeps server folders in memory only and learns them from LOGIN, so the folder bar was inserted under search after login. The last server folders are now kept on the device per account (FolderDisplayStore.lastFolders) and shown from the first frame; the ones from the server replace them. ChatFolder and its rules are Codable for that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MzJkZ5fMPvUtKq76szzXkB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Проблема
При запуске экран секунду дёргается, и чаты прыгают. Примерно через секунду после старта над списком появлялись две строки шапки, и каждая сдвигала все чаты вниз.
Что изменилось
Строка историй (
ChatListScroll.rowLaidOut)Истории на устройстве не хранятся: лента приходит с сервера после входа. Её строка вставлялась над поиском, на кадр сдвигала список на свою высоту, а через 60 мс
hideStoriesIfAtTopпрятал её, и список прыгал обратно.Теперь, если список стоит у самого верха и палец его не держит, строка историй сразу встаёт спрятанной над поиском в том же проходе раскладки. Метка в строке (
ChatListProbe) сообщает о своём размере изlayoutSubviews. Строка ложится так один раз при каждом своём появлении. ПрежнийhideStoriesIfAtTopостаётся запасным путём.Полоса папок (
FolderDisplayStore.lastFolders)Ядро держит папки сервера только в памяти и узнаёт их из
LOGIN. Поэтому полоса папок вставлялась под поиском уже после входа.Теперь последние папки сервера хранятся на устройстве, отдельно для каждого аккаунта (
maxly.folders.last.<id>). Полоса стоит на месте с первого кадра, папки с сервера заменяют сохранённые и сразу запоминаются. Для этогоChatFolder, его фильтр иChatFolderRulesсталиCodable. Одинаковые папки из ядра список не пересобирают.Тесты
ChatListFeatureTests.savedFoldersBeforeServer: сохранённые папки видны до ответа сервера, ответ их заменяет и запоминается, пустой ответ убирает полосу.FolderDisplayStoreTests: папки с правилами сервера сохраняются и читаются, у каждого аккаунта свои, без аккаунта не сохраняются.Проверка
Сборка и тесты не запускались: в среде, где делалась правка, нет Xcode. Нужно посмотреть на устройстве:
Generated by Claude Code