Add user-controlled app lifecycle and login launch - #52
Conversation
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 70fbfe5de7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 191182507a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /usr/bin/plutil -insert RunAtLoad -bool true "$PLIST" | ||
| /usr/bin/plutil -insert KeepAlive -bool true "$PLIST" | ||
| /usr/bin/plutil -insert RunAtLoad -bool "$OPEN_AT_LOGIN" "$PLIST" | ||
| /usr/bin/plutil -insert KeepAlive -json '{"SuccessfulExit":false}' "$PLIST" |
There was a problem hiding this comment.
Stop KeepAlive from overriding the login preference
When Open at Login is disabled, both generated plists still set KeepAlive.SuccessfulExit to false here and in src/agent_touchbar/cli.py. The launchd.plist manual states that SuccessfulExit implies RunAtLoad, so launchd starts these jobs at sign-in despite the explicitly false RunAtLoad; use a crash-restart configuration that does not implicitly launch the jobs, or remove this condition when login launch is disabled.
Useful? React with 👍 / 👎.
| fi | ||
| rm -f "$RENDERER_PLIST" | ||
| rm -rf "$RENDERER_APP" | ||
| rm -rf "$RENDERER_APP" "$LEGACY_RENDERER_APP" |
There was a problem hiding this comment.
Terminate manually launched renderers during uninstall
When the renderer was opened from Finder or Spotlight while its LaunchAgent was unloaded, it is an independent process: launchctl bootout only removes the named service from its domain, and deleting the app bundle here does not terminate that process. Consequently uninstall.sh can report success while the menu bar item and Touch Bar integration continue running from the deleted executable until the user quits or logs out; explicitly terminate any surviving renderer before removing the bundle.
Useful? React with 👍 / 👎.
| VENV="$INSTALL_ROOT/venv" | ||
| VENV_BACKUP="$INSTALL_ROOT/venv.rollback" | ||
| APP_PATH="$INSTALL_ROOT/Agent Touch Bar.app" | ||
| APP_PATH="${AGENT_TOUCHBAR_APP_PATH:-$HOME/Applications/Agent Touch Bar.app}" |
There was a problem hiding this comment.
Restore legacy rollback apps to their original path
If an update using the previous installer was interrupted after moving the app into Agent Touch Bar.app.rollback, this version's startup recovery treats that backup as belonging to the new APP_PATH and moves it into ~/Applications. The concurrently restored renderer plist still points to the old app under INSTALL_ROOT, so if the retry subsequently fails and invokes rollback_install, the supposedly restored LaunchAgent references a missing executable and the previous installation cannot restart. Distinguish legacy-path backups during recovery or rewrite the restored plist consistently.
Useful? React with 👍 / 👎.
TL;DR
Adds a complete user-controlled lifecycle for Agent Touch Bar. Users can now hide or quit it, relaunch it from
~/Applications, and control login launch without upgrades resetting their preference.Closes #51.
Changes
~/Applications/Agent Touch Bar.app.Verification
swift test --package-path nativePYTHONPATH=src python3 -m unittest discover -s tests -vpyright src testspython3 -m compileall -q src testsbash -n native/build-app.sh scripts/install.sh scripts/install-renderer.sh scripts/uninstall.sh skills/setup-agent-touchbar/scripts/check.sh./native/build-app.sh <temporary app path>git diff --checkRemaining device verification
After merge, install on the target Mac and verify menu controls, Touch Bar dismissal, Quit process cleanup, Spotlight/Finder relaunch, and LaunchAgent preference readback.