Skip to content

feat(alerts): choose alerts by kind and by PC - #2870

Merged
devswha merged 3 commits into
mainfrom
feat/push-granularity
Nov 5, 2026
Merged

devswha merged 3 commits into
mainfrom
feat/push-granularity

Conversation

@devswha

@devswha devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner

What

Finer alert choices per device in Settings → Alerts (part of #1490):

  • Needs permission, split from Needs input. A blocked agent that reports it waits for a permission (herdr-core's agent_kind, server/herdr-core/snapshot.ts reportedFacts) alerts under it; one that does not say what it waits for (herdr's TUI runtime today) still alerts as Needs input. Nothing is guessed from the screen.
  • Stopped on an error: an OmO or GJC turn that ended on an error (OmoRest failed, server/completion.ts), off by default. Like a question, it waits short and the pane's next change calls it off.
  • Alerts from: with two PCs or more, one switch per PC, the Host first, in the same shape as Remote PCs → Show in sidebar.
  • Every push payload now carries kind (input | permission | done | ended | error), and the permission body reads "waiting for your permission".

Defaults keep today's alerts: an unset permission follows input (so a device that had turned Needs input off does not start getting permission alerts), error is off, and no PC is off.

How

  • The choices ride with the push subscription (AlertPrefs gains optional permission, error, pcs_off; parseAlerts keeps only known values). The server filters per subscription in server/push.ts, not the device's service worker: a web push the worker receives has to be shown (iOS takes the subscription away from a page that shows none), and the phone app's relay forwards whatever the PC sends. One filter covers web push, the iOS app and the Android app.
  • A blocked pane's kind is read when the alert goes out (the same paneGet that already fetched the fresh title, now lookupPane), so a device that wants only permissions waits in the short group and is dropped at send time if the pane turns out to ask a question.
  • PCs are named by name, not roster id: every PC calls itself local, and the phone app subscribes to each PC separately, so an id would silence every PC's own panes at once. The local name is hostname(), as server/machines.ts names it in the roster.
  • The in-app paths (drop-in, chime, tab notification) apply the same alertsAllow/alertPcAllowed with the pane's agent_kind from the roster.
  • Stored format: the new choices live in their own key ovis:alert-filters (src/lib/alertFilters.ts), like ovis:hidden-pcs, so an older tab rewriting ovis:settings whole cannot erase them. Not structural per docs/development.md. An older server ignores the extra alerts fields and keeps today's behaviour.
  • Design reference: the per-category notification switches of the Claude and Codex desktop apps (one switch per kind of event) and Slack's per-workspace notification toggle for the PC list.

Screenshots

Settings → Alerts, before and after, at 390 and 1280, light and dark, with a second demo PC (laptop, switched off in the "end" shots). Lead has the images.

Not covered

  • An error from herdr-core's own error state: agentStatusOf maps it to unknown today, so it is not told. Only OmO/GJC failed turns are.
  • A remote PC's failed turn: its rest is not forwarded over the bridge.
  • Permission vs question on herdr's TUI runtime: herdr does not report it, so those stay under Needs input.

Validation

  • bun run typecheck: clean.
  • Focused: server/push.test.ts, server/push-health.contract.test.ts, src/lib/{alertFilters,droplet,notifications,settings,push,useNotifications}.test.ts, src/components/PushHealthNotice.test.tsx, the i18n and conventions tests: 313 pass. The three new server tests fail on origin/main (checked by running them against the old server/push.ts).
  • bun run check fast through the heavy runner (it ran on this PC once load allowed): exit 0.
  • Skipped: bun run check full and the browser regressions (CI's Integration and browser job runs them).

Settings > Alerts gains Needs permission (split from Needs input, for
agents that report they wait for a permission), Stopped on an error
(OmO/GJC failed turns, off by default) and, with two PCs or more, which
PCs alert this device. The choices ride with the push subscription, so
the server leaves out what a device does not want for web push and the
phone app alike, and every push names its kind. Defaults keep today's
alerts.
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8d1c963 and 37c1b1e.

Files selected for processing: 25

  • changelog.d/alert-kinds-and-pcs.md
  • server/core/status.ts
  • server/push.test.ts
  • server/push.ts
  • shared/notify-policy.ts
  • shared/push.ts
  • src/components/SettingsDialog.tsx
  • src/lib/alertFilters.test.ts
  • src/lib/alertFilters.ts
  • src/lib/droplet.test.ts
  • src/lib/droplet.ts
  • src/lib/i18n.ja.ts
  • src/lib/i18n.ko.ts
  • src/lib/i18n.zh.ts
  • src/lib/i18n/settings.ja.ts
  • src/lib/i18n/settings.ko.ts
  • src/lib/i18n/settings.zh.ts
  • src/lib/i18n/sidebar.ja.ts
  • src/lib/i18n/sidebar.ko.ts
  • src/lib/i18n/sidebar.zh.ts
  • src/lib/notifications.test.ts
  • src/lib/notifications.ts
  • src/lib/relay/shell.tsx
  • src/lib/useAlertSignals.ts
  • src/lib/useAlerts.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@devswha

devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Adversarial review (Codex, Terra 6.1 fast, xhigh) and how each finding was handled

No HIGH. Eight MEDIUM; this PR's one fix round took the two that send a push against the device's choice:

  • Fixed: a PC turned off while an alert waited still got it. The send-time recheck now asks for the PC as well as the kind (wants in server/push.ts), for status and error alerts. Test: "asks a waiting alert's device again for the PC as the alert goes out" (fails on the previous head).
  • Fixed: an OmO failure held as working left an error alert no change would call off. onFailed now tells nothing of a pane the alerts take for working or blocked. Test: added to "tells a turn that stopped on an error only to a device that asked…" (fails on the previous head).

Left as is (not reproduced end to end, or outside this PR's contract), for a follow-up if users hit them:

  • In-app alerts and remote-PC pushes read a blocked pane's agent_kind from the last roster, which can lag the status frame by one refresh: a permission can briefly count as a question. Fixing it means carrying the kind on pane-status and the bridge stream (a WS contract change).
  • Stopped on an error is push-only and local-PC-only: the status frame says idle and carries no failure, and a remote PC's failure is not forwarded through the bridge.
  • pcs_off is by PC name. A PC labelled otherwise in another PC's roster (an SSH or relay PC with a custom name) is silenced only for the alerts that roster's server forwards, not for the device's direct subscription to that PC, which knows itself by its hostname.
  • In the phone app, a changed choice reaches the PC it is connected to now. Each other PC learns it when the app next opens it (the existing per-PC registration path).
  • A choice changed while a push registration is still in flight is sent with the next registration (load, visibility or the next change), not at once, because ensurePushSubscription is single-flight.

@devswha

devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

omo review at 37c1b1e: BLOCK on one reproduced MEDIUM, no HIGH

  • MEDIUM (reproduced): pcs_off by name vs a PC's own hostname. A PC labelled otherwise in another PC's roster is silenced only for the alerts that roster's server forwards, not for a direct subscription to it. Fixing it needs a PC identity shared by roster entries and each server (a contract change), so it is left for Alerts from: a PC turned off by its name in another PC's roster still alerts directly #2876. This PR's single fix round went to the two Codex findings that pushed against the device's choice (see the comment above).
  • MEDIUM (not reproduced): Stopped on an error is push-only. No in-app drop-in or sound for it, and pushes are held while a window of the app is in use, as for every kind. Already listed above as out of scope.
  • MEDIUM (not reproduced): in-app alerts read agent_kind from the last roster. Already listed above; only for a device whose Needs input and Needs permission differ.
  • LOW: a changed choice reaches the PC open now; others on their next open. Same as Needs input and Finished on main.

Changed tests pass at this head (106 in the reviewer's run); bun run check fast exit 0 at this head.

@devswha

devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Merge note: Settings > Alerts gains Needs permission, Stopped on an error (off by default) and per-PC switches; server filters per push subscription; defaults unchanged. Screenshots approved by the lead (owner delegated). omo CLEAR at 37c1b1e; remaining MEDIUM (PC keyed by name) tracked in #2876 per the one-round rule; required checks green.

@devswha
devswha merged commit a80c6db into main Nov 5, 2026
23 checks passed
@devswha
devswha deleted the feat/push-granularity branch November 5, 2026 05:54
devswha added a commit that referenced this pull request Nov 5, 2026
## What

Since #2870, `src/lib/i18n/settings.{ko,ja,zh}.ts` are 401 lines, so
`src/lib/i18n.test.ts` "keeps each part file at 400 lines or fewer"
fails on main and on every PR's Fast checks.

## How

Move-only: the Settings > Phone & devices > Access rows move from
`settings.*.ts` into new `settings-access.*.ts` files (39 lines each;
`settings.*.ts` drop to 367). Each language's loader spreads both into
the same `settings` part (`settings: { ...SETTINGS_KO,
...SETTINGS_ACCESS_KO }`), so the part-placement rules and `PART_FILES`
are unchanged. No wording changes; CONTRIBUTING.md names the new files.

## Validation

- `bun test src/lib/i18n.test.ts`: 22 pass (on origin/main: 1 fail, the
400-line cap).
- Merged origin/main after #2869 (agent groups); no part file is over
the cap (`settings.*.ts` 371 lines, the rest lower), so no further split
was needed.
- `bun run check fast` at 7d66c66 (heavy runner): all green (workflow
syntax, generated files, typecheck, build, unit 11609 pass / 0 fail).
devswha added a commit that referenced this pull request Nov 5, 2026
…ser tabs (#2885)

## What

After a phone gets into Ovis in a mobile browser tab (not the
home-screen app), one dismissible line under the header says how to add
Ovis to the home screen, where alerts reach it:

- **iPhone / iPad Safari:** "Add to Home Screen for alerts: [share
glyph] Share → Add to Home Screen". iOS has no install prompt, so the
line names the steps with Safari's share glyph.
- **Android Chrome:** a one-tap **Install** button once Chrome fires
`beforeinstallprompt` (it reuses `useInstallPrompt` from
`lib/install.ts`). Before that, or in a browser that never fires it, the
line reads "Install the app for alerts: Menu → Install app".

It is hidden for good (`localStorage` `ovis:install-hint-dismissed`)
once dismissed, or once this browser sees the app installed
(`appinstalled`, display mode, or `getInstalledRelatedApps`). It never
shows on desktop browsers, in the desktop app, in the iOS/Android apps
(Capacitor), in the iPhone home-screen app (`navigator.standalone`), or
over plain http, where an installed page gets no push alerts either.

Design reference: the install banners in the Claude and ChatGPT mobile
web apps: a single dismissible line, not a dialog or a sheet. It reuses
the `.update-notice` layout shared by the other lines over the pane.

## Files

- `src/lib/installHint.ts`: the show/hide rules (`installHintKind`) and
the remembered dismissal.
- `src/components/InstallHint.tsx` + `.css`: the line, placed with the
other notices in `App.tsx`.
- i18n: three keys in the devices part (en/ko/ja/zh). The share glyph
goes in at a `{glyph}` placeholder that every translation keeps.
- `scripts/install-hint-demo-regression.ts`: browser regression on the
demo fixtures, added to `scripts/ci-browser.sh` and
`docs/development.md`.

## Screenshots (390 px, before → after)

Each image: before on the left, after on the right.

iPhone Safari, light / dark:

<img
src="https://raw.githubusercontent.com/devswha/ovis/91abe427c14b0b14ee5b2bb66abc81e24d01152f/compare-390-light-ios.png"
width="640"> <img
src="https://raw.githubusercontent.com/devswha/ovis/91abe427c14b0b14ee5b2bb66abc81e24d01152f/compare-390-dark-ios.png"
width="640">

Android Chrome, light (before Chrome's prompt: menu step) / dark (prompt
offered: one-tap Install):

<img
src="https://raw.githubusercontent.com/devswha/ovis/91abe427c14b0b14ee5b2bb66abc81e24d01152f/compare-390-light-android-menu.png"
width="640"> <img
src="https://raw.githubusercontent.com/devswha/ovis/91abe427c14b0b14ee5b2bb66abc81e24d01152f/compare-390-dark-android-install.png"
width="640">

Korean, iPhone / Android with Install (full screens):

<img
src="https://raw.githubusercontent.com/devswha/ovis/91abe427c14b0b14ee5b2bb66abc81e24d01152f/install-hint-390-light-ko-ios.png"
width="300"> <img
src="https://raw.githubusercontent.com/devswha/ovis/91abe427c14b0b14ee5b2bb66abc81e24d01152f/install-hint-390-light-ko-android-install.png"
width="300">

## Earlier Install button

An earlier always-visible "Install app" sidebar button was removed
because it never went away. This line is different: it appears only in
phone browser tabs, one tap closes it for good, and it also leaves for
good once the app is installed.

## Validation

- `bun test src/lib/installHint.test.ts` failed before the module
existed (`Cannot find module './installHint.ts'`) and passes now. It
covers iPhone/iPad/Android/desktop/desktop app, installed, phone apps,
dismissed, plain http and a storage write refusal.
- `bun test src/lib/installHint.test.ts src/lib/i18n.test.ts
src/conventions.test.ts src/lib/install.test.ts`: 60 pass.
- `bun scripts/install-hint-demo-regression.ts`: PASS for light en, dark
en and light ko. iPhone steps and share glyph, dismissal kept after
reload, none in the home-screen app, Android menu step then Install
calling `prompt()`, `appinstalled` remembered after reload, none on
desktop even with a prompt, finger-sized targets, no sideways scroll at
390.
- `bun run check fast`: on the merged head (17b409d): workflow syntax,
generated types/themes, typecheck and build ok; unit tests 11580 pass, 1
fail. The failure is `src/lib/i18n.test.ts` "keeps each part file at 400
lines or fewer" on `src/lib/i18n/settings.{ko,ja,zh}.ts`. Those files
are unchanged here and identical to main, so the failure comes from main
since #2870. Run with `TMPDIR` on disk: this host's tmpfs is out of
inodes, which otherwise fails `server/session-history.test.ts` and
`server/claude-subagents.test.ts` with ENOSPC.
- Not run: the full suite (CI runs it). Not tried on a real iPhone or
Android device: Chrome device emulation only.

Note: at 390 px the iPhone line wraps to two lines with the requested
wording. The Android lines fit on one.
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