Stop announcing the same email twice

Both notification paths feed one channel, which is how a single arrival
came to be announced twice: Gmail names the sender, then the unread count
says "1 new" behind it seconds later.

A count is now skipped when the app has spoken for itself in the last
twenty seconds - generous, because a count is only noticed on a
four-second tick, well after the app raised its own. Settings can also
turn count notifications off outright, for hearing only what an app says
in its own words, at the cost of the tools that never say anything.

`npm run ship` now updates only /Applications. The Desktop installer
moved behind `--dmg`, for when a build is going to someone else.
This commit is contained in:
2026-09-02 09:36:57 +02:00
parent c989fef6fe
commit aa19da48de
10 changed files with 121 additions and 21 deletions
+26 -13
View File
@@ -3,12 +3,15 @@
# Build once, then put the result in both places, every time:
#
# /Applications/Work.app the copy being tested here
# ~/Desktop/Work-<version>.dmg the installer to send someone else
#
# One build, two destinations — so the thing a tester runs is byte for byte the
# thing that was just tested here, rather than a second build that drifted.
# Pass --dmg to also drop a drag-to-Applications installer on the Desktop, from
# the same build — so the thing a tester runs is byte for byte the thing that
# was just tested here, rather than a second build that drifted.
set -euo pipefail
WANT_DMG=0
[ "${1:-}" = "--dmg" ] && WANT_DMG=1
cd "$(dirname "$0")/.."
APP="Work.app"
BUILT="src-tauri/target/release/bundle/macos/$APP"
@@ -17,7 +20,11 @@ VERSION="$(node -p "require('./package.json').version")"
DMG="$HOME/Desktop/Work-$VERSION.dmg"
echo "==> building $VERSION"
npm run tauri build -- --bundles app,dmg
if [ "$WANT_DMG" = "1" ]; then
npm run tauri build -- --bundles app,dmg
else
npm run tauri build -- --bundles app
fi
echo "==> quitting the running copy"
osascript -e 'quit app "Work"' >/dev/null 2>&1 || true
@@ -32,17 +39,23 @@ echo "==> installing to $DEST"
rm -rf "$DEST"
cp -R "$BUILT" "$DEST"
# The disk image the bundler just made — drag-to-Applications, which is what
# The disk image, only when asked for — drag-to-Applications, which is what
# someone expects to be handed rather than a bare bundle to file themselves.
echo "==> copying the installer to $DMG"
BUILT_DMG="$(find src-tauri/target/release/bundle/dmg -name '*.dmg' -maxdepth 1 | head -1)"
if [ -z "$BUILT_DMG" ]; then
echo "no .dmg was produced — check the bundler output above" >&2
exit 1
if [ "$WANT_DMG" = "1" ]; then
echo "==> copying the installer to $DMG"
BUILT_DMG="$(find src-tauri/target/release/bundle/dmg -name '*.dmg' -maxdepth 1 | head -1)"
if [ -z "$BUILT_DMG" ]; then
echo "no .dmg was produced — check the bundler output above" >&2
exit 1
fi
rm -f "$DMG"
cp "$BUILT_DMG" "$DMG"
fi
rm -f "$DMG"
cp "$BUILT_DMG" "$DMG"
echo "==> launching"
open "$DEST"
echo "==> done — $DEST and $DMG"
if [ "$WANT_DMG" = "1" ]; then
echo "==> done — $DEST and $DMG"
else
echo "==> done — $DEST"
fi