fix(ios): stop empty-state flash during data browser reload#1223
Merged
Conversation
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.
Summary
Two related iOS data browser bugs reported via TestFlight (iPhone 17 Pro / iOS 26.4.2) and reproduced locally:
Root cause
DataBrowserViewModel.load()only setisLoading = truewhenlegacyRows.isEmpty || isInitial. The downstreamloadPage()then unconditionally callslegacyRows.removeAll()before streaming begins. For any reload that started with rows on screen (i.e., sort, filter, search, clear-search),legacyRowsbecame empty mid-flight while both loading flags read false. The view'sif rows.isEmptybranch fired in that window and rendered the "No Data" empty state, which then got replaced when rows arrived.navigatePage()setisPageLoadingmanually around itsload()call, but the other entry points (applySort,applyFilters,clearFilters,applySearch,clearSearch) did not.Fix
load()now owns both loading flags. IfisInitial || legacyRows.isEmptyit setsisLoading = true(full-screen spinner); otherwise it setsisPageLoading = true(in-list overlay that keeps the existing rows visible until they get replaced). Both flags reset on every exit path.navigatePage()no longer touchesisPageLoadingsinceload()handles it.DataBrowserView.contentgets one new branch:rows.isEmpty && isPageLoadingshows aProgressViewinstead of falling through to the empty state.!viewModel.isPageLoadingso it stops flickering when an interaction clears rows.Test plan
ContentUnavailableView.searchstill showsDataBrowserViewModelTests/clearSearchReplacesRowsCleanlypasses