Skip to content

fix(webui): report the tray as found when it runs from the sidecar - #38

Merged
lukasMega merged 1 commit into
mainfrom
fix/tray-requirement-check
Aug 22, 2026
Merged

fix(webui): report the tray as found when it runs from the sidecar#38
lukasMega merged 1 commit into
mainfrom
fix/tray-requirement-check

Conversation

@lukasMega

Copy link
Copy Markdown
Owner

Problem

Reported on a downloaded v0.9.0 release: tray icon visible and working, but http://localhost:3000/requirements says

✗  tray  Not found (DECKBRIDGE_TRAY_BIN not set)

app.ts resolves the tray from $DECKBRIDGE_TRAY_BIN or a deckbridge-tray sidecar next to the executable — the sidecar is how every packaged release ships it. The requirements check only ever looked at the env var, which is unset in a packaged run. Pure false negative; pre-existing, not related to the slim-runtime change.

Fix

Extract the resolution into resolveTrayBin() in tray.ts; app.ts and requirements.ts both call it, so the spawn path and the reported path can't diverge again.

Two incidental improvements in the shared version: the sidecar probe appends .exe on Windows, and it uses parentDir() (handles \ as well as /) instead of lastIndexOf('/') — the old inline probe would never have found the sidecar on Windows.

app.ts's "no tray" log line was also misleading (DECKBRIDGE_TRAY_BIN not set even when the real problem was a missing sidecar); it now names both.

Verified

Compiled binary + deckbridge-tray staged side by side, run with DECKBRIDGE_TRAY_BIN unset:

  • sidecar present{"name":"tray","ok":true,"message":"Found: /private/tmp/pkgtest/deckbridge-tray"}, tray spawns.
  • sidecar absentok:false, "Not found (no deckbridge-tray next to the executable, DECKBRIDGE_TRAY_BIN not set)".

Plus a regression test in ts/test/tray.test.ts for both branches of the resolver (15 passed). mise run ci-checks green.

/requirements read $DECKBRIDGE_TRAY_BIN only, but app.ts resolves the tray from
that env var *or* a `deckbridge-tray` sidecar next to the executable — which is
how every packaged release ships it. Result: a downloaded release showed a
visible, working tray icon while the page said "Not found (DECKBRIDGE_TRAY_BIN
not set)".

Extracts that resolution into resolveTrayBin() in tray.ts and calls it from both
app.ts and the requirements check, so the two can't disagree again. The sidecar
probe also picks up .exe on Windows and uses parentDir(), which handles
backslash-separated exePaths — the old inline probe did neither.

Adds a regression test for both branches of the resolver.
@lukasMega
lukasMega merged commit bc549d6 into main Aug 22, 2026
12 checks passed
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.

1 participant