You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds update notifications and in-place updates, using GH releases as the source of truth.
This PR:
Checks GitHub Releases once a day and caches the result in ~/.codiff/update-state.json, shared by the app and the CLI
Shows a small pill at the bottom of the sidebar when an update is available. One click applies it: macOS and Squirrel Windows download the update and restart into the new version, Linux and non-Squirrel Windows download the matching release asset and open it, then the pill asks you to quit to finish
The pill tracks progress (updating, quit to finish, failed with one-click retry), and its tooltip says what clicking will do for the platform's update strategy
Adds codiff update to the CLI, which upgrades through Homebrew when the cask owns the install, opens the app to update itself otherwise, and points at the release page for source checkouts
Prints a one-line notice after codiff --version when a newer version is cached, implemented in the Node CLI and mirrored in the POSIX sh wrapper with the same version comparison and state validation so a broken or stale state file stays silent
ScreenshotsPrevious iterations
This iteration was a two-click update, which after some thought it felt like it can be simplified to match modern tools like VSCode and Codex, an update is just a single-click and self-explanatory. So I decided to match it.
Used Fable 5 xhigh with 20 iterations of review with Sol 5.6 xhigh.
Homebrew specifically recommends auto_updates true when an app’s “Check for Updates” functionality downloads and installs the update, rather than merely opening a webpage. Homebrew can then compare the installed app bundle’s version against the cask version and avoid accidentally downgrading a self-updated app. Homebrew Cask Cookbook, Homebrew FAQ
For #148, I would also make these corresponding changes:
Make codiff update open the application’s self-updater on macOS, even when installed through Homebrew. Its current brew upgrade --cask codiff special case becomes unnecessary and may lag behind the newest GitHub release if the tap has not been updated yet.
Continue updating the cask’s version, sha256, and URL for fresh installations. auto_updates true does not eliminate normal cask maintenance.
Keep publishing only signed and notarized macOS ZIPs. Electron requires a signed application for Squirrel.Mac updates. Electron autoUpdater documentation
Test an actual upgrade starting from brew install --cask nkzw-tech/tap/codiff, then verify:
Codiff updates in place.
The terminal-helper symlink still works.
CFBundleShortVersionString reflects the new version.
brew outdated and brew upgrade do not reinstall or downgrade it.
brew uninstall --cask codiff still removes the updated app.
The existing build already has the important prerequisites: its bundle versions are correctly set to 1.9.2, and the local release build is Developer ID signed, notarized, and has a stapled ticket.
So I’d consider issue #2 resolved by adding auto_updates true, aligning codiff update with the in-app updater, and testing the Homebrew-installed upgrade path. It would not resolve #148’s Windows ZIP behavior, missing download verification, Linux architecture matching, or web CSS leakage.
Windows now has its own manual strategy: since the releases deliberately ship only a ZIP, the update button opens the release page instead of downloading an archive that can't install itself. The status stays available because nothing was installed.
codiff update no longer special-cases brew, it hands every packaged install to the app's self-updater. On the tap side I'd add auto_updates true together with the first release that ships this updater, not before: brew upgrade skips auto_updates casks unless --greedy, so flipping it while 1.9.2 is current would leave existing brew installs with no update path at all.
Downloads now stream to disk through a SHA-256 hash and are verified against the digest GitHub publishes for the asset before anything is opened. A missing or mismatched digest deletes the file and surfaces an error. This also removes the full in-memory buffering and sync write.
Linux assets are matched against process.arch (amd64/arm64 for deb, x86_64/aarch64 for rpm), with a fallback to an unmarked asset. An installer marked for another architecture is refused rather than opened.
All the update pill CSS (and its variables) moved to Desktop.css.
The pill itself now renders through the shared <Button> component and only layers an accent fill on top, so it picks up the squircle corners and sizing from the shared styles.
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
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.
This PR adds update notifications and in-place updates, using GH releases as the source of truth.
This PR:
~/.codiff/update-state.json, shared by the app and the CLIcodiff updateto the CLI, which upgrades through Homebrew when the cask owns the install, opens the app to update itself otherwise, and points at the release page for source checkoutscodiff --versionwhen a newer version is cached, implemented in the Node CLI and mirrored in the POSIX sh wrapper with the same version comparison and state validation so a broken or stale state file stays silentScreenshots
Previous iterations
This iteration was a two-click update, which after some thought it felt like it can be simplified to match modern tools like VSCode and Codex, an update is just a single-click and self-explanatory. So I decided to match it.Used Fable 5 xhigh with 20 iterations of review with Sol 5.6 xhigh.