Skip to content

Commit 163c970

Browse files
committed
Edit documentation and add tickets.
1 parent 504ee64 commit 163c970

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

firefox-ios/Client/Frontend/Library/Bookmarks/BookmarksViewController.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,18 +326,17 @@ final class BookmarksViewController: SiteTableViewController,
326326
/// table view data source immediately for responsiveness.
327327
private func deleteBookmarkNode(_ indexPath: IndexPath, bookmarkNode: FxBookmarkNode) {
328328
tableView.beginUpdates()
329-
// Remove the bookmark from local data arrays for optimistic UI update, then re-queries and reloads the table
330-
// because deleting a node while searching can alter the bookmarks tree at subfolder depths.
329+
// Removes the bookmark from local data arrays for optimistic UI update, then re-queries and reloads the table
330+
// because deleting a node while searching can alter the bookmarks tree at lower depths.
331331
viewModel.remove(bookmark: bookmarkNode, afterAsyncRemoval: { [weak self] in
332332
self?.tableView.reloadData()
333333
})
334334
tableView.deleteRows(at: [indexPath], with: .left)
335335
tableView.endUpdates()
336336

337-
// If the last bookmark in this folder was deleted and the user is searching, exit search.
337+
// If the last bookmark in this folder was deleted and the user is searching, exit search
338338
if viewModel.isCurrentFolderEmpty && state == .bookmarks(state: .search) {
339-
// Exits search and updates the empty state as needed
340-
exitSearchState()
339+
exitSearchState() // Note: Also calls updateEmptyState()
341340
} else {
342341
updateEmptyState(animated: false)
343342
}

firefox-ios/Client/Frontend/Library/Bookmarks/Legacy/BookmarksPanelViewModel.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ final class BookmarksPanelViewModel: BookmarksPanelViewModelProtocol {
115115
return
116116
}
117117

118-
// After reloading bookmarks, we should also reload our active search results as well, if applicable
119-
// That is because our bookmarks results are fetched recursively and backed by a separate data array
118+
// FXIOS-15296: After reloading bookmarks, we should also reload our active search results as well, if applicable.
119+
// This is because our bookmarks results are fetched recursively and backed by a separate data array.
120+
// FIXME: FXIOS-15309 This can be improved.
120121
let completionAfterSetup: @MainActor () -> Void = { [weak self] in
121122
guard let self else {
122123
completion()
@@ -436,11 +437,12 @@ final class BookmarksPanelViewModel: BookmarksPanelViewModelProtocol {
436437
if let self, self.isBookmarksSearchEnabled, self.isShowingSearchResults {
437438
// Reload the bookmarks tree for the current folder. If a bookmark was deleted via search, there is a chance
438439
// a subfolder becomes empty that was previously non-empty. We need to know whether folders in the current
439-
// folder contain bookmarks or not because we show an alert when deleting folders with non-empty contents.
440+
// folder contain bookmarks or not because we show an alert when deleting folders with non-empty contents
441+
// (see FXIOS-15296).
440442
//
441-
// Note: A race condition exists where the user might try to delete a folder before this refresh happens,
442-
// since we optimistically update the UI but can't synchronously update the bookmarks tree local copy (at
443-
// least not easily).
443+
// Note: A race condition exists where the user might try to delete a folder before this refresh completes,
444+
// since we optimistically update the UI but can't synchronously update the local bookmarks tree copy.
445+
// FIXME: FXIOS-15309
444446
self.reloadData {
445447
completion()
446448
}

0 commit comments

Comments
 (0)