Repository navigation
Start at login and open the panel on first launch (1.4.0) - #23
Merged
Merged
Conversation
A DMG install had no way back from a restart. TokenFlow is an LSUIElement app: no Dock icon, no window, and nothing registered it as a login item, so after a reboot there was no sign it had ever been installed. The watcher kept collecting — its LaunchAgent sets RunAtLoad — and only the menu bar went missing, which is the confusing half. SMAppService.mainApp.register() now runs once, guarded three ways. The bundle must sit in an Applications folder: a first launch straight off the mounted DMG is App-Translocated to a temporary read-only path, and a login item aimed there breaks on eject, which is worse than not registering. The attempt flag is written inside that guard, so open-from-DMG-then-drag still registers next launch. Only .notRegistered is acted on, because .requiresApproval means the user turned it off. Failure is silent — starting at login is a convenience, not something to greet a new user with an error about. The panel also opens itself once per machine. Double-clicking an accessory app looks like nothing happened; the only sign is two characters at the right end of the menu bar. The flag is written when the panel actually shows, not when it is attempted, so a menu bar with no room for the status item gets it next launch instead of never. Neither behaviour can be exercised on a Mac without Xcode, so the app-bundle suite now reads otool -L off the built binary and fails if ServiceManagement.framework is not linked. Also: docs/getting-started.md said the app "builds and launches everything it needs", which reads as automatic and never was. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A DMG install had no way back from a restart, and no way to find itself on first launch.
TokenFlow is an
LSUIElementapp — no Dock icon, no window. Nothing registered it as a login item, so after a reboot there was no sign it had ever been installed. The watcher kept collecting (its LaunchAgent setsRunAtLoad); only the menu bar went missing, which is the confusing half.And double-clicking it the first time looks like nothing happened. The only sign is two characters —
TF— at the right end of the menu bar, which nobody has a reason to look for.What changed
Launch at login.
SMAppService.mainApp.register(), once, guarded three ways:/Applicationsor~/Applications. A first launch straight off the mounted DMG is App-Translocated to a temporary read-only path, and a login item aimed there breaks the moment the image is ejected — worse than not registering. The attempt flag is written inside that guard, so open-from-DMG-then-drag still registers on the next launch..notRegisteredis acted on..requiresApprovalmeans the user turned it off; re-registering would fight them every launch.Panel opens itself once. Written when the panel actually shows rather than when it is attempted, so a menu bar with no room for the status item gets it next launch instead of never.
Docs.
docs/getting-started.mdsaid the app "builds and launches everything it needs" — that reads as automatic and never was. README and getting-started now describe the real first launch.Verification
Neither behaviour can be exercised on a Mac without Xcode, so this leans on CI:
test/bundle.test.jsnow readsotool -Loff the built binary and fails ifServiceManagement.frameworkis not linked.macos-latestjobs are the real gate — that is wherebundle.test.jscompilesmain.swift.swiftc -parseclean, theSMAppServiceblock type-checks and links in isolation,npm run lintclean, 841 tests / 838 pass / 3 skipped (the app-bundle suite skips without Xcode).Not verified by me:
register()actually succeeding at runtime under ad-hoc signing. That needs a real install.🤖 Generated with Claude Code