Skip to content

Commit 2b41855

Browse files
committed
Revert "fix: prevent false-positive item relocation when control items first appear"
This reverts commit 7d99cdc.
1 parent cb79278 commit 2b41855

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Thaw/MenuBar/MenuBarItems/MenuBarItemManager.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2688,16 +2688,12 @@ extension MenuBarItemManager {
26882688
savedSectionForIdentifier[item.uniqueIdentifier] != nil
26892689
guard !hasSavedSection else { return false }
26902690

2691-
// Only move items that are new to this section (window ID not seen before).
2692-
// Don't fall back to identity check when previousIDs is empty - that causes
2693-
// false positives where items already in visible section get moved.
2694-
let isNewID = !previousIDs.isEmpty && !previousIDs.contains(item.windowID)
2695-
guard isNewID else { return false }
2696-
2691+
let isNewIdentity = !knownItemIdentifiers.contains(identifier)
2692+
let isNewID = previousIDs.isEmpty ? isNewIdentity : !previousIDs.contains(item.windowID)
26972693
let notPlacedHidden = !hiddenTags.contains(item.tag) && !alwaysHiddenTags.contains(item.tag)
26982694
let bundle = bundleID(for: item)
26992695
let notPinnedHidden = bundle.map { !pinnedHiddenBundleIDs.contains($0) && !pinnedAlwaysHiddenBundleIDs.contains($0) } ?? true
2700-
return notPlacedHidden && notPinnedHidden
2696+
return notPlacedHidden && notPinnedHidden && (isNewID || isNewIdentity)
27012697
}
27022698
guard let candidate else {
27032699
if !leftmostItems.isEmpty && savedSectionForIdentifier.isEmpty == false {

0 commit comments

Comments
 (0)