knurling / ServiceStation

Service Station
39 stars 1 forks source link

Sidebar Icons are changed to Service Station app icon #40

Closed pkamb closed 3 years ago

pkamb commented 4 years ago

The 2020.5 update added support for Mounted Volumes and Network Drives: #2

I've since gotten a report that this update is mangling Finder sidebar icons for external drives. Finder is displaying an all-black version of the Service Station icon:

Screen Shot 2020-05-14 at 7 25 17 PM


Custom sidebar icons are a feature of macOS Finder Sync Extensions:

Adding a Sidebar Icon

You can provide a custom sidebar icon for any of the root folders your extension is monitoring. If the user drags one of these root folders into the Finder’s sidebar, your icon will be displayed instead of the default folder icon.

To provide a custom sidebar icon, add the icons to your containing app. For this to work, both your app’s icons and the sidebar icons must be included in an inconset. If you are using an asset catalog to manage your app’s icons, you will need to switch to an iconset.

https://developer.apple.com/library/archive/documentation/General/Conceptual/ExtensibilityPG/Finder.html

However, this feature was not intentionally implemented in Service Station.

The app uses asset catalogs, not iconsets, so according to Apple's description custom sidebar icons shouldn't work at all.

The main disk does not receive a custom icon because:

The sidebar icons you provide will replace the default folder icons in the Finder’s sidebar for any of the root folders that your extension is monitoring.

This icon does not replace the icon for any folders contained by your monitored folder. It also does not replace the icon for any system folders that you may be monitoring (for example, Documents, Desktop, Applications, and Downloads).

I'm currently looking for a way to disable custom sidebar icons entirely for these the external volume locations.

Sorry for the annoyance 😾

pkamb commented 4 years ago

I've opened an Apple DTS ticket for this issue; hopefully an Apple engineer can help with an explanation and/or workaround.

pkamb commented 4 years ago

Heard back from Apple Developer Technical Support:

Custom icons are shown if the correct image assets are included… but again, I am NOT including those assets in my app. I’m using at asset catalog, not an iconset.

How do I turn off these custom sidebar icons?

Having spent some time digging in the Finder’s code, I don’t think you can. I think what’s actually going on here is that because your app is “tied” to that directory, the object that actually gets added to the sidebar is actually a reference to your extension point, not a “normal” directory entry. When it resolves that icon, it first tries to resolve to one of the “sidebar” variants and, when that fails, it then uses the app icon.

As a side note on that:

My app uses asset catalogs, not iconsets, so according to Apple’s description custom sidebar icons shouldn’t work at all.

I believe the documentation there was basically describing how it “should” be configured, not how it “must” be configured. The reality is that the Finder never directly retrieves something like an app icon variant*, it goes through other API layers that do the actual retrieval. Since those API layers support the other mechanisms we’ve used in the past, the Finder ends up getting the icon that way.

*Ironically, the main reason for that is that we’ve had (and still do) a HUGE number of different mechanisms for this, so having the Finder handle it directly retrieve this sort of data would cause all sorts of compatibility problems.

Unfortunately, I just don’t really see any way around this, at least not directly…

On thing you might try is changing what you monitor here:

I’m setting the Finder Extension to monitor external volumes via the directoryURLs parameter:

[FIFinderSyncController defaultController].directoryURLs = // external volume urls

This works fine and the Finder Extension is working in the specified external volumes.

This is a longshot, but you might try creating a symbolic link to the target volumes and then monitoring that symbolic link instead of the direct volume path. I don’t know if it will work or not (it greatly depends on how the Finder processes the target URL), but it might be worth testing.

gingerbeardman commented 4 years ago

That writing seems so familiar to me. I used work at Apple and I believe I know the person that wrote that response!

Anyway! Let's see if the workaround is fruitful.

pkamb commented 4 years ago

Yes Kevin Elliott has been very helpful on the DTS ticket as well as today's WWDC lab.

I'm going to have an update out soon that will:

  1. Fix the Service Station icon so that the sidebar icon is at least dual-colored and not a black splotch.
  2. Provide an option to not use Service Station on external disks, which will return the icon to its original state (although Service Station will then not work on those disks).

I opened some bugs today after discussion with Apple engineers at WWCD. Will post those here soon.

pkamb commented 4 years ago

Version 2020.6 adds fixed template images for the sidebar icons.

This doesn't fix the root issue that the icons are displayed at all, but does at least fix the icon from the black splotch.

light

dark

This required changing the main app icon for all Targets from an Asset Catalog to an older .iconset format. Please let me know if you see any issues related to the app icon.

JML54 commented 4 years ago

That latest update has ruined those external drive icons and drove me nuts until I figured out after hours of work that service station was the culprit. This was not a problem before. Please fix this ASAP. Removing the application restored the correct icons to finder's sidebar. When I tried deleting and then reinstalling the application and not applying it to external drives, the problem persisted, plus the icon in the apps preferences for image files was the icon for PDF hours.

pkamb commented 4 years ago

@JML54 can you please post which macOS version you are running?

The latest update should not have enabled those sidebar icons... only fixed them from the buggy black splotch shown in the first post to the actual Service Station icon. Sidebar icons have been badged since the v2020.5 update that enabled Service Station for Mounted Volumes and Network Drives.

There will be an update soon with an option to cease working with External Drives entirely. (Removing them from Finder Locations will not help with this sidebar icon problem.)

Sorry for the problems here.

JML54 commented 4 years ago

10.15.5

The problem with external drives appeared with the new update to Service Station. It persisted even if I set the app to apply only to the laptop’s internal disk. I never had that splotch.

JML54 commented 4 years ago

Also, that updated version triggered the wrong icon for image files, using the PDF icon in the apps preferences. That showed up only in the newest version when I reinstalled the app.

JML54 commented 4 years ago

Here are two screen captures. Show the two problems with the new release, which I have said to only integrate with Finder for the laptop's internal drive.

Screen Shot 2020-07-03 at 11 18 39 AM

Sorry for the typos, I can't type with a fractured wrist and are using dictation software and missed the mistakes.

JML54 commented 4 years ago

Sorry for the typos, I can't type with a fractured wrist and are using dictation software and missed the mistakes.

pkamb commented 4 years ago

The just-released v2020.7 continues to use the new .iconset collection for the main Service Station app icon (rather than Asset Catalogs), but removes the sidebar_16x16.png template images from that iconset.

In my testing this technique appears to not badge external drives in the Finder sidebar.

Please update to v2020.7 and either log out or restart to make sure everything has updated.

Please let me know if you continue to see:

FatherOfAlways commented 4 years ago

I'm seeing folder icons instead of removable drive icons in sidebar now: CleanShot 2020-07-06 at 12 42 38

I'm running SS 2020.7 on Catalina 10.15.5 (19F101). Will provide more info if necessary.

JML54 commented 4 years ago

Same issue here, same OS and SS #: now the external drives are shown with folder icons. And the Image icon is still a PDF icon.

gilby101 commented 4 years ago

Any progress with this? The folder icons in the sidebar for all external volumes is a nuisance/annoyance.

HaikuOezu commented 3 years ago

Having the same issue as @FatherOfAlways except mine are regular file icons, not folders

image

The issue even persisted after updating to Big Sur, uninstalling Service Station doesn't help

pkamb commented 3 years ago

Sorry for the delay on this.

The upcoming version of Service Station will stop observing any external volumes by default, to work around the macOS bug/feature of showing badged sidebar icons for those locations.

This means that you will not get Service Station menus when right clicking in any mounted volumes or network drives, unless you add each volume to the Finder Locations list. (You already needed to add them to Finder Locations to actually do most actions, after right-clicking).

But if you add the volume to the Finder Locations list, the Finder Extension will begin observing that volume. And macOS will in turn badge the sidebar icon. The only question is if the icon should be:

So this is not a very satisfying solution if you plan on using Service Station with external volumes but want to keep the default sidbar icons. But this will at least fix the sidebar icons for those who don't want to use Service Station with every external volume.

This is going through Apple review - I'll update the ticket when released.

aonez commented 3 years ago

@pkamb I have the same issue with my app's extension (thanks to @gingerbeardman for pointing it). If you need any help let me know. At least this only affects Big Sur and is in early bug fixing stage yet so hopefully this will be solved :)

HaikuOezu commented 3 years ago

Having the same issue as @FatherOfAlways except mine are regular file icons, not folders

image

The issue even persisted after updating to Big Sur, uninstalling Service Station doesn't help

For what it's worth I was able to fix my sidebar by nuking the icon cache so it doesn't seem like the issue was related to Service Station after all, it just caused it to trigger but it wasn't effectively messing up my drive icons.

pkamb commented 3 years ago

Here's a screenshot showing the new behavior in action.

Volume USB Drive has been added as a Service Station Finder Location. Volume USB has not.

The volume that has been added receives the custom icon (in this case, a buggy Big Sur unknown file icon). The volume that has not been added to Service Station has its default icon (but cannot be used with Service Station).

Screen Shot 2020-11-21 at 1 53 51 PM

This will be released via the Mac App Store soon.

pkamb commented 3 years ago

This has been fixed as well as I can in v2020.8, now available on the Mac App Store. Behavior is described in comments above.

The Big Sur wrong icon should be discussed here: #51

Closing this ticket, but please leave a comment if there are any continued issues with this. Thanks!