@@ -132,8 +132,15 @@ class FileBrowserViewModel(private val container: AppContainer) : ViewModel() {
132132 openJob?.cancel()
133133 if (query.isBlank()) {
134134 _state.update { it.copy(results = emptyList(), searching = false) }
135+ // Cancelling openJob above may have interrupted an in-flight directory load,
136+ // leaving loading=true stuck. Re-open the current directory so the listing
137+ // re-populates instead of showing a perpetual spinner after clearing search.
138+ open(_state.value.path)
135139 return
136140 }
141+ // The search view replaces the directory listing; clear loading so the spinner
142+ // from a cancelled open() doesn't persist into the search results view.
143+ _state.update { it.copy(loading = false) }
137144 val client = api ?: run {
138145 _state.update { it.copy(searching = false, error = container.string(R.string.not_connected)) }
139146 return