Omarchy: new-mail toasts on the bar poll (default off) - #222
Conversation
There was a problem hiding this comment.
Pull request overview
Adds opt-in Omarchy new-mail notifications to the existing Imbox bar poll.
Changes:
- Adds
--notify/--no-notifysetup controls. - Tracks unseen postings and sends replaceable notifications.
- Documents behavior and adds comprehensive tests.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
README.md |
Documents notification setup. |
internal/cmd/omarchy.go |
Adds flags, polling integration, and state removal. |
internal/cmd/omarchy_test.go |
Extends setup and bar test helpers. |
internal/cmd/omarchy_notify.go |
Implements fingerprints and notifications. |
internal/cmd/omarchy_notify_test.go |
Tests notification and setup behavior. |
docs/omarchy.md |
Records notification design and follow-ups. |
.surface |
Exposes the new setup flags. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 22bb874cca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
bfa5521 to
37c66fc
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3663c30160
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
💡 Codex Reviewhey-cli/internal/cmd/omarchy_notify.go Line 123 in 83a5321 When the notification is delivered successfully but the state directory becomes unwritable or the disk is full, this discarded save error leaves the previous fingerprints and toast ID on disk. Every subsequent three-minute poll therefore classifies the same postings as fresh and sends the notification again, potentially without replacement if the new ID was never persisted. Handle persistence failure so mail is not repeatedly toasted after a successful delivery. hey-cli/internal/cmd/omarchy.go Lines 411 to 412 in 83a5321 If setup copied Omarchy's default layout and Omarchy upgrades that default before hey-cli/internal/cmd/omarchy.go Line 563 in 83a5321 When reconciling an existing hey-cli/internal/cmd/omarchy.go Lines 627 to 629 in 83a5321 When Omarchy has already been uninstalled or its state directory was removed, this unconditional detection check rejects hey-cli/internal/cmd/omarchy.go Lines 676 to 677 in 83a5321 When any setup step fails under AGENTS.md reference: AGENTS.md:L7-L9 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 804e7d387e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 559ce71a3f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a46dcf6d8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50d00e71f3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b356a642a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce605df7da
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7be29f94be
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
391d438 to
bc8592d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc8592dab1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
70660af to
eac5671
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eac5671bf0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
hey setup omarchy --notify rewrites the hey-unread bar module's exec to hey omarchy bar-status --notify, so the same 3-minute tick that lights the indicator also diffs the unseen Imbox postings against a fingerprint file (~/.local/state/hey-cli/omarchy-poll.json) and sends at most one toast via omarchy-notification-send. One Imbox fetch serves both; enablement lives in the exec string where it acts, with no config key, and --no-notify or --remove takes it back out (--remove also deletes the state file). New means an unseen posting not fingerprinted yet, or one whose visible_entry_count grew -- a new reply on a known thread. Fingerprints avoid updated_at (it churns) and seen (it flips on read); muted threads are remembered but never toast. The first run seeds silently so the backlog is never toasted. One new thread reads "Sender -- Subject", more read "N new in Imbox" with the first few senders. The daemon's printed id is cached and passed back with -r so consecutive ticks replace the on-screen toast instead of stacking; a stale id after a shell restart just makes a fresh one. The toast identifies as --app-name HEY on purpose: omarchy's default app-name omarchy-action bypasses notification silencing, so HEY is what makes SUPER+CTRL+comma mute these like any other app. Clicking focuses the TUI through the same launch-or-focus exec every other surface uses. Errors -- auth, network, a failed send -- stay as silent as the bar itself and leave the fingerprints untouched.
Third of the three-PR stack (theming #220 → setup+bar #225 → this). The design record is in docs/omarchy.md.
What
hey setup omarchy --notifyrewrites thehey-unreadbar module's exec tohey omarchy bar-status --notify. The same 3-minute tick that lights the indicator now also diffs the unseen Imbox postings against a fingerprint file (~/.local/state/hey-cli/omarchy-poll.json) and sends at most one toast per tick viaomarchy-notification-send. One Imbox fetch serves both.--no-notifyreverts; a plain re-run leaves it as it is;--removealso deletes the state file.Enablement lives in the module's exec string — no config key, visible where it acts, gone with
--remove.Design
visible_entry_countgrew (a new reply on a known thread). Fingerprints avoidupdated_at(churns) andseen(flips on read). Muted threads are remembered but never toast.hey accounts usereseeds silently instead of toasting another account's backlog, and re-enabling after a--no-notifystretch drops stale fingerprints first.Sender — Subjectfor one thread (sender falls back name → email like other renderers),N new in Imbox+ first senders for more. The daemon's printed id (-r <id> -p) is cached so the next tick replaces the on-screen toast; a stale id after a shell restart just makes a fresh one.omarchy-actionbypasses silencing (NotificationLogic.js:34-38), so the toast passes--app-name HEYand SUPER+CTRL+comma mutes it into history like any other app.omarchy-launch-or-focus-tuiexec hint.Why the bar tick and not a push: inline
commandbar modules are interval-only —Bar.qmlhas noIpcHandlerandomarchy barhas no refresh verb — so event-driven freshness needs a widget plugin, recorded as the follow-up in docs/omarchy.md.Verified live
First
--notifytick seeded 30 fingerprints and toasted nothing; flipping a thread unseen toastedSender — Subjectwith the envelope glyph,app: HEY, urgency low, and the focus exec (checked in the daemon's history record); two back-to-back new threads shared one toast id (replaced, not stacked); with DND on, the toast landed in history instead of popping;--no-notifyreverted;--removecleared module + state file.