Two faults in the uninstall hook, found by running it for the first time:
- NSIS has no doubled-quote escape, so the '' written for PowerShell's
single quotes ended the NSIS string at the first one. The plugin got a
truncated command PowerShell could not parse, and the hook silently
did nothing: uninstalling the desktop app left the tray, its Run value
and its marker behind. Each inner quote is now the NSIS escape.
- An upgrade runs the previous version's uninstaller first, with the
updated flag, and the hook removed the tray there too, so every desktop
upgrade uninstalled the tray and reinstalled it with an elevation
prompt. The hook now leaves the tray alone during an upgrade.
The parity test builds the payload twice over the same warm cache and
expects the two to match. Since liveSessions landed, each session
carries idleSeconds, whole seconds since its last activity, so two
builds that straddle a second boundary differ by one and the test
fails at random. Seen on the macOS runner. stableShape now zeroes it
the way it already blanks the generated stamp.
The Store package is signed at submission and updates itself. The tray
.msi under windows-v* and the desktop setup exe are a developer preview:
unsigned, SmartScreen warns on first run, and they do not update
themselves; the tray app reports a newer version and links to it. Said
in the README, the distribution notes, the tray development notes and
the release body.
Outside a Store package the tray app no longer runs `npm install -g
codeburn@latest --force` and `codeburn menubar --force` on one click.
The MSI is unsigned and its checksum is published in the same release,
so an automated install has nothing to verify; a manual install at
least passes through SmartScreen. The check still runs and reports a
newer version, the badge and About now open the windows-v* release
page, and the manual command is shown as copyable text. Inside a Store
package the checker stands down as before. One-click install returns
once the MSI is signed and the installer verifies the signature.
companionDataDir only honoured LOCALAPPDATA when it began with a drive
letter, so the POSIX sandbox path the test hands it fell through to the
home fallback on Linux and macOS. It now takes any absolute path in the
Windows sense, which a drive path and a rooted path both are. The
launcher expectations join with the host separator instead of spelling
out backslashes, so the same assertions hold on every runner.
- The tray resolves codeburn from PATH and the npm locations and never
saw the CLI the desktop app bundles, so a machine with only the
desktop app had a tray with nothing to run. The desktop app now writes
a launcher that runs its bundled CLI through its own executable,
records the path in the tray settings, and the tray's resolver takes
it after PATH and before giving up; a global codeburn still wins. The
first launch also gets CODEBURN_BIN in its environment.
- Four IPC handlers for tray preferences and launch at login had no
platform check and would have touched Windows files or reg.exe on a
Mac; they return neutral values off Windows.
- The install probe ran on every launch and a declined UAC prompt came
back at the next one. A declined or failed staged version is recorded
and not retried until the version changes or the user flips the
switch, and a matching installed version skips the probe.
- Launch at login in the Store build is managed by Windows through the
package's startup task; the switch said otherwise and did nothing.
That build now says so and opens the Startup Apps page.
- Settings files the tray reads were truncated and rewritten in place;
they are written to a temp file and renamed over.
- DISTRIBUTION.md records that the installer's staged tray and the
windows-v* release asset at the same version are separate builds.
The tray switches took the sidebar corner on Windows and the social
links moved to About, but the switches render nothing off Windows, so
Mac and Linux users lost the row and gained nothing. The links are back
there on every platform but Windows.
taskkill only ran for children spawned through the .cmd shim, and the
shipped desktop build runs the bundled CLI through Electron's node, so
it never ran at all and provider subprocesses were orphaned on every
stop. On the shim route it was also fire-and-forget followed by killing
the top of the tree, which reparents the children before taskkill can
find them. Every Windows child now goes through taskkill /T /F from
System32 and the handle is only ended if taskkill fails.
The desktop app's Codex quota reader is a copy of the CLI's and carried
the same fault: two await points between parsing the token grant and
writing auth.json, a rotated refresh token dropped when the grant had no
access token or the file could not be re-read, a silent failed write,
and the caller's abort passed into the grant request. Ported the CLI
fix so the two files match apart from import specifiers.
- On Linux provider keys were written under the plain umask despite a
comment promising owner-only permissions. The directory is created
0700 and the file 0600, the temp file before the rename too, and the
plain-text fallback is stated where it lives, including in the
settings pane copy.
- A release build has no console, so every eprintln wrote into nothing.
A small logger appends timestamped lines to codeburn.log under the
app's local data directory, rolls at 256 KB, and keeps stderr in
debug builds. All call sites use it.
- Uninstall left the launch-at-login Run value pointing at a deleted
exe, so Windows errored at every login. A WiX fragment removes that
one value on a real uninstall, not on upgrade. User data under the
config directory is kept on purpose and the fragment says why.
- The webview CSP allowed a host nothing in the page contacts.
- The updater's verification site now states its trust boundary: the
hash and the MSI come from the same release, so the check proves
transfer integrity only. Signing is a release decision.
Four dock bugs and one Linux gap:
- A fast off/on toggle destroyed the fresh window. Hiding bumped a
dismiss generation but the page's close request ignored it, so the
retract that finished after the next show tore down the reused window.
The generation now travels through the dismiss handshake and a stale
close is ignored; the page also replays its entrance on a new present.
- The pointer tracker could exit and never restart, and a reused or
rebuilt window got none, leaving a transparent always-on-top window
that swallowed every click. A running flag and a drop guard respawn
it, a panic costs one tick, and the window is created click-through
so no path leaves it hit-testable.
- A layout request during a drag snapped the rail out from under the
pointer. Requests are kept and deferred until the drop settles.
- Pointer polling ran at 62 Hz whenever the dock was on. It now polls
at 62 Hz only while engaged or within 120 px, 25 Hz to 600 px, and
8 Hz beyond, about an 87 percent cut at an idle desktop.
- On Linux the dock could be switched on and produce a window nothing
ever made click-through. It is unavailable there now and reports off.
Error output in these files goes through the tray's log file instead
of a stderr a release build does not have.
Two of today's Windows fixes changed POSIX results. Guard flags counted
a backslash as a directory boundary on every platform, where it is an
ordinary filename character off Windows; it now counts only on win32,
while a forward slash counts everywhere so POSIX-shaped provider paths
still match on a Windows host. Hermes accepted drive-letter paths as
real workspaces on every host on the theory that a state.db can be read
on another machine; discovery is strictly local and the ledger contract
rules out restored databases, so that acceptance is Windows-only again.
The quota command races every provider read against a five second
timeout and exits as soon as output is written. The Codex read refreshes
the OAuth grant, and between parsing the grant and writing auth.json
there were two await points, so a timeout or the exit could land with
the old refresh token already retired server-side and the new one only
in memory, signing the user out of Codex. A rotated token was also
dropped when the re-read of auth.json failed or when the grant carried
no access token, and a failed write looked like a network error.
The persist path is now synchronous from the parsed grant to the atomic
rename, keeps the credential file's own private mode, falls back to the
in-memory document when auth.json cannot be re-read, persists a rotated
refresh token even without an access token, reports a failed write on
stderr, and the grant request no longer honours the caller's abort so a
rotation the server has committed cannot be cancelled mid-response.
Three gaps in the Windows route of `codeburn menubar`:
- A Microsoft Store install of the desktop app carries the tray inside
its package and never appears in the uninstall registry, so the CLI
downloaded and installed a second copy into Program Files. The Store
package is now detected first (Get-AppxPackage, bounded to five
seconds, any failure reads as "not a Store install") and its packaged
exe is launched instead; --force still installs the MSI and says the
Store copy is left in place.
- msiexec ran over a running tray. Windows Installer defers the file
swap to the next reboot in that case, so the post-install launch woke
the old process. The running tray is now asked to quit through its
own single-instance protocol, waited for, and killed only as a last
resort, before msiexec runs.
- The ownership marker was written only on the desktop route, so a
hand-installed tray could later be credited to the desktop app and
removed by its uninstaller. The CLI route now records "manual", and
an existing verdict is never rewritten.
Both installer workflows ship the tray app now, so a change under
windows/ must rebuild them. The Store workflow also runs on a desktop-v*
tag, so the NSIS installer and the Store package for a version come from
the same commit.
The CLI ships to macOS and Windows users and the Windows tray app
depends on it, yet the suite only ever ran on ubuntu-latest in CI. One
job per platform on the newest Node 22, without the Linux-tuned serial
lock step. The Windows run uses three workers because the suite spawns
the CLI through tsx often and a runner falls over under the default
worker count.
Tauri names the bundle after productName, so `tauri build` leaves
`CodeBurn Menubar_<version>_x64_en-US.msi` with a space. GitHub rewrites
that space to a dot on release upload, which is the form the CLI
installer, the Electron side and the tray updater all match. The staging
script only knew the dot form, so the installer workflow built the tray
and then failed with "no CodeBurn.Menubar_<version>_x64_en-US.msi".
It now accepts both and stages the dot form, so a local build and a
downloaded release produce the same shape.
The NSIS and Store workflows stage the Tauri tray into the desktop
package, but nothing in those workflows built it, so staging failed with
"no source directory" on every run. Both now install the Rust toolchain
and build the tray first: the installer needs the MSI bundle, the Store
package only the exe.
readSecureFile rejects a login file with group or world bits on POSIX,
which is right for a real login. The Grok and Z.ai fixtures were written
with default permissions, so on Linux the product refused them and six
assertions saw transientFailure or disconnected. Windows has no mode bits
to check, which is why the branch only ever passed there.
The DPAPI calls took `&mut input` for a blob they only read, the dock's
payload command has one argument more than clippy's default limit, and
the Linux leg compiles the Windows-only dock, session and tray-status
code without calling it, which tripped 25 dead-code lints under
`-D warnings`. Dead-code lints now apply on Windows only, where every
function is reachable.
os.homedir() reads USERPROFILE on Windows and never HOME, so the
isolation setup and every test that moved home were still resolving the
developer's real home directory. Fixtures came back empty, real sessions
leaked into counts, and the code under test wrote plans, receipts and a
sync ledger into the real ~/.config/codeburn during a run.
USERPROFILE now joins the redirected variables and a shared setHome()
helper moves HOME and USERPROFILE together; every spawn env carries both.
The remaining Windows-only failures were POSIX-shaped fixtures: chmod
tricks that only toggle a read-only attribute on NTFS, pid 1 as an
always-alive lock holder, splitting paths on '/', bare tar, mode-bit
expectations, and per-file timeouts too short for the cost of a tsx spawn.
Each gets a platform-aware equivalent so nothing is skipped on Windows and
the POSIX branches stay byte-for-byte what they were.
Full run on Windows: 267 files passed, 2 skipped, 3592 tests passed.
Making the CLI suite honest on Windows turned up product bugs that
POSIX never reaches:
- plugins: a bare `tar` resolves to Git for Windows' GNU tar, which reads
a drive letter as a remote host and fails on every absolute path. The
installer now prefers the bsdtar Windows ships in System32.
- antigravity statusline: the hook command was written with POSIX
backslash escapes, which cmd.exe does not understand, so the installed
path was broken for real Windows users.
- act undo: renaming a directory over an existing one raises EPERM on
Windows, not ENOTEMPTY, so the snapshotted-destination retry never ran.
- parser: a worktree's main repository path was sliced from the
slash-normalized copy of the gitdir, so it never matched session cwds.
- dashboard: home-relative project labels compared a slash-normalized
path against an unnormalized homedir(), so no Windows path shortened.
- guard flags: a POSIX-shaped flag path from provider data never matched
a subdirectory because the boundary check used the host separator only.
- claude desktop sessions: the discovery memo omitted homedir() from its
key and served the previous home's paths once home moved.
- copilot: a JetBrains file:///C:/... URL kept its URL slash ahead of the
drive letter, so the project's .git walk never resolved.
- hermes: a state.db written on another platform records that platform's
path shape, so both absolute forms now count on every host.
The single-instance plugin hands a second launch over with a synchronous
SendMessage, so that launch sits inside it until the running app's callback
returns. When the message landed while the first launch was still in setup,
the callback showed the dock from inside a nested message pump, waited on an
event loop that was not running yet, and never returned; every launch after
it, the desktop app's --quit included, blocked behind the same message and
piled up as processes with no windows.
The callback now only records the request and carries it out from the event
loop. The desktop companion also waits, briefly, for a quit it has just sent
to finish before starting the tray app again, because a launch that arrives
while the old process is still going hands its request to that process and
exits with it.
Port of 53c5c7b3 onto the Windows dock. The panel was a list of quota
bars; it is now a glance, in the mac's blocks and in its order: a
provider header, the sessions running right now as pills with their
context gauges, a Today strip, and a row of quota-window percentages,
separated by hairlines. The connection states, the Connect button and
the footer lines the CLI can still answer honestly stay where they were.
A percentage is its own gauge now rather than a bar beside a label: dim
glyphs with the value's severity colour filling them left to right and
wiped off on a slant. The mac solves that edge in points against a
measured text box, so the run gets a box of its own here and the clip is
written as a share of its width plus the slant in pixels; a run centred
in a wider column would otherwise be wiped from the column's edge and
read as fully coloured at half its value. The glance ramps at 70, 80 and
90 rather than the rail's 50, 75, 90, so a healthy row reads as text
rather than as a wall of colour.
Every block carries its own padding and an explicit content height, all
whole pixels at any detail scale, because the window Rust sizes around
the card is measured from what the page drew. Hairlines are overlays for
the same reason: a rule must not add a pixel the measurement did not
reserve. Whichever block ends the card carries the closing inset, which
is the rule the mac's own windowsHeight bakes in.
Three deliberate differences from the Swift, all noted where they are:
the connection lines take the same side inset as every other block
rather than sitting flush to the bubble edge; a disconnected provider
keeps the sign-in guidance the existing bubble had, which the mac's
glance drops; and the footer stays, since the mac reads freshness off
its own adapters and `codeburn quota --format json` does not carry it.
The dock's hover bubble is about to draw the sessions running right now
and today's totals, both of which live in the menubar payload. The dock
is a window with no payload of its own, and the popover's fetch_payload
already runs the CLI for the same answer, so a second spawn on the dock's
own timer would double the cost of every refresh for one bubble nobody
may be looking at.
So the slice the bubble needs is kept in AppState as each payload goes
past: the liveSessions block passed through untouched, and today's
totals from the one request key whose current block really is today's
(today, all providers, local scope, no day pick). A week's numbers under
a heading that says Today would be a lie, which is why the key is
checked rather than the period alone.
Only a glance that actually moved is broadcast on codeburn://glance, so
a poll that found the same sessions costs the dock no render, and a
payload that carries no liveSessions block never blanks one already
held: absence there means the CLI is older than the block, not that
nothing is running. dock_glance answers with the snapshot, or None when
nothing has been fetched yet, which is the dock's cue to ask once itself.
Switching the dock on made a rail appear where there had been nothing, and
switching it off made one vanish. Neither reads as a thing arriving or leaving,
because neither has any direction: the window is created, painted, destroyed.
Now the rail comes out of the edge it is docked to. It starts tucked its whole
cross width behind that edge, so nothing of it shows, and the transform is
released on the frame after the first layout, which is the first moment there is
an edge and a size to be tucked behind. A floating rail has no edge to hide
behind, so it fades and scales from 0.92 instead. Both use dockAttach, the same
280 ms curve the drag glide already settles on.
Leaving is the same in reverse, and it needs a handshake because Rust owns the
window: hide asks the page to retract, the bubble goes first, the rail slides
back over dockDetach, and the page then calls dock_close. Rust keeps a 400 ms
timer so a page that never answers costs a fifth of a second rather than a rail
that will not go away, and a generation counter means switching the dock off and
straight back on cannot have the old timer take the new window.
Nothing here moves a window. It is a transform on the rail alone, so every
window metric stays the whole pixel it was, and prefers-reduced-motion skips
both plays: the rail is simply placed, and the dismiss closes without waiting.
The early return that answered --quit before the Tauri builder ran also skipped
the thing that delivers it. Handing a second launch's argv to the instance that
is already running is the single-instance plugin's job, and the plugin only gets
to do it if the builder runs, so returning first meant the running app never
heard the request: the desktop app's Menu bar switch dropped the Run value and
sent --quit, and the tray app carried on.
It is answered in setup now, where a launch that reached that point is by
definition the only instance: with nothing running it is the one being asked to
go, and it exits without showing anything. With something running the plugin
delivers the argv and this process never reaches setup at all.
Found by driving the switch against the installed app rather than by a test: the
argv parsing this rests on was unit-tested and correct, and the delivery it
depends on was not something a unit test could see.
The plugin runtime has not shipped for Windows, so `codeburn plugin list` never
answers there and the section sat on "Loading plugins..." for as long as the app
was open. A spinner that will never stop is worse than a sentence.
Windows now gets a panel instead: the section's own glyph, one line saying
plugins are coming, and one saying they arrive in a later Windows release and
work today elsewhere. It loads nothing, and the check happens in a dispatcher
above the loader rather than inside it, so the loader's hooks never mount and
there is no CLI call, no spinner and no timer to unwind. Every other platform
renders exactly what it did.
The desktop app's stderr on the VM carried "Antigravity quota unavailable:
Command failed: ps -ax -o pid=,command=" with "ps: unknown option -- x" on every
quota poll. Windows has no ps, and asking for one is a spawn failure rather than
an answer, so the provider reported a transient failure with a warning behind it
instead of simply not being there.
Win32_Process is the same listing by another name, and it is already how
src/providers/antigravity.ts finds these servers, so the quota adapter asks the
same way: PowerShell by absolute System32 path, argv only, no shell string, and
the Where-Object is a prefilter rather than the decision, which classifyProcessLine
still makes. There is no lsof either, so a pid's listening ports come from
netstat -ano; its state column is localized, so it is not matched on, and a row
that turns out not to be listening only costs one refused probe.
The guard this replaces was `win32 && !deps.execFile`, which the desktop app
defeated by injecting execFile, and which its own copy of the adapter never had
at all. Both copies now carry the same code, and the platform is injected so
either branch can be tested from either OS.
The tray app has a settings window of its own, and nobody should have to find it
to change how the thing in their notification area behaves. Two panes join the
Settings rail: Menu bar and Capacity Dock.
Only the settings the desktop app does not already have are there. Currency, the
period, the scope and the daily budget are shared through the CLI config and
already live in General, and repeating them would be two controls for one value.
So Menu bar carries the tray figure's metric and period, the accent, whether
today's figure gets its own tray icon, the two refresh cadences, the terminal and
launch at login; Capacity Dock carries show, resting provider, size, appearance,
gauge shape and the per-provider switches.
Each pane appears only while its switch in the sidebar corner is on: there is
nothing to configure about a tray app that is not running, and the rail is one of
its windows. A pane whose switch has just gone off cannot stay on screen either,
so the rail falls back to General.
Two things the rail's own rules are worth restating here. The last connected
provider cannot be switched off, because the rail must never have nothing to
show. And a provider stays in the list after its connection drops, so one that
has stopped working can still be taken off.
Every control renders what came back rather than what it sent: the main process
is what decides the value that lands, and it repairs one it would not be able to
read later.
The tray app keeps its preferences in two files it reads from Rust before any of
its windows exist, so those files are the interface rather than any running
process: windows-settings.json for what only it cares about, windows-dock.json
for the Capacity Dock. The desktop app can now read and write both, which is
what lets its Settings carry the tray app's own panes.
Every write is a merge. Both files hold keys this side has no business touching,
the rail's placement above all, and a whole-file write would take them with it.
And every value is checked against the same closed set the tray app parses it
with: a value it cannot read collapses to a default there, so sending one would
silently lose the setting rather than store it. The check is also what keeps a
renderer from reaching a key it was not offered.
Two rules come with the dock file. Writing the provider set latches
manualSelection, because editing the set by hand is what stops the tray app
seeding it from whatever is connected. And a set that no longer holds the
resting provider moves it, since the rail can only rest on a row it is showing.
Showing the rail is the Sidebar switch under another name, so it goes through
that path rather than straight to the file, and keeps the rule that the rail
cannot outlive the tray app. Launch at login is the one setting that is not in
either file: it is the Run value, which this app already owns.
After every write the running tray app is nudged with --reload-settings, which
makes it re-read both files and broadcast to its own windows. With the tray app
off there is nothing to tell and the files are enough.
They start real children and then wait for the OS to report them gone. Under the
whole suite, fifty files at once, that wait outran the five-second default often
enough to fail on a busy machine while nothing was wrong. Same reason and same
headroom as the resident-serve block.
The block is a wall-clock snapshot (idleSeconds, lastActivityAt), not a parse product, so serial and parallel runs legitimately differ there; same treatment the parse-workers unit test already applies.
The Capacity Dock hover panel becomes a glance: a provider header, the
sessions running right now as pills with their context rings, a Today
strip, and a row of quota-window percentages, separated by hairlines.
Window percentages stay plain text until 70 percent so a healthy row
reads as text rather than a wall of colour. The panel stays 350pt wide;
every block height is a whole point and is summed into the panel frame,
since the hosting view does not size itself.
Running sessions are new CLI surface. `liveSessions` is add-only on the
menubar payload: sessions whose transcript was appended inside a 120s
window, carrying the branch, the model that answered last, and the
context that turn reported. Absence means "unknown", so the section
hides rather than claiming nothing is running. The block names projects
and branches, so sharing and MCP output strip it.
Today's totals needed no CLI change; the app simply was not decoding the
cache token counts the payload already carried.
Installing the .msi over an install of the same version left the old files
exactly where they were, which makes `codeburn menubar --force` mean nothing:
the one thing force is for is repairing an install that is already there.
It is a WiX rule, and Tauri does expose it, just not under the name it goes by.
Its main.wxs carries two MajorUpgrade elements and picks between them on
allowDowngrades, which defaults to true. That branch is
`AllowDowngrades="yes"` with no AllowSameVersionUpgrades; the other one is
`DowngradeErrorMessage=... AllowSameVersionUpgrades="yes"`. So asking for no
downgrades is what turns same-version upgrades on, and no custom template is
needed.
Refusing a downgrade at the installer is also the rule this codebase already
follows a layer up: both the CLI's bundled install and the desktop app leave a
newer menubar alone rather than replacing it. Now the .msi says the same thing
by itself.
The rail is a window of the tray app, and every setting it renders from belongs
to the tray app, so a Sidebar that is on while the menu bar app is off describes
something that cannot exist.
Turning Menu bar off now turns Sidebar off with it, and writes enabled: false
into windows-dock.json before sending --quit, so what the tray app finds the next
time it starts is the state the switches are showing rather than a rail that
comes back on its own. Turning Sidebar on with Menu bar off turns Menu bar on
first, installing and starting the tray app and writing the Run value, and only
then enables the rail; if the tray app cannot be turned on there is nothing for
a rail to live in, and both switches stay off.
In the corner the Sidebar switch is disabled while Menu bar is off, with a title
saying why. That is the primary guard, and the cascade above is what answers a
request that arrives any other way: through the IPC channel, or from a settings
file that already disagrees with itself.
The stored path is a memory, not a fact. It was written by a build that derived
the binary name from the product name, so on this machine it named a file that
has never existed, and the switches sent --quit and --reload-settings into it
while the desktop app's own stderr said ENOENT. A tray app uninstalled after the
path was stored gets to the same place.
So nothing is launched, and no Run value is written, without checking the file
first. A stale stored path is re-resolved through the CLI rather than trusted,
which costs one `codeburn menubar`: it re-reads the uninstall registry and
installs nothing when the version already matches. A path the installer reports
but nothing is at is refused rather than saved, since saving it is what made the
switches silently do nothing.
Launch at login gets the same treatment. The rule is still that an existing Run
value is not this app's to rewrite, with one exception: a value pointing at a
file that is not there is not somebody's preference, it is the old wrong path,
and it would fail silently at every login. That one is repaired.
While here: a byte order mark no longer makes the settings file unreadable.
Falling back to the defaults means seeding again, which reinstalls the tray app
and re-enables the rail, and a BOM is what anything editing that file by hand on
Windows leaves behind.
Tauri names the install directory after the product and the binary after the
Cargo package, so what lands on disk is CodeBurn Menubar\codeburn-menubar.exe.
The registry read joined the product name onto InstallLocation instead and
produced CodeBurn Menubar\CodeBurn Menubar.exe, which has never existed.
Everything downstream was built from that path. `codeburn menubar` printed
"Launched CodeBurn Menubar." after spawning nothing, on both its paths: the one
that finds the right version already installed, and the one that has just
installed it. The desktop app stored it in companion.v1.json, so its Menu bar
and Sidebar switches sent --quit and --reload-settings to a file that is not
there, and the Run key it seeds pointed at the same missing file, which would
have failed silently at every login.
DisplayIcon comes first now, since an installer that writes one is naming the
binary rather than leaving it to be guessed. Tauri leaves it empty, so the path
that actually gets used is InstallLocation joined with the binary name, and the
binary name is a constant beside the product name rather than the product name
reused. Verified against this machine's registry: InstallLocation
"C:\Program Files\CodeBurn Menubar\", DisplayIcon empty, and one executable in
that directory called codeburn-menubar.exe.
They start several real node children each, and the suite runs fifty files at
once, so two of them intermittently hit the five-second default while the
machine was busy rather than while anything was wrong. Nothing here asserts how
fast a child answers, only which one does.
Windows has no shebang. CreateProcess starts executables, and both shapes a
codeburn install takes here are scripts: dist/cli.js in dev, and the codeburn.cmd
that a global npm install puts on PATH. Spawning either with shell: false is
EFTYPE, so nothing the desktop app ran ever ran on this platform. The throw came
out of startServe inside whenReady and took the rest of it with it, which is why
`npm run dev` never even opened a window, and why 49 of this file's own tests
failed here.
Each script now gets a runner that can start it. A .js goes through this
process's own binary as Node, the same shape the bundled CLI already used. A .cmd
goes through cmd.exe as one command line, because that is the only way to start
a batch file, and the line is built rather than handed to shell: true, which
does not escape anything: two parsers read it, cmd first and then whatever splits
a command line back into argv, and a .cmd re-expands its own arguments through
%*, so the arguments are escaped for both readings. That is cross-spawn's rule,
restated here rather than depended on, since the main process ships no npm
dependencies. An .exe and a POSIX codeburn are spawned exactly as before.
Two things follow from the cmd.exe route. The PATH lookup asks for codeburn.cmd
before bare codeburn, because npm writes both into the same directory and the
bare one is a shell script Windows cannot start. And killing such a child means
killing the tree: the shim exits as soon as it has started node, so the handle we
hold is the shim's, and taskkill /T is what reaches the generation below.
Five tests do not run on Windows now rather than failing there. They assert
catchable SIGTERM: a grace window, a cleanup handler, a child that ignores the
first signal, a resident closing its own stdin. child.kill on Windows is
TerminateProcess, so those are things the platform does not have rather than
things this code gets wrong, and the POSIX expectations are untouched. Three
assertions that hard-coded ":" as the PATH separator now use the platform's.
The first run wrote enabled: true into windows-dock.json and wrote the tray
app's Run value, whatever was already there. On a machine where somebody had
installed the tray app by hand and deliberately turned the rail off, or turned
launch at login off, installing the desktop app quietly undid both. A default
is an answer for a question nobody has answered, not an override of one that has
been.
So the seed now looks first. An existing enabled value is left exactly as it is
and mirrored into the Sidebar switch instead, so the corner opens saying what
the rail is actually doing rather than what this app would have preferred; only
an absent key is seeded. A file that exists but has never mentioned the rail
still counts as no answer, which is the case for anyone who has only ever
dragged the rail somewhere.
The Run value follows the same rule and, like the rail, is only ever touched on
the first run. After that it belongs to whoever changes it: the tray app's own
launch-at-login toggle, or the Menu bar switch here, which still writes it on
and deletes it off.
stage-menubar.mjs is stage-cli.mjs for the Tauri tray app: it copies rather than
downloads, taking the local `cargo tauri build` output by default and whatever
CI fetched with --from. The two routes need different things staged, so it has
two shapes. The NSIS build gets the .msi and its .sha256, computing the digest
when a local build has none, so the installer's verification means the same
thing there as it does for a release. The Store build gets the executable, since
a packaged app cannot run msiexec at all.
build/menubar rides into both packages as win.extraResources. Unlike the CLI it
carries no node_modules, so electron-builder's production-dependency filter has
nothing to strip and the afterPack hook is not needed.
installer.nsh removes the tray app on uninstall only when the marker credits
this app with installing it, which is what keeps a manual `codeburn menubar`
install alive through a desktop uninstall. PowerShell reads the marker and pulls
the product code out of the uninstall string, because NSIS has no JSON and the
alternative was hand-parsing one in a macro.
appx-extensions.xml declares the tray app's launch at login as the package's own
windows.startupTask, so it appears in Settings > Apps > Startup like anything
else the Store installed. No Run value is written on that route.
The sidebar's bottom corner held About and a row of five brand glyphs. The
glyphs were the least useful thing on that screen: they are visited once, and
About already listed every one of them under Links. So they are only there now,
and the corner carries the two things a Windows user does want at hand: whether
CodeBurn sits in the notification area, and whether the Capacity Dock rail is on
the screen edge.
Both are on by default and neither renders at all until the main process says
this build has a tray app staged, which is why there is no placeholder row and
no greyed-out switch: on macOS, on Linux, and in a dev build with nothing
staged, the corner is exactly what it always was.
The switch is the shared one from Settings and onboarding, at 30x17 rather than
38x22 because a 186px sidebar has no room for the full size beside a label, and
keyed off the theme tokens rather than the white overlays the bare shape uses on
the dark onboarding sheet.
Installing the desktop app should give a person the tray icon and the Capacity
Dock without their ever learning that `codeburn menubar` exists. So it carries
the matching windows-v* build and puts it there itself, at first launch and at
every launch after, which is also what covers a desktop-app update: the staged
.msi travels with the app.
The install itself is not reimplemented here. The CLI already owns the registry
read, the checksum, the msiexec call and the never-downgrade rule, so this side
stages the file, names it in CODEBURN_MENUBAR_MSI and reads the one JSON line
that comes back. What it does own is the tray app's process and its Run value,
because the two sidebar switches have to be able to stop and start it: the tray
app is reached through its own argv, --quit to stop and --reload-settings to
make it re-read the dock preference this module writes.
The Store route shares almost none of that. msiexec is not available to a
packaged app and would fight the package manager anyway, so the tray exe ships
inside the package and is launched from there, and no Run value is written
because the manifest's own startup task covers launch at login.
Two rules worth naming. The defaults are seeded once, so a person who later
turns the rail off in the tray app's own settings does not find it back on at
the next launch of this one. And every setter answers with the whole status
rather than an acknowledgement, so a switch shows what took: an install
cancelled at the UAC prompt leaves it where it was.
The upgrade code is what tells Windows Installer that two .msi files are the
same product, and it is about to matter: the desktop app will ship this build
and install it over whatever a manual `codeburn menubar` already put there.
With one upgrade code that is an in-place upgrade; with two it is a second copy
of the tray app beside the first.
Tauri derives the code from a v5 UUID over "<productName>.exe.app.x64" when the
config does not name one, so the value written here is the one every released
.msi already carries (`tauri inspect wix-upgrade-code` reports the override and
the derived default as the same GUID). Nothing about existing installs changes.
What changes is that renaming the product can no longer move it by accident.