Skip to content

Show the uninstall button whenever there is something to uninstall - #12

Merged
rikkichy merged 1 commit into
rikkichy:mainfrom
Sharpienero:fix/uninstall-button-visibility
Sep 7, 2026
Merged

Show the uninstall button whenever there is something to uninstall#12
rikkichy merged 1 commit into
rikkichy:mainfrom
Sharpienero:fix/uninstall-button-visibility

Conversation

@Sharpienero

Copy link
Copy Markdown
Contributor

Came out of #9, where someone who installed with the one-liner could not work out how to remove it. Part of that is the installer leaving no checkout behind, but the app makes it harder than it needs to be.

_update_service_status ties the button's visibility to service.is_running(), so it is hidden in every state where the service is not up: never installed, installed but stopped, and failed to start. The middle two are exactly when someone wants to remove it, and from the UI there is no way to.

The service is also not the only thing run_uninstall() takes out. The udev rule, the WirePlumber rule and the mix sinks all outlive it, so they can be sitting on disk with the button hidden and nothing in the UI acknowledging they are there.

This gates on anything_installed() instead, the OR of the four things run_uninstall() acts on. It is deliberately not the inverse of needs_setup(), since a partial install both needs setup and has things left to remove.

Checked against a live install, including the case the old code got wrong:

service.is_running()      True
udev_installed()          False
service_installed()       True
wireplumber_installed()   False
mixes_installed()         True
anything_installed()      True

with service_installed() and udev_installed() forced False:
anything_installed()      True     (button still shown)

with all four forced False:
anything_installed()      False    (button hidden)

Only two call sites and neither is on a timer, so the extra checks cost nothing.

Second commit-worthy detail folded in: the confirmation dialog said "This will remove the audio service and USB permissions", which understates it. It now names the WirePlumber rule and the mix sinks as well.

Independent of #10 and #11.

Visibility was tied to service.is_running(), so the button is hidden in every
state where the service is not up: never installed, installed but stopped, and
failed to start. The last two are when removing it matters most, and a user in
that state has no way to do it from the app.

The service is also not the only thing run_uninstall() removes. The udev rule,
the WirePlumber rule and the mix sinks all outlive it, so they can be present
with the button hidden and nothing in the UI admitting they exist.

Gate on anything_installed() instead, which is the OR of the four things
run_uninstall() acts on. It is deliberately not the inverse of needs_setup():
a partial install both needs setup and has things left to remove.

Also list the WirePlumber rule and the mix sinks in the confirmation dialog,
which claimed only the service and USB permissions.
@rikkichy
rikkichy merged commit fac4896 into rikkichy:main Sep 7, 2026
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