Skip to content

Update UI my places favorite i os#5469

Open
Vladyslav-lys wants to merge 54 commits into
masterfrom
update_ui_my_places_favorite_iOS
Open

Update UI my places favorite i os#5469
Vladyslav-lys wants to merge 54 commits into
masterfrom
update_ui_my_places_favorite_iOS

Conversation

@Vladyslav-lys

Copy link
Copy Markdown
Contributor

No description provided.

DmitrySvetlichny and others added 30 commits June 4, 2026 14:20
@Vladyslav-lys Vladyslav-lys requested a review from tigrim June 15, 2026 14:59
@Vladyslav-lys Vladyslav-lys linked an issue Jun 15, 2026 that may be closed by this pull request
128 tasks
import UniformTypeIdentifiers

extension FavoriteListViewController {
func areAllSelectableItemsSelected() -> Bool {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider whether SelectionManager can be used here

self.groupController = groupController
favoriteItemsToMove = favoriteItems
groupController.delegate = self
let modalNavigationController = UINavigationController(rootViewController: groupController)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without temp let

addToTrackGroupName = groupName
addToTrackFavoriteItems = nil
viewController.delegate = self
let modalNavigationController = UINavigationController(rootViewController: viewController)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

up

addToTrackGroupName = nil
viewController.delegate = self
let modalNavigationController = UINavigationController(rootViewController: viewController)
navigationController.present(modalNavigationController, animated: true)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

up

return UIMenu(title: "", children: [addFolderSection, importSection])
}

func setEdit(_ isEdit: Bool) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setEditing

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isEditing

format.scale = image.scale
format.opaque = false
let renderer = UIGraphicsImageRenderer(size: image.size, format: format)
return renderer.image { context in

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1)Are we sure the rotated image won't be clipped? The renderer size remains unchanged after rotation.
2) Move to extension

}

var snapshot = Snapshot()
if allFolders.isEmpty {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if allFolders.isEmpty {
applyEmptyStateSnapshot(animatingDifferences: animatingDifferences)
return
}

//

import CoreLocation
import UniformTypeIdentifiers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

}

struct FavoriteFolderRow: Hashable, FavoriteSortableFolder {
static let subtitleDateFormatter: DateFormatter = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private?

struct FavoriteFolderRow: Hashable, FavoriteSortableFolder {
static let subtitleDateFormatter: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "d MMM"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using setLocalizedDateFormatFromTemplate("dMMM") instead of a hardcoded date format to better support different locales

@tigrim tigrim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Folder actions omit nested favorites

  • FavoriteListViewController+ContextMenu.swift:52-67, OAFavoritesBridgeHelper.mm:599, 662, 714, 798
    If a folder has direct points, “Add to markers/track/navigation” processes only those points and silently ignores its subfolders. Bulk actions have the same problem.
    Resolve folder bridge items recursively inside the helper and deduplicate points there.

Distance updates rebuild expensive snapshots every 300 ms

  • FavoriteListViewController.swift:161-189, OAFavoritesBridgeHelper.mm:44-58
    Each heading/location update recreates bridge objects, icons, filesystem attributes, subtree counts, and performs repeated nested scans. Large favorite collections will cause UI stalls and battery usage.
    Cache structural metadata and update only visible point distance/direction cells.

Current folder becomes stale after being renamed

  • FavoriteListViewController+Delegates.swift:196-203, FavoriteListViewController+DataSource.swift:225
    ScreenMode.folder retains the old bridge item/group name. Renaming from the appearance editor then reloads the deleted path, producing an empty screen and stale title.
    Store a mutable group identifier or replace/pop the controller after rename.

Import notification may mutate UIKit off-main

  • FavoriteListViewController+Actions.swift:232
    favoriteDataDidChange() calls diffable data-source APIs without enforcing the main thread.
    Dispatch to the main queue, as already done in productPurchased()

return YES;
}

+ (void)renameFavoriteGroup:(NSString *)groupName newName:(NSString *)newName

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename/move can silently merge folders and corrupt

  • hierarchyFavoriteListViewController+Actions.swift:93, OAFavoritesBridgeHelper.mm:192, 983, OAFavoritesHelper.mm:540
  • Duplicate destination names are not rejected. updateGroup silently merges points into an existing group. Names containing / can also restructure the hierarchy unexpectedly.
  • Validate every destination path before mutation, reject /, and require explicit confirmation for merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Favorites UI – My Places

3 participants