Skip to content

Modernize Xclean menu bar behavior - #6

Open
luisrh01 wants to merge 1 commit into
macmade:mainfrom
luisrh01:luis/modernize-xclean-upstream
Open

Modernize Xclean menu bar behavior#6
luisrh01 wants to merge 1 commit into
macmade:mainfrom
luisrh01:luis/modernize-xclean-upstream

Conversation

@luisrh01

@luisrh01 luisrh01 commented Aug 4, 2026

Copy link
Copy Markdown

Summary

  • Update Xclean build settings for a modern Swift toolchain.
  • Modernize derived data icon lookup to use UniformTypeIdentifiers and NSWorkspace icon APIs.
  • Keep the menu bar app alive after auxiliary windows close.
  • Fix the status item popover so clicking the menu bar icon opens and keeps the view visible instead of immediately closing it.
  • Document the changes in CHANGELOG.md with attribution to Luis Hernandez luisrh@mac.com.

Scope

This PR intentionally does not change .gitmodules or Submodules/GitHubUpdates. The earlier GitHubUpdates skip-option work is excluded so this can merge cleanly into the original Xclean repository.

Validation

  • Attempted to build in Xcode.
  • Build is currently blocked by pre-existing upstream project environment issues outside this PR scope: missing Apple Developer Team/certificate for Team 326Y53CJMD, and the untouched GitHubUpdates submodule target still declares macOS deployment target 10.12, which is unsupported by the installed Xcode version.

Author: Luis Hernandez luisrh@mac.com

@macmade macmade left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for your interest in the project.
Unfortunately, after reviewing the changes, I don't really think this PR adds anything useful to the project, especially considering the number of issues it introduces.

Comment thread CHANGELOG.md

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please do not include a manual changelog file just for your own changes in a PR.
Changes should be described in commits - that's GIT's job.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please do not alter or duplicate build settings without a valid reason.
They are already set via xcconfig files.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I don't think ignoring OS_ACTIVITY_MODE is useful or needed.

self.name = FileManager.default.displayName( atPath: workspace )
self.size = 0
self.icon = NSWorkspace.shared.icon( forFileType: ( workspace as NSString ).pathExtension )
self.icon = Self.icon( forFilenameExtension: ( workspace as NSString ).pathExtension )

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This results in broken icons for project files.
Please test your changes.

self.popover?.contentViewController = controller
self.popover?.behavior = .applicationDefined
let popover = NSPopover()
popover.contentViewController = controller

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please keep the alignment consistent.

return
}

if let imageURL = Bundle.main.url( forResource: "StatusIconTemplate", withExtension: "pdf" ),

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Why are you using Bundle instead of NSImage here?

if let imageURL = Bundle.main.url( forResource: "StatusIconTemplate", withExtension: "pdf" ),
let image = NSImage( contentsOf: imageURL )
{
image.isTemplate = true

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This shouldn't be needed.

image.isTemplate = true
image.size = NSSize( width: 18, height: 18 )
button.image = image
button.title = ""

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Also not needed.

}
else
{
button.image = nil

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Not needed

else
{
button.image = nil
button.title = "X"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

If you really want an alternative, consider using SF Symbols instead.

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.

2 participants